Table of Contents

Class ContentEmbedding

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

The embedding generated from an input content.

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

Properties

Statistics

Gemini Enterprise Agent Platform only. Statistics of the input text associated with this embedding.

[JsonPropertyName("statistics")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public ContentEmbeddingStatistics? Statistics { get; set; }

Property Value

ContentEmbeddingStatistics

Values

A list of floats representing an embedding.

[JsonPropertyName("values")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<double>? Values { get; set; }

Property Value

List<double>

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ContentEmbedding object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ContentEmbedding

The deserialized ContentEmbedding object, or null if deserialization fails.