Table of Contents

Class ContentEmbeddingStatistics

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

Statistics of the input text associated with the result of content embedding.

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

Properties

TokenCount

Gemini Enterprise Agent Platform only. Number of tokens of the input text.

[JsonPropertyName("tokenCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double? TokenCount { get; set; }

Property Value

double?

Truncated

Gemini Enterprise Agent Platform only. If the input text was truncated due to having a length longer than the allowed maximum input.

[JsonPropertyName("truncated")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Truncated { get; set; }

Property Value

bool?

Methods

FromJson(string, JsonSerializerOptions?)

Deserializes a JSON string to a ContentEmbeddingStatistics object.

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

Parameters

jsonString string

The JSON string to deserialize.

options JsonSerializerOptions

Optional JsonSerializerOptions.

Returns

ContentEmbeddingStatistics

The deserialized ContentEmbeddingStatistics object, or null if deserialization fails.