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<
296
296
mimeType : prediction . mimeType ,
297
297
gcsURI : prediction . gcsUri
298
298
} as T ) ;
299
+ } else if ( prediction . safetyAttributes ) {
300
+ // Ignore safetyAttributes "prediction" to avoid throwing an error below.
299
301
} else {
300
302
throw new AIError (
301
303
AIErrorCode . RESPONSE_ERROR ,
Original file line number Diff line number Diff line change @@ -61,6 +61,14 @@ export interface ImagenResponseInternal {
61
61
* The reason why the image was filtered.
62
62
*/
63
63
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 ;
64
72
} > ;
65
73
}
66
74
You can’t perform that action at this time.
0 commit comments