Table of Contents

Class GeneratedImage

Namespace
Google.GenAI.Types
Assembly
Google.GenAI.dll

An output image.

public record GeneratedImage : IEquatable<GeneratedImage>
Inheritance
GeneratedImage
Implements
Inherited Members

Properties

EnhancedPrompt

The rewritten prompt used for the image generation if the prompt enhancer is enabled.

[JsonPropertyName("enhancedPrompt")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? EnhancedPrompt { get; set; }

Property Value

string

Image

The output image data.

[JsonPropertyName("image")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public Image? Image { get; set; }

Property Value

Image

RaiFilteredReason

Responsible AI filter reason if the image is filtered out of the response.

[JsonPropertyName("raiFilteredReason")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? RaiFilteredReason { get; set; }

Property Value

string

SafetyAttributes

Safety attributes of the image. Lists of RAI categories and their scores of each content.

[JsonPropertyName("safetyAttributes")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public SafetyAttributes? SafetyAttributes { get; set; }

Property Value

SafetyAttributes

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a GeneratedImage object.

public static GeneratedImage? FromJson(string jsonString, JsonSerializerOptions? options = null)

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

GeneratedImage

The deserialized GeneratedImage object, or null if deserialization fails.