File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -296,6 +296,8 @@ export async function handlePredictResponse<
296296 mimeType : prediction . mimeType ,
297297 gcsURI : prediction . gcsUri
298298 } as T ) ;
299+ } else if ( prediction . safetyAttributes ) {
300+ // Ignore safetyAttributes "prediction" to avoid throwing an error below.
299301 } else {
300302 throw new AIError (
301303 AIErrorCode . RESPONSE_ERROR ,
Original file line number Diff line number Diff line change @@ -61,6 +61,14 @@ export interface ImagenResponseInternal {
6161 * The reason why the image was filtered.
6262 */
6363 raiFilteredReason ?: string ;
64+ /**
65+ * The safety attributes.
66+ *
67+ * This type is currently unused in the SDK. It is sent back because our requests set
68+ * `includeSafetyAttributes`. This field is currently only used to avoid logging unsupported
69+ * prediction types.
70+ */
71+ safetyAttributes ?: unknown ;
6472 } > ;
6573}
6674
You can’t perform that action at this time.
0 commit comments