ImagenGenerationResponse
@available(iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0, *)
public struct ImagenGenerationResponse<T>
extension ImagenGenerationResponse: Decodable where T: Decodable
A response from a request to generate images with Imagen.
The type placeholder T
is an image type; this is currently always an ImagenInlineImage
.
This type is returned from:
generateImages(prompt:)
whereT
isImagenInlineImage
-
The images generated by Imagen; see
ImagenInlineImage
.Important
The number of images generated may be fewer than the number requested if one or more were filtered out; see
filteredReason
.Declaration
Swift
public let images: [T]
-
The reason, if any, that generated images were filtered out.
This property will only be populated if fewer images were generated than were requested, otherwise it will be
nil
. Images may be filtered out due to theImagenSafetyFilterLevel
, theImagenPersonFilterLevel
, or filtering included in the model. The filter levels may be adjusted in yourImagenSafetySettings
. See the Responsible AI and usage guidelines for Imagen for more details.Declaration
Swift
public let filteredReason: String?
-
Declaration
Swift
public init(from decoder: any Decoder) throws