Table of Contents

Class ContentReferenceImage

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

A content reference image. A content reference image represents a subject to reference (ex. person, product, animal) provided by the user. It can optionally be provided in addition to a style reference image (ex. background, style reference).

public record ContentReferenceImage : IReferenceImage, IEquatable<ContentReferenceImage>
Inheritance
ContentReferenceImage
Implements
Inherited Members

Properties

ReferenceId

The id of the reference image.

[JsonPropertyName("referenceId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? ReferenceId { get; set; }

Property Value

int?

ReferenceImage

The reference image for the editing operation.

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

Property Value

Image

ReferenceType

The type of the reference image. Only set by the SDK.

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

Property Value

string

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ContentReferenceImage object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ContentReferenceImage

The deserialized ContentReferenceImage object, or null if deserialization fails.