1818
1919package com .google .genai .types ;
2020
21+ import static com .google .common .collect .ImmutableList .toImmutableList ;
22+
2123import com .fasterxml .jackson .annotation .JsonCreator ;
2224import com .fasterxml .jackson .annotation .JsonProperty ;
2325import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
2426import com .google .auto .value .AutoValue ;
2527import com .google .errorprone .annotations .CanIgnoreReturnValue ;
2628import com .google .genai .JsonSerializable ;
29+ import java .util .Arrays ;
30+ import java .util .List ;
2731import java .util .Optional ;
2832
2933/** Statistics of the input text associated with the result of content embedding. */
@@ -41,6 +45,13 @@ public abstract class ContentEmbeddingStatistics extends JsonSerializable {
4145 @ JsonProperty ("tokenCount" )
4246 public abstract Optional <Float > tokenCount ();
4347
48+ /**
49+ * Gemini Enterprise Agent Platform only. List of modalities and their token count for the input
50+ * content.
51+ */
52+ @ JsonProperty ("tokensDetails" )
53+ public abstract Optional <List <ModalityTokenCount >> tokensDetails ();
54+
4455 /** Instantiates a builder for ContentEmbeddingStatistics. */
4556 @ ExcludeFromGeneratedCoverageReport
4657 public static Builder builder () {
@@ -96,6 +107,50 @@ public Builder clearTokenCount() {
96107 return tokenCount (Optional .empty ());
97108 }
98109
110+ /**
111+ * Setter for tokensDetails.
112+ *
113+ * <p>tokensDetails: Gemini Enterprise Agent Platform only. List of modalities and their token
114+ * count for the input content.
115+ */
116+ @ JsonProperty ("tokensDetails" )
117+ public abstract Builder tokensDetails (List <ModalityTokenCount > tokensDetails );
118+
119+ /**
120+ * Setter for tokensDetails.
121+ *
122+ * <p>tokensDetails: Gemini Enterprise Agent Platform only. List of modalities and their token
123+ * count for the input content.
124+ */
125+ @ CanIgnoreReturnValue
126+ public Builder tokensDetails (ModalityTokenCount ... tokensDetails ) {
127+ return tokensDetails (Arrays .asList (tokensDetails ));
128+ }
129+
130+ /**
131+ * Setter for tokensDetails builder.
132+ *
133+ * <p>tokensDetails: Gemini Enterprise Agent Platform only. List of modalities and their token
134+ * count for the input content.
135+ */
136+ @ CanIgnoreReturnValue
137+ public Builder tokensDetails (ModalityTokenCount .Builder ... tokensDetailsBuilders ) {
138+ return tokensDetails (
139+ Arrays .asList (tokensDetailsBuilders ).stream ()
140+ .map (ModalityTokenCount .Builder ::build )
141+ .collect (toImmutableList ()));
142+ }
143+
144+ @ ExcludeFromGeneratedCoverageReport
145+ abstract Builder tokensDetails (Optional <List <ModalityTokenCount >> tokensDetails );
146+
147+ /** Clears the value of tokensDetails field. */
148+ @ ExcludeFromGeneratedCoverageReport
149+ @ CanIgnoreReturnValue
150+ public Builder clearTokensDetails () {
151+ return tokensDetails (Optional .empty ());
152+ }
153+
99154 public abstract ContentEmbeddingStatistics build ();
100155 }
101156
0 commit comments