diff --git a/Google.GenAI/Batches.cs b/Google.GenAI/Batches.cs
index 1e13e403..77051881 100644
--- a/Google.GenAI/Batches.cs
+++ b/Google.GenAI/Batches.cs
@@ -33,6 +33,45 @@ namespace Google.GenAI {
public sealed class Batches {
private readonly ApiClient _apiClient;
+ internal JsonNode AuthConfigToMldev(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "apiKey" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "apiKey" },
+ Common.GetValueByPath(fromObject, new string[] { "apiKey" }));
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "apiKeyConfig" }))) {
+ throw new NotSupportedException("apiKeyConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authType" }))) {
+ throw new NotSupportedException("authType parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "googleServiceAccountConfig" }))) {
+ throw new NotSupportedException(
+ "googleServiceAccountConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "httpBasicAuthConfig" }))) {
+ throw new NotSupportedException(
+ "httpBasicAuthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oauthConfig" }))) {
+ throw new NotSupportedException("oauthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oidcConfig" }))) {
+ throw new NotSupportedException("oidcConfig parameter is not supported in Gemini API.");
+ }
+
+ return toObject;
+ }
+
internal JsonNode BatchJobDestinationFromMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -423,17 +462,17 @@ internal JsonNode CandidateFromMldev(JsonNode fromObject, JsonObject parentObjec
Common.GetValueByPath(fromObject, new string[] { "finishReason" }));
}
- if (Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }) != null) {
- Common.SetValueByPath(toObject, new string[] { "avgLogprobs" },
- Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "groundingMetadata" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "groundingMetadata" },
Common.GetValueByPath(fromObject, new string[] { "groundingMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "avgLogprobs" },
+ Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "index" }) != null) {
Common.SetValueByPath(toObject, new string[] { "index" },
Common.GetValueByPath(fromObject, new string[] { "index" }));
@@ -1110,6 +1149,11 @@ internal JsonNode GenerateContentResponseFromMldev(JsonNode fromObject,
Common.GetValueByPath(fromObject, new string[] { "usageMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "modelStatus" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "modelStatus" },
+ Common.GetValueByPath(fromObject, new string[] { "modelStatus" }));
+ }
+
return toObject;
}
@@ -1144,8 +1188,12 @@ internal JsonNode GetBatchJobParametersToVertex(ApiClient apiClient, JsonNode fr
internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authConfig" }))) {
- throw new NotSupportedException("authConfig parameter is not supported in Gemini API.");
+ if (Common.GetValueByPath(fromObject, new string[] { "authConfig" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "authConfig" },
+ AuthConfigToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "authConfig" }))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "enableWidget" }) != null) {
@@ -1159,16 +1207,16 @@ internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject
internal JsonNode GoogleSearchToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
- throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
- }
-
if (!Common.IsZero(
Common.GetValueByPath(fromObject, new string[] { "blockingConfidence" }))) {
throw new NotSupportedException(
"blockingConfidence parameter is not supported in Gemini API.");
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
+ throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "timeRangeFilter" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "timeRangeFilter" },
@@ -1206,6 +1254,12 @@ internal JsonNode ImageConfigToMldev(JsonNode fromObject, JsonObject parentObjec
"outputCompressionQuality parameter is not supported in Gemini API.");
}
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "imageOutputOptions" }))) {
+ throw new NotSupportedException(
+ "imageOutputOptions parameter is not supported in Gemini API.");
+ }
+
return toObject;
}
@@ -1466,6 +1520,11 @@ internal JsonNode PartToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "partMetadata" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "partMetadata" },
+ Common.GetValueByPath(fromObject, new string[] { "partMetadata" }));
+ }
+
return toObject;
}
@@ -1521,6 +1580,14 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "computerUse" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "googleMaps" },
+ GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "googleMaps" }))),
+ toObject));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "codeExecution" }) != null) {
Common.SetValueByPath(toObject, new string[] { "codeExecution" },
Common.GetValueByPath(fromObject, new string[] { "codeExecution" }));
@@ -1538,14 +1605,6 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "functionDeclarations" }));
}
- if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
- Common.SetValueByPath(
- toObject, new string[] { "googleMaps" },
- GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
- fromObject, new string[] { "googleMaps" }))),
- toObject));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "googleSearch" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "googleSearch" },
@@ -1560,11 +1619,21 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "googleSearchRetrieval" }));
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }))) {
+ throw new NotSupportedException(
+ "parallelAiSearch parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "urlContext" }) != null) {
Common.SetValueByPath(toObject, new string[] { "urlContext" },
Common.GetValueByPath(fromObject, new string[] { "urlContext" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "mcpServers" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "mcpServers" },
+ Common.GetValueByPath(fromObject, new string[] { "mcpServers" }));
+ }
+
return toObject;
}
diff --git a/Google.GenAI/Caches.cs b/Google.GenAI/Caches.cs
index 58de68f1..84db4688 100644
--- a/Google.GenAI/Caches.cs
+++ b/Google.GenAI/Caches.cs
@@ -28,6 +28,45 @@ namespace Google.GenAI {
public sealed class Caches {
private readonly ApiClient _apiClient;
+ internal JsonNode AuthConfigToMldev(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "apiKey" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "apiKey" },
+ Common.GetValueByPath(fromObject, new string[] { "apiKey" }));
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "apiKeyConfig" }))) {
+ throw new NotSupportedException("apiKeyConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authType" }))) {
+ throw new NotSupportedException("authType parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "googleServiceAccountConfig" }))) {
+ throw new NotSupportedException(
+ "googleServiceAccountConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "httpBasicAuthConfig" }))) {
+ throw new NotSupportedException(
+ "httpBasicAuthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oauthConfig" }))) {
+ throw new NotSupportedException("oauthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oidcConfig" }))) {
+ throw new NotSupportedException("oidcConfig parameter is not supported in Gemini API.");
+ }
+
+ return toObject;
+ }
+
internal JsonNode BlobToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -69,6 +108,27 @@ internal JsonNode ContentToMldev(JsonNode fromObject, JsonObject parentObject) {
return toObject;
}
+ internal JsonNode ContentToVertex(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "parts" }) != null) {
+ JsonArray keyArray = (JsonArray)Common.GetValueByPath(fromObject, new string[] { "parts" });
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyArray) {
+ result.Add(PartToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(toObject, new string[] { "parts" }, result);
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "role" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "role" },
+ Common.GetValueByPath(fromObject, new string[] { "role" }));
+ }
+
+ return toObject;
+ }
+
internal JsonNode CreateCachedContentConfigToMldev(JsonNode fromObject,
JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -153,15 +213,23 @@ internal JsonNode CreateCachedContentConfigToVertex(JsonNode fromObject,
}
if (Common.GetValueByPath(fromObject, new string[] { "contents" }) != null) {
- Common.SetValueByPath(
- parentObject, new string[] { "contents" },
- Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" })));
+ var keyList =
+ Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" }));
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyList) {
+ result.Add(ContentToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(parentObject, new string[] { "contents" }, result);
}
if (Common.GetValueByPath(fromObject, new string[] { "systemInstruction" }) != null) {
- Common.SetValueByPath(parentObject, new string[] { "systemInstruction" },
- Transformers.TContent(Common.GetValueByPath(
- fromObject, new string[] { "systemInstruction" })));
+ Common.SetValueByPath(
+ parentObject, new string[] { "systemInstruction" },
+ ContentToVertex(
+ JsonNode.Parse(JsonSerializer.Serialize(Transformers.TContent(
+ Common.GetValueByPath(fromObject, new string[] { "systemInstruction" })))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "tools" }) != null) {
@@ -444,8 +512,12 @@ internal JsonNode GetCachedContentParametersToVertex(ApiClient apiClient, JsonNo
internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authConfig" }))) {
- throw new NotSupportedException("authConfig parameter is not supported in Gemini API.");
+ if (Common.GetValueByPath(fromObject, new string[] { "authConfig" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "authConfig" },
+ AuthConfigToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "authConfig" }))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "enableWidget" }) != null) {
@@ -459,16 +531,16 @@ internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject
internal JsonNode GoogleSearchToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
- throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
- }
-
if (!Common.IsZero(
Common.GetValueByPath(fromObject, new string[] { "blockingConfidence" }))) {
throw new NotSupportedException(
"blockingConfidence parameter is not supported in Gemini API.");
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
+ throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "timeRangeFilter" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "timeRangeFilter" },
@@ -657,6 +729,80 @@ internal JsonNode PartToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "partMetadata" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "partMetadata" },
+ Common.GetValueByPath(fromObject, new string[] { "partMetadata" }));
+ }
+
+ return toObject;
+ }
+
+ internal JsonNode PartToVertex(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "mediaResolution" },
+ Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "codeExecutionResult" },
+ Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "executableCode" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "executableCode" },
+ Common.GetValueByPath(fromObject, new string[] { "executableCode" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "fileData" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "fileData" },
+ Common.GetValueByPath(fromObject, new string[] { "fileData" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "functionCall" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "functionCall" },
+ Common.GetValueByPath(fromObject, new string[] { "functionCall" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "functionResponse" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "functionResponse" },
+ Common.GetValueByPath(fromObject, new string[] { "functionResponse" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "inlineData" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "inlineData" },
+ Common.GetValueByPath(fromObject, new string[] { "inlineData" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "text" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "text" },
+ Common.GetValueByPath(fromObject, new string[] { "text" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "thought" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "thought" },
+ Common.GetValueByPath(fromObject, new string[] { "thought" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "thoughtSignature" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "thoughtSignature" },
+ Common.GetValueByPath(fromObject, new string[] { "thoughtSignature" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "videoMetadata" },
+ Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }));
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "partMetadata" }))) {
+ throw new NotSupportedException("partMetadata parameter is not supported in Vertex AI.");
+ }
+
return toObject;
}
@@ -692,6 +838,14 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "computerUse" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "googleMaps" },
+ GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "googleMaps" }))),
+ toObject));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "codeExecution" }) != null) {
Common.SetValueByPath(toObject, new string[] { "codeExecution" },
Common.GetValueByPath(fromObject, new string[] { "codeExecution" }));
@@ -709,14 +863,6 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "functionDeclarations" }));
}
- if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
- Common.SetValueByPath(
- toObject, new string[] { "googleMaps" },
- GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
- fromObject, new string[] { "googleMaps" }))),
- toObject));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "googleSearch" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "googleSearch" },
@@ -731,11 +877,21 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "googleSearchRetrieval" }));
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }))) {
+ throw new NotSupportedException(
+ "parallelAiSearch parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "urlContext" }) != null) {
Common.SetValueByPath(toObject, new string[] { "urlContext" },
Common.GetValueByPath(fromObject, new string[] { "urlContext" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "mcpServers" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "mcpServers" },
+ Common.GetValueByPath(fromObject, new string[] { "mcpServers" }));
+ }
+
return toObject;
}
@@ -752,6 +908,11 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "computerUse" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "googleMaps" },
+ Common.GetValueByPath(fromObject, new string[] { "googleMaps" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "codeExecution" }) != null) {
Common.SetValueByPath(toObject, new string[] { "codeExecution" },
Common.GetValueByPath(fromObject, new string[] { "codeExecution" }));
@@ -775,11 +936,6 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.SetValueByPath(toObject, new string[] { "functionDeclarations" }, result);
}
- if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
- Common.SetValueByPath(toObject, new string[] { "googleMaps" },
- Common.GetValueByPath(fromObject, new string[] { "googleMaps" }));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "googleSearch" }) != null) {
Common.SetValueByPath(toObject, new string[] { "googleSearch" },
Common.GetValueByPath(fromObject, new string[] { "googleSearch" }));
@@ -791,11 +947,21 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "googleSearchRetrieval" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "parallelAiSearch" },
+ Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "urlContext" }) != null) {
Common.SetValueByPath(toObject, new string[] { "urlContext" },
Common.GetValueByPath(fromObject, new string[] { "urlContext" }));
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "mcpServers" }))) {
+ throw new NotSupportedException("mcpServers parameter is not supported in Vertex AI.");
+ }
+
return toObject;
}
diff --git a/Google.GenAI/LiveConverters.cs b/Google.GenAI/LiveConverters.cs
index e82fbff0..3d028fb7 100644
--- a/Google.GenAI/LiveConverters.cs
+++ b/Google.GenAI/LiveConverters.cs
@@ -31,6 +31,45 @@ public LiveConverters(ApiClient apiClient) {
_apiClient = apiClient;
}
+ internal JsonNode AuthConfigToMldev(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "apiKey" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "apiKey" },
+ Common.GetValueByPath(fromObject, new string[] { "apiKey" }));
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "apiKeyConfig" }))) {
+ throw new NotSupportedException("apiKeyConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authType" }))) {
+ throw new NotSupportedException("authType parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "googleServiceAccountConfig" }))) {
+ throw new NotSupportedException(
+ "googleServiceAccountConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "httpBasicAuthConfig" }))) {
+ throw new NotSupportedException(
+ "httpBasicAuthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oauthConfig" }))) {
+ throw new NotSupportedException("oauthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oidcConfig" }))) {
+ throw new NotSupportedException("oidcConfig parameter is not supported in Gemini API.");
+ }
+
+ return toObject;
+ }
+
internal JsonNode BlobToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -72,6 +111,27 @@ internal JsonNode ContentToMldev(JsonNode fromObject, JsonObject parentObject) {
return toObject;
}
+ internal JsonNode ContentToVertex(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "parts" }) != null) {
+ JsonArray keyArray = (JsonArray)Common.GetValueByPath(fromObject, new string[] { "parts" });
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyArray) {
+ result.Add(PartToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(toObject, new string[] { "parts" }, result);
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "role" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "role" },
+ Common.GetValueByPath(fromObject, new string[] { "role" }));
+ }
+
+ return toObject;
+ }
+
internal JsonNode FileDataToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -312,8 +372,12 @@ internal JsonNode GenerationConfigToVertex(JsonNode fromObject, JsonObject paren
internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authConfig" }))) {
- throw new NotSupportedException("authConfig parameter is not supported in Gemini API.");
+ if (Common.GetValueByPath(fromObject, new string[] { "authConfig" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "authConfig" },
+ AuthConfigToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "authConfig" }))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "enableWidget" }) != null) {
@@ -327,16 +391,16 @@ internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject
internal JsonNode GoogleSearchToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
- throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
- }
-
if (!Common.IsZero(
Common.GetValueByPath(fromObject, new string[] { "blockingConfidence" }))) {
throw new NotSupportedException(
"blockingConfidence parameter is not supported in Gemini API.");
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
+ throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "timeRangeFilter" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "timeRangeFilter" },
@@ -367,6 +431,27 @@ internal JsonNode LiveClientContentToMldev(JsonNode fromObject, JsonObject paren
return toObject;
}
+ internal JsonNode LiveClientContentToVertex(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "turns" }) != null) {
+ JsonArray keyArray = (JsonArray)Common.GetValueByPath(fromObject, new string[] { "turns" });
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyArray) {
+ result.Add(ContentToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(toObject, new string[] { "turns" }, result);
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "turnComplete" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "turnComplete" },
+ Common.GetValueByPath(fromObject, new string[] { "turnComplete" }));
+ }
+
+ return toObject;
+ }
+
internal JsonNode LiveClientMessageToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -422,8 +507,11 @@ internal JsonNode LiveClientMessageToVertex(JsonNode fromObject, JsonObject pare
}
if (Common.GetValueByPath(fromObject, new string[] { "clientContent" }) != null) {
- Common.SetValueByPath(toObject, new string[] { "clientContent" },
- Common.GetValueByPath(fromObject, new string[] { "clientContent" }));
+ Common.SetValueByPath(
+ toObject, new string[] { "clientContent" },
+ LiveClientContentToVertex(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "clientContent" }))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "realtimeInput" }) != null) {
@@ -641,9 +729,12 @@ internal JsonNode LiveClientSetupToVertex(JsonNode fromObject, JsonObject parent
}
if (Common.GetValueByPath(fromObject, new string[] { "systemInstruction" }) != null) {
- Common.SetValueByPath(toObject, new string[] { "systemInstruction" },
- Transformers.TContent(Common.GetValueByPath(
- fromObject, new string[] { "systemInstruction" })));
+ Common.SetValueByPath(
+ toObject, new string[] { "systemInstruction" },
+ ContentToVertex(
+ JsonNode.Parse(JsonSerializer.Serialize(Transformers.TContent(
+ Common.GetValueByPath(fromObject, new string[] { "systemInstruction" })))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "tools" }) != null) {
@@ -905,9 +996,12 @@ internal JsonNode LiveConnectConfigToVertex(JsonNode fromObject, JsonObject pare
}
if (Common.GetValueByPath(fromObject, new string[] { "systemInstruction" }) != null) {
- Common.SetValueByPath(parentObject, new string[] { "setup", "systemInstruction" },
- Transformers.TContent(Common.GetValueByPath(
- fromObject, new string[] { "systemInstruction" })));
+ Common.SetValueByPath(
+ parentObject, new string[] { "setup", "systemInstruction" },
+ ContentToVertex(
+ JsonNode.Parse(JsonSerializer.Serialize(Transformers.TContent(
+ Common.GetValueByPath(fromObject, new string[] { "systemInstruction" })))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "tools" }) != null) {
@@ -1299,6 +1393,80 @@ internal JsonNode PartToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "partMetadata" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "partMetadata" },
+ Common.GetValueByPath(fromObject, new string[] { "partMetadata" }));
+ }
+
+ return toObject;
+ }
+
+ internal JsonNode PartToVertex(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "mediaResolution" },
+ Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "codeExecutionResult" },
+ Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "executableCode" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "executableCode" },
+ Common.GetValueByPath(fromObject, new string[] { "executableCode" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "fileData" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "fileData" },
+ Common.GetValueByPath(fromObject, new string[] { "fileData" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "functionCall" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "functionCall" },
+ Common.GetValueByPath(fromObject, new string[] { "functionCall" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "functionResponse" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "functionResponse" },
+ Common.GetValueByPath(fromObject, new string[] { "functionResponse" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "inlineData" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "inlineData" },
+ Common.GetValueByPath(fromObject, new string[] { "inlineData" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "text" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "text" },
+ Common.GetValueByPath(fromObject, new string[] { "text" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "thought" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "thought" },
+ Common.GetValueByPath(fromObject, new string[] { "thought" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "thoughtSignature" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "thoughtSignature" },
+ Common.GetValueByPath(fromObject, new string[] { "thoughtSignature" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "videoMetadata" },
+ Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }));
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "partMetadata" }))) {
+ throw new NotSupportedException("partMetadata parameter is not supported in Vertex AI.");
+ }
+
return toObject;
}
@@ -1329,6 +1497,14 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "computerUse" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "googleMaps" },
+ GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "googleMaps" }))),
+ toObject));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "codeExecution" }) != null) {
Common.SetValueByPath(toObject, new string[] { "codeExecution" },
Common.GetValueByPath(fromObject, new string[] { "codeExecution" }));
@@ -1346,14 +1522,6 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "functionDeclarations" }));
}
- if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
- Common.SetValueByPath(
- toObject, new string[] { "googleMaps" },
- GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
- fromObject, new string[] { "googleMaps" }))),
- toObject));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "googleSearch" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "googleSearch" },
@@ -1368,11 +1536,21 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "googleSearchRetrieval" }));
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }))) {
+ throw new NotSupportedException(
+ "parallelAiSearch parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "urlContext" }) != null) {
Common.SetValueByPath(toObject, new string[] { "urlContext" },
Common.GetValueByPath(fromObject, new string[] { "urlContext" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "mcpServers" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "mcpServers" },
+ Common.GetValueByPath(fromObject, new string[] { "mcpServers" }));
+ }
+
return toObject;
}
@@ -1389,6 +1567,11 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "computerUse" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "googleMaps" },
+ Common.GetValueByPath(fromObject, new string[] { "googleMaps" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "codeExecution" }) != null) {
Common.SetValueByPath(toObject, new string[] { "codeExecution" },
Common.GetValueByPath(fromObject, new string[] { "codeExecution" }));
@@ -1412,11 +1595,6 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.SetValueByPath(toObject, new string[] { "functionDeclarations" }, result);
}
- if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
- Common.SetValueByPath(toObject, new string[] { "googleMaps" },
- Common.GetValueByPath(fromObject, new string[] { "googleMaps" }));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "googleSearch" }) != null) {
Common.SetValueByPath(toObject, new string[] { "googleSearch" },
Common.GetValueByPath(fromObject, new string[] { "googleSearch" }));
@@ -1428,11 +1606,21 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "googleSearchRetrieval" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "parallelAiSearch" },
+ Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "urlContext" }) != null) {
Common.SetValueByPath(toObject, new string[] { "urlContext" },
Common.GetValueByPath(fromObject, new string[] { "urlContext" }));
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "mcpServers" }))) {
+ throw new NotSupportedException("mcpServers parameter is not supported in Vertex AI.");
+ }
+
return toObject;
}
diff --git a/Google.GenAI/Models.cs b/Google.GenAI/Models.cs
index 3aaee40e..4b5bd22f 100644
--- a/Google.GenAI/Models.cs
+++ b/Google.GenAI/Models.cs
@@ -33,6 +33,45 @@ namespace Google.GenAI {
public sealed class Models {
private readonly ApiClient _apiClient;
+ internal JsonNode AuthConfigToMldev(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "apiKey" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "apiKey" },
+ Common.GetValueByPath(fromObject, new string[] { "apiKey" }));
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "apiKeyConfig" }))) {
+ throw new NotSupportedException("apiKeyConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authType" }))) {
+ throw new NotSupportedException("authType parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "googleServiceAccountConfig" }))) {
+ throw new NotSupportedException(
+ "googleServiceAccountConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "httpBasicAuthConfig" }))) {
+ throw new NotSupportedException(
+ "httpBasicAuthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oauthConfig" }))) {
+ throw new NotSupportedException("oauthConfig parameter is not supported in Gemini API.");
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "oidcConfig" }))) {
+ throw new NotSupportedException("oidcConfig parameter is not supported in Gemini API.");
+ }
+
+ return toObject;
+ }
+
internal JsonNode BlobToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -79,17 +118,17 @@ internal JsonNode CandidateFromMldev(JsonNode fromObject, JsonObject parentObjec
Common.GetValueByPath(fromObject, new string[] { "finishReason" }));
}
- if (Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }) != null) {
- Common.SetValueByPath(toObject, new string[] { "avgLogprobs" },
- Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "groundingMetadata" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "groundingMetadata" },
Common.GetValueByPath(fromObject, new string[] { "groundingMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "avgLogprobs" },
+ Common.GetValueByPath(fromObject, new string[] { "avgLogprobs" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "index" }) != null) {
Common.SetValueByPath(toObject, new string[] { "index" },
Common.GetValueByPath(fromObject, new string[] { "index" }));
@@ -138,9 +177,14 @@ internal JsonNode ComputeTokensParametersToVertex(ApiClient apiClient, JsonNode
}
if (Common.GetValueByPath(fromObject, new string[] { "contents" }) != null) {
- Common.SetValueByPath(
- toObject, new string[] { "contents" },
- Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" })));
+ var keyList =
+ Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" }));
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyList) {
+ result.Add(ContentToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(toObject, new string[] { "contents" }, result);
}
return toObject;
@@ -221,6 +265,27 @@ internal JsonNode ContentToMldev(JsonNode fromObject, JsonObject parentObject) {
return toObject;
}
+ internal JsonNode ContentToVertex(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "parts" }) != null) {
+ JsonArray keyArray = (JsonArray)Common.GetValueByPath(fromObject, new string[] { "parts" });
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyArray) {
+ result.Add(PartToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(toObject, new string[] { "parts" }, result);
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "role" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "role" },
+ Common.GetValueByPath(fromObject, new string[] { "role" }));
+ }
+
+ return toObject;
+ }
+
internal JsonNode ControlReferenceConfigToVertex(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
@@ -263,9 +328,12 @@ internal JsonNode CountTokensConfigToVertex(JsonNode fromObject, JsonObject pare
JsonObject toObject = new JsonObject();
if (Common.GetValueByPath(fromObject, new string[] { "systemInstruction" }) != null) {
- Common.SetValueByPath(parentObject, new string[] { "systemInstruction" },
- Transformers.TContent(Common.GetValueByPath(
- fromObject, new string[] { "systemInstruction" })));
+ Common.SetValueByPath(
+ parentObject, new string[] { "systemInstruction" },
+ ContentToVertex(
+ JsonNode.Parse(JsonSerializer.Serialize(Transformers.TContent(
+ Common.GetValueByPath(fromObject, new string[] { "systemInstruction" })))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "tools" }) != null) {
@@ -332,9 +400,14 @@ internal JsonNode CountTokensParametersToVertex(ApiClient apiClient, JsonNode fr
}
if (Common.GetValueByPath(fromObject, new string[] { "contents" }) != null) {
- Common.SetValueByPath(
- toObject, new string[] { "contents" },
- Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" })));
+ var keyList =
+ Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" }));
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyList) {
+ result.Add(ContentToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(toObject, new string[] { "contents" }, result);
}
if (Common.GetValueByPath(fromObject, new string[] { "config" }) != null) {
@@ -1115,9 +1188,12 @@ internal JsonNode GenerateContentConfigToVertex(ApiClient apiClient, JsonNode fr
JsonObject toObject = new JsonObject();
if (Common.GetValueByPath(fromObject, new string[] { "systemInstruction" }) != null) {
- Common.SetValueByPath(parentObject, new string[] { "systemInstruction" },
- Transformers.TContent(Common.GetValueByPath(
- fromObject, new string[] { "systemInstruction" })));
+ Common.SetValueByPath(
+ parentObject, new string[] { "systemInstruction" },
+ ContentToVertex(
+ JsonNode.Parse(JsonSerializer.Serialize(Transformers.TContent(
+ Common.GetValueByPath(fromObject, new string[] { "systemInstruction" })))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "temperature" }) != null) {
@@ -1340,9 +1416,14 @@ internal JsonNode GenerateContentParametersToVertex(ApiClient apiClient, JsonNod
}
if (Common.GetValueByPath(fromObject, new string[] { "contents" }) != null) {
- Common.SetValueByPath(
- toObject, new string[] { "contents" },
- Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" })));
+ var keyList =
+ Transformers.TContents(Common.GetValueByPath(fromObject, new string[] { "contents" }));
+ JsonArray result = new JsonArray();
+
+ foreach (var record in keyList) {
+ result.Add(ContentToVertex(JsonNode.Parse(JsonSerializer.Serialize(record)), toObject));
+ }
+ Common.SetValueByPath(toObject, new string[] { "contents" }, result);
}
if (Common.GetValueByPath(fromObject, new string[] { "config" }) != null) {
@@ -1399,6 +1480,11 @@ internal JsonNode GenerateContentResponseFromMldev(JsonNode fromObject,
Common.GetValueByPath(fromObject, new string[] { "usageMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "modelStatus" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "modelStatus" },
+ Common.GetValueByPath(fromObject, new string[] { "modelStatus" }));
+ }
+
return toObject;
}
@@ -2509,8 +2595,12 @@ internal JsonNode GetModelParametersToVertex(ApiClient apiClient, JsonNode fromO
internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "authConfig" }))) {
- throw new NotSupportedException("authConfig parameter is not supported in Gemini API.");
+ if (Common.GetValueByPath(fromObject, new string[] { "authConfig" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "authConfig" },
+ AuthConfigToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "authConfig" }))),
+ toObject));
}
if (Common.GetValueByPath(fromObject, new string[] { "enableWidget" }) != null) {
@@ -2524,16 +2614,16 @@ internal JsonNode GoogleMapsToMldev(JsonNode fromObject, JsonObject parentObject
internal JsonNode GoogleSearchToMldev(JsonNode fromObject, JsonObject parentObject) {
JsonObject toObject = new JsonObject();
- if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
- throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
- }
-
if (!Common.IsZero(
Common.GetValueByPath(fromObject, new string[] { "blockingConfidence" }))) {
throw new NotSupportedException(
"blockingConfidence parameter is not supported in Gemini API.");
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "excludeDomains" }))) {
+ throw new NotSupportedException("excludeDomains parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "timeRangeFilter" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "timeRangeFilter" },
@@ -2571,6 +2661,12 @@ internal JsonNode ImageConfigToMldev(JsonNode fromObject, JsonObject parentObjec
"outputCompressionQuality parameter is not supported in Gemini API.");
}
+ if (!Common.IsZero(
+ Common.GetValueByPath(fromObject, new string[] { "imageOutputOptions" }))) {
+ throw new NotSupportedException(
+ "imageOutputOptions parameter is not supported in Gemini API.");
+ }
+
return toObject;
}
@@ -2604,6 +2700,12 @@ internal JsonNode ImageConfigToVertex(JsonNode fromObject, JsonObject parentObje
Common.GetValueByPath(fromObject, new string[] { "outputCompressionQuality" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "imageOutputOptions" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "imageOutputOptions" },
+ Common.GetValueByPath(fromObject, new string[] { "imageOutputOptions" }));
+ }
+
return toObject;
}
@@ -3061,6 +3163,80 @@ internal JsonNode PartToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "partMetadata" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "partMetadata" },
+ Common.GetValueByPath(fromObject, new string[] { "partMetadata" }));
+ }
+
+ return toObject;
+ }
+
+ internal JsonNode PartToVertex(JsonNode fromObject, JsonObject parentObject) {
+ JsonObject toObject = new JsonObject();
+
+ if (Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "mediaResolution" },
+ Common.GetValueByPath(fromObject, new string[] { "mediaResolution" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "codeExecutionResult" },
+ Common.GetValueByPath(fromObject, new string[] { "codeExecutionResult" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "executableCode" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "executableCode" },
+ Common.GetValueByPath(fromObject, new string[] { "executableCode" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "fileData" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "fileData" },
+ Common.GetValueByPath(fromObject, new string[] { "fileData" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "functionCall" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "functionCall" },
+ Common.GetValueByPath(fromObject, new string[] { "functionCall" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "functionResponse" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "functionResponse" },
+ Common.GetValueByPath(fromObject, new string[] { "functionResponse" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "inlineData" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "inlineData" },
+ Common.GetValueByPath(fromObject, new string[] { "inlineData" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "text" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "text" },
+ Common.GetValueByPath(fromObject, new string[] { "text" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "thought" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "thought" },
+ Common.GetValueByPath(fromObject, new string[] { "thought" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "thoughtSignature" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "thoughtSignature" },
+ Common.GetValueByPath(fromObject, new string[] { "thoughtSignature" }));
+ }
+
+ if (Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "videoMetadata" },
+ Common.GetValueByPath(fromObject, new string[] { "videoMetadata" }));
+ }
+
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "partMetadata" }))) {
+ throw new NotSupportedException("partMetadata parameter is not supported in Vertex AI.");
+ }
+
return toObject;
}
@@ -3501,6 +3677,14 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "computerUse" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "googleMaps" },
+ GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
+ fromObject, new string[] { "googleMaps" }))),
+ toObject));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "codeExecution" }) != null) {
Common.SetValueByPath(toObject, new string[] { "codeExecution" },
Common.GetValueByPath(fromObject, new string[] { "codeExecution" }));
@@ -3518,14 +3702,6 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "functionDeclarations" }));
}
- if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
- Common.SetValueByPath(
- toObject, new string[] { "googleMaps" },
- GoogleMapsToMldev(JsonNode.Parse(JsonSerializer.Serialize(Common.GetValueByPath(
- fromObject, new string[] { "googleMaps" }))),
- toObject));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "googleSearch" }) != null) {
Common.SetValueByPath(
toObject, new string[] { "googleSearch" },
@@ -3540,11 +3716,21 @@ internal JsonNode ToolToMldev(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "googleSearchRetrieval" }));
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }))) {
+ throw new NotSupportedException(
+ "parallelAiSearch parameter is not supported in Gemini API.");
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "urlContext" }) != null) {
Common.SetValueByPath(toObject, new string[] { "urlContext" },
Common.GetValueByPath(fromObject, new string[] { "urlContext" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "mcpServers" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "mcpServers" },
+ Common.GetValueByPath(fromObject, new string[] { "mcpServers" }));
+ }
+
return toObject;
}
@@ -3561,6 +3747,11 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "computerUse" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "googleMaps" },
+ Common.GetValueByPath(fromObject, new string[] { "googleMaps" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "codeExecution" }) != null) {
Common.SetValueByPath(toObject, new string[] { "codeExecution" },
Common.GetValueByPath(fromObject, new string[] { "codeExecution" }));
@@ -3584,11 +3775,6 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.SetValueByPath(toObject, new string[] { "functionDeclarations" }, result);
}
- if (Common.GetValueByPath(fromObject, new string[] { "googleMaps" }) != null) {
- Common.SetValueByPath(toObject, new string[] { "googleMaps" },
- Common.GetValueByPath(fromObject, new string[] { "googleMaps" }));
- }
-
if (Common.GetValueByPath(fromObject, new string[] { "googleSearch" }) != null) {
Common.SetValueByPath(toObject, new string[] { "googleSearch" },
Common.GetValueByPath(fromObject, new string[] { "googleSearch" }));
@@ -3600,11 +3786,21 @@ internal JsonNode ToolToVertex(JsonNode fromObject, JsonObject parentObject) {
Common.GetValueByPath(fromObject, new string[] { "googleSearchRetrieval" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "parallelAiSearch" },
+ Common.GetValueByPath(fromObject, new string[] { "parallelAiSearch" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "urlContext" }) != null) {
Common.SetValueByPath(toObject, new string[] { "urlContext" },
Common.GetValueByPath(fromObject, new string[] { "urlContext" }));
}
+ if (!Common.IsZero(Common.GetValueByPath(fromObject, new string[] { "mcpServers" }))) {
+ throw new NotSupportedException("mcpServers parameter is not supported in Vertex AI.");
+ }
+
return toObject;
}
diff --git a/Google.GenAI/Tunings.cs b/Google.GenAI/Tunings.cs
index 88cc48b3..6da666c8 100644
--- a/Google.GenAI/Tunings.cs
+++ b/Google.GenAI/Tunings.cs
@@ -779,11 +779,23 @@ internal JsonNode TuningJobFromVertex(JsonNode fromObject, JsonObject parentObje
Common.GetValueByPath(fromObject, new string[] { "customBaseModel" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "evaluateDatasetRuns" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "evaluateDatasetRuns" },
+ Common.GetValueByPath(fromObject, new string[] { "evaluateDatasetRuns" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "experiment" }) != null) {
Common.SetValueByPath(toObject, new string[] { "experiment" },
Common.GetValueByPath(fromObject, new string[] { "experiment" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "fullFineTuningSpec" }) != null) {
+ Common.SetValueByPath(
+ toObject, new string[] { "fullFineTuningSpec" },
+ Common.GetValueByPath(fromObject, new string[] { "fullFineTuningSpec" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "labels" }) != null) {
Common.SetValueByPath(toObject, new string[] { "labels" },
Common.GetValueByPath(fromObject, new string[] { "labels" }));
@@ -810,6 +822,11 @@ internal JsonNode TuningJobFromVertex(JsonNode fromObject, JsonObject parentObje
Common.GetValueByPath(fromObject, new string[] { "tunedModelDisplayName" }));
}
+ if (Common.GetValueByPath(fromObject, new string[] { "tuningJobState" }) != null) {
+ Common.SetValueByPath(toObject, new string[] { "tuningJobState" },
+ Common.GetValueByPath(fromObject, new string[] { "tuningJobState" }));
+ }
+
if (Common.GetValueByPath(fromObject, new string[] { "veoTuningSpec" }) != null) {
Common.SetValueByPath(toObject, new string[] { "veoTuningSpec" },
Common.GetValueByPath(fromObject, new string[] { "veoTuningSpec" }));
diff --git a/Google.GenAI/types/AggregationMetric.cs b/Google.GenAI/types/AggregationMetric.cs
new file mode 100644
index 00000000..61e20976
--- /dev/null
+++ b/Google.GenAI/types/AggregationMetric.cs
@@ -0,0 +1,82 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System.Text.Json.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Aggregation metric. This enum is not supported in Gemini API.
+ ///
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum AggregationMetric {
+ ///
+ /// Unspecified aggregation metric.
+ ///
+ [JsonPropertyName("AGGREGATION_METRIC_UNSPECIFIED")] AGGREGATION_METRIC_UNSPECIFIED,
+
+ ///
+ /// Average aggregation metric. Not supported for Pairwise metric.
+ ///
+ [JsonPropertyName("AVERAGE")] AVERAGE,
+
+ ///
+ /// Mode aggregation metric.
+ ///
+ [JsonPropertyName("MODE")] MODE,
+
+ ///
+ /// Standard deviation aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("STANDARD_DEVIATION")] STANDARD_DEVIATION,
+
+ ///
+ /// Variance aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("VARIANCE")] VARIANCE,
+
+ ///
+ /// Minimum aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("MINIMUM")] MINIMUM,
+
+ ///
+ /// Maximum aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("MAXIMUM")] MAXIMUM,
+
+ ///
+ /// Median aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("MEDIAN")] MEDIAN,
+
+ ///
+ /// 90th percentile aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("PERCENTILE_P90")] PERCENTILE_P90,
+
+ ///
+ /// 95th percentile aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("PERCENTILE_P95")] PERCENTILE_P95,
+
+ ///
+ /// 99th percentile aggregation metric. Not supported for pairwise metric.
+ ///
+ [JsonPropertyName("PERCENTILE_P99")] PERCENTILE_P99
+ }
+}
diff --git a/Google.GenAI/types/AggregationOutput.cs b/Google.GenAI/types/AggregationOutput.cs
new file mode 100644
index 00000000..4f3c1688
--- /dev/null
+++ b/Google.GenAI/types/AggregationOutput.cs
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The aggregation result for the entire dataset and all metrics. This data type is not supported
+ /// in Gemini API.
+ ///
+
+ public record AggregationOutput {
+ ///
+ /// One AggregationResult per metric.
+ ///
+ [JsonPropertyName("aggregationResults")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List ? AggregationResults { get; set; }
+
+ ///
+ /// The dataset used for evaluation & aggregation.
+ ///
+ [JsonPropertyName("dataset")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public EvaluationDataset
+ ? Dataset {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a AggregationOutput object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized AggregationOutput object, or null if deserialization
+ /// fails.
+ public static AggregationOutput
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/AggregationResult.cs b/Google.GenAI/types/AggregationResult.cs
new file mode 100644
index 00000000..4add2e49
--- /dev/null
+++ b/Google.GenAI/types/AggregationResult.cs
@@ -0,0 +1,114 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The aggregation result for a single metric. This data type is not supported in Gemini API.
+ ///
+
+ public record AggregationResult {
+ ///
+ /// Aggregation metric.
+ ///
+ [JsonPropertyName("aggregationMetric")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public AggregationMetric ? AggregationMetric { get; set; }
+
+ ///
+ /// Results for bleu metric.
+ ///
+ [JsonPropertyName("bleuMetricValue")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public BleuMetricValue
+ ? BleuMetricValue {
+ get; set;
+ }
+
+ ///
+ /// Result for code execution metric.
+ ///
+ [JsonPropertyName("customCodeExecutionResult")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public CustomCodeExecutionResult
+ ? CustomCodeExecutionResult {
+ get; set;
+ }
+
+ ///
+ /// Results for exact match metric.
+ ///
+ [JsonPropertyName("exactMatchMetricValue")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public ExactMatchMetricValue
+ ? ExactMatchMetricValue {
+ get; set;
+ }
+
+ ///
+ /// Result for pairwise metric.
+ ///
+ [JsonPropertyName("pairwiseMetricResult")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public PairwiseMetricResult
+ ? PairwiseMetricResult {
+ get; set;
+ }
+
+ ///
+ /// Result for pointwise metric.
+ ///
+ [JsonPropertyName("pointwiseMetricResult")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public PointwiseMetricResult
+ ? PointwiseMetricResult {
+ get; set;
+ }
+
+ ///
+ /// Results for rouge metric.
+ ///
+ [JsonPropertyName("rougeMetricValue")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public RougeMetricValue
+ ? RougeMetricValue {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a AggregationResult object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized AggregationResult object, or null if deserialization
+ /// fails.
+ public static AggregationResult
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/AuthConfig.cs b/Google.GenAI/types/AuthConfig.cs
index 99887f98..e8762d67 100644
--- a/Google.GenAI/types/AuthConfig.cs
+++ b/Google.GenAI/types/AuthConfig.cs
@@ -23,16 +23,27 @@
namespace Google.GenAI.Types {
///
- /// Auth configuration to run the extension. This data type is not supported in Gemini API.
+ /// The authentication config to access the API.
///
public record AuthConfig {
+ ///
+ /// The authentication config to access the API. Only API key is supported. This field is not
+ /// supported in Gemini API.
+ ///
+ [JsonPropertyName("apiKey")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string ? ApiKey { get; set; }
+
///
/// Config for API key auth.
///
[JsonPropertyName("apiKeyConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public ApiKeyConfig ? ApiKeyConfig { get; set; }
+ public ApiKeyConfig
+ ? ApiKeyConfig {
+ get; set;
+ }
///
/// Type of auth scheme.
diff --git a/Google.GenAI/types/BigQuerySource.cs b/Google.GenAI/types/BigQuerySource.cs
new file mode 100644
index 00000000..9dff512f
--- /dev/null
+++ b/Google.GenAI/types/BigQuerySource.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The BigQuery location for the input content. This data type is not supported in Gemini API.
+ ///
+
+ public record BigQuerySource {
+ ///
+ /// BigQuery URI to a table, up to 2000 characters long. Accepted forms: * BigQuery path. For
+ /// example: `bq://projectId.bqDatasetId.bqTableId`.
+ ///
+ [JsonPropertyName("inputUri")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string ? InputUri { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a BigQuerySource object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized BigQuerySource object, or null if deserialization fails.
+ public static BigQuerySource
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/BleuMetricValue.cs b/Google.GenAI/types/BleuMetricValue.cs
new file mode 100644
index 00000000..126ac7fd
--- /dev/null
+++ b/Google.GenAI/types/BleuMetricValue.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Bleu metric value for an instance. This data type is not supported in Gemini API.
+ ///
+
+ public record BleuMetricValue {
+ ///
+ /// Output only. Bleu score.
+ ///
+ [JsonPropertyName("score")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public double ? Score { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a BleuMetricValue object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized BleuMetricValue object, or null if deserialization
+ /// fails.
+ public static BleuMetricValue
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/Blob.cs b/Google.GenAI/types/Blob.cs
index 3dbeca21..6ad82514 100644
--- a/Google.GenAI/types/Blob.cs
+++ b/Google.GenAI/types/Blob.cs
@@ -23,22 +23,23 @@
namespace Google.GenAI.Types {
///
- /// Content blob.
+ /// A content blob. A Blob contains data of a specific media type. It is used to represent images,
+ /// audio, and video.
///
public record Blob {
///
- /// Raw bytes.
+ /// The raw bytes of the data.
///
[JsonPropertyName("data")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public byte[] ? Data { get; set; }
///
- /// Optional. Display name of the blob. Used to provide a label or filename to distinguish
- /// blobs. This field is only returned in PromptMessage for prompt management. It is currently
- /// used in the Gemini GenerateContent calls only when server side tools (code_execution,
- /// google_search, and url_context) are enabled. This field is not supported in Gemini API.
+ /// Optional. The display name of the blob. Used to provide a label or filename to distinguish
+ /// blobs. This field is only returned in `PromptMessage` for prompt management. It is used in
+ /// the Gemini calls only when server-side tools (`code_execution`, `google_search`, and
+ /// `url_context`) are enabled. This field is not supported in Gemini API.
///
[JsonPropertyName("displayName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/Candidate.cs b/Google.GenAI/types/Candidate.cs
index 117b788e..97991665 100644
--- a/Google.GenAI/types/Candidate.cs
+++ b/Google.GenAI/types/Candidate.cs
@@ -76,27 +76,31 @@ public FinishReason
}
///
- /// Output only. Average log probability score of the candidate.
+ /// Output only. Grounding metadata for the candidate. This field is populated for
+ /// `GenerateContent` calls.
///
- [JsonPropertyName("avgLogprobs")]
+ [JsonPropertyName("groundingMetadata")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double
- ? AvgLogprobs {
+ public GroundingMetadata
+ ? GroundingMetadata {
get; set;
}
///
- /// Output only. Metadata specifies sources used to ground generated content.
+ /// Output only. The average log probability of the tokens in this candidate. This is a
+ /// length-normalized score that can be used to compare the quality of candidates of different
+ /// lengths. A higher average log probability suggests a more confident and coherent response.
///
- [JsonPropertyName("groundingMetadata")]
+ [JsonPropertyName("avgLogprobs")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public GroundingMetadata
- ? GroundingMetadata {
+ public double
+ ? AvgLogprobs {
get; set;
}
///
- /// Output only. Index of the candidate.
+ /// Output only. The 0-based index of this candidate in the list of generated responses. This is
+ /// useful for distinguishing between multiple candidates when `candidate_count` > 1.
///
[JsonPropertyName("index")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -106,7 +110,9 @@ public int
}
///
- /// Output only. Log-likelihood scores for the response tokens and top tokens
+ /// Output only. The detailed log probability information for the tokens in this candidate. This
+ /// is useful for debugging, understanding model uncertainty, and identifying potential
+ /// "hallucinations".
///
[JsonPropertyName("logprobsResult")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -116,7 +122,7 @@ public LogprobsResult
}
///
- /// Output only. List of ratings for the safety of a response candidate. There is at most one
+ /// Output only. A list of ratings for the safety of a response candidate. There is at most one
/// rating per category.
///
[JsonPropertyName("safetyRatings")]
@@ -127,7 +133,8 @@ public List
}
///
- /// Output only. Metadata related to url context retrieval tool.
+ /// Output only. Metadata returned when the model uses the `url_context` tool to get information
+ /// from a user-provided URL.
///
[JsonPropertyName("urlContextMetadata")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/Citation.cs b/Google.GenAI/types/Citation.cs
index 1dccd108..311e285d 100644
--- a/Google.GenAI/types/Citation.cs
+++ b/Google.GenAI/types/Citation.cs
@@ -23,19 +23,19 @@
namespace Google.GenAI.Types {
///
- /// Source attributions for content. This data type is not supported in Gemini API.
+ /// A citation for a piece of generatedcontent. This data type is not supported in Gemini API.
///
public record Citation {
///
- /// Output only. End index into the content.
+ /// Output only. The end index of the citation in the content.
///
[JsonPropertyName("endIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int ? EndIndex { get; set; }
///
- /// Output only. License of the attribution.
+ /// Output only. The license of the source of the citation.
///
[JsonPropertyName("license")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -45,7 +45,7 @@ public string
}
///
- /// Output only. Publication date of the attribution.
+ /// Output only. The publication date of the source of the citation.
///
[JsonPropertyName("publicationDate")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -55,7 +55,7 @@ public GoogleTypeDate
}
///
- /// Output only. Start index into the content.
+ /// Output only. The start index of the citation in the content.
///
[JsonPropertyName("startIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -65,7 +65,7 @@ public int
}
///
- /// Output only. Title of the attribution.
+ /// Output only. The title of the source of the citation.
///
[JsonPropertyName("title")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -75,7 +75,7 @@ public string
}
///
- /// Output only. Url reference of the attribution.
+ /// Output only. The URI of the source of the citation.
///
[JsonPropertyName("uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/Content.cs b/Google.GenAI/types/Content.cs
index a87c946a..6d2b841d 100644
--- a/Google.GenAI/types/Content.cs
+++ b/Google.GenAI/types/Content.cs
@@ -36,8 +36,8 @@ public record Content {
public List ? Parts { get; set; }
///
- /// Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for
- /// multi-turn conversations, otherwise can be left blank or unset.
+ /// Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the
+ /// service will default to 'user'.
///
[JsonPropertyName("role")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/CustomCodeExecutionResult.cs b/Google.GenAI/types/CustomCodeExecutionResult.cs
new file mode 100644
index 00000000..3a3af418
--- /dev/null
+++ b/Google.GenAI/types/CustomCodeExecutionResult.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Result for custom code execution metric. This data type is not supported in Gemini API.
+ ///
+
+ public record CustomCodeExecutionResult {
+ ///
+ /// Output only. Custom code execution score.
+ ///
+ [JsonPropertyName("score")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public double ? Score { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a CustomCodeExecutionResult object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized CustomCodeExecutionResult object, or null if deserialization
+ /// fails.
+ public static CustomCodeExecutionResult
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/CustomOutput.cs b/Google.GenAI/types/CustomOutput.cs
new file mode 100644
index 00000000..993a4393
--- /dev/null
+++ b/Google.GenAI/types/CustomOutput.cs
@@ -0,0 +1,53 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Spec for custom output. This data type is not supported in Gemini API.
+ ///
+
+ public record CustomOutput {
+ ///
+ /// Output only. List of raw output strings.
+ ///
+ [JsonPropertyName("rawOutputs")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public RawOutput ? RawOutputs { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a CustomOutput object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized CustomOutput object, or null if deserialization fails.
+ public static CustomOutput
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/DatasetStats.cs b/Google.GenAI/types/DatasetStats.cs
index 9af2b89a..a27868e2 100644
--- a/Google.GenAI/types/DatasetStats.cs
+++ b/Google.GenAI/types/DatasetStats.cs
@@ -27,13 +27,35 @@ namespace Google.GenAI.Types {
///
public record DatasetStats {
+ ///
+ /// Output only. A partial sample of the indices (starting from 1) of the dropped examples.
+ ///
+ [JsonPropertyName("droppedExampleIndices")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonConverter(typeof(StringToNullableLongListConverter))]
+ public List ? DroppedExampleIndices { get; set; }
+
+ ///
+ /// Output only. For each index in `dropped_example_indices`, the user-facing reason why the
+ /// example was dropped.
+ ///
+ [JsonPropertyName("droppedExampleReasons")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List
+ ? DroppedExampleReasons {
+ get; set;
+ }
+
///
/// Output only. Number of billable characters in the tuning dataset.
///
[JsonPropertyName("totalBillableCharacterCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
[JsonConverter(typeof(StringToNullableLongConverter))]
- public long ? TotalBillableCharacterCount { get; set; }
+ public long
+ ? TotalBillableCharacterCount {
+ get; set;
+ }
///
/// Output only. Number of tuning characters in the tuning dataset.
diff --git a/Google.GenAI/types/DistillationDataStats.cs b/Google.GenAI/types/DistillationDataStats.cs
index 680d7fb6..8cc87405 100644
--- a/Google.GenAI/types/DistillationDataStats.cs
+++ b/Google.GenAI/types/DistillationDataStats.cs
@@ -23,8 +23,8 @@
namespace Google.GenAI.Types {
///
- /// Statistics computed for datasets used for distillation. This data type is not supported in
- /// Gemini API.
+ /// Statistics for distillation prompt dataset. These statistics do not include the responses
+ /// sampled from the teacher model. This data type is not supported in Gemini API.
///
public record DistillationDataStats {
diff --git a/Google.GenAI/types/EncryptionSpec.cs b/Google.GenAI/types/EncryptionSpec.cs
index 174a6c4b..302e156a 100644
--- a/Google.GenAI/types/EncryptionSpec.cs
+++ b/Google.GenAI/types/EncryptionSpec.cs
@@ -23,16 +23,15 @@
namespace Google.GenAI.Types {
///
- /// Represents a customer-managed encryption key spec that can be applied to a top-level resource.
- /// This data type is not supported in Gemini API.
+ /// Represents a customer-managed encryption key specification that can be applied to a Vertex AI
+ /// resource. This data type is not supported in Gemini API.
///
public record EncryptionSpec {
///
- /// The Cloud KMS resource identifier of the customer managed encryption key used to protect a
- /// resource. Has the form:
- /// `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to
- /// be in the same region as where the compute resource is created.
+ /// Resource name of the Cloud KMS key used to protect the resource. The Cloud KMS key must be
+ /// in the same region as the resource. It must have the format
+ /// `projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}`.
///
[JsonPropertyName("kmsKeyName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/EnterpriseWebSearch.cs b/Google.GenAI/types/EnterpriseWebSearch.cs
index af1c9f6b..8e2a81bd 100644
--- a/Google.GenAI/types/EnterpriseWebSearch.cs
+++ b/Google.GenAI/types/EnterpriseWebSearch.cs
@@ -29,21 +29,21 @@ namespace Google.GenAI.Types {
public record EnterpriseWebSearch {
///
- /// Optional. List of domains to be excluded from the search results. The default limit is 2000
- /// domains.
+ /// Optional. Sites with confidence level chosen & above this value will be blocked from the
+ /// search results.
///
- [JsonPropertyName("excludeDomains")]
+ [JsonPropertyName("blockingConfidence")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List ? ExcludeDomains { get; set; }
+ public PhishBlockThreshold ? BlockingConfidence { get; set; }
///
- /// Optional. Sites with confidence level chosen & above this value will be blocked from the
- /// search results.
+ /// Optional. List of domains to be excluded from the search results. The default limit is 2000
+ /// domains.
///
- [JsonPropertyName("blockingConfidence")]
+ [JsonPropertyName("excludeDomains")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public PhishBlockThreshold
- ? BlockingConfidence {
+ public List
+ ? ExcludeDomains {
get; set;
}
diff --git a/Google.GenAI/types/EvaluateDatasetResponse.cs b/Google.GenAI/types/EvaluateDatasetResponse.cs
new file mode 100644
index 00000000..75eb154f
--- /dev/null
+++ b/Google.GenAI/types/EvaluateDatasetResponse.cs
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Response in LRO for EvaluationService.EvaluateDataset. This data type is not supported in
+ /// Gemini API.
+ ///
+
+ public record EvaluateDatasetResponse {
+ ///
+ /// Output only. Aggregation statistics derived from results of
+ /// EvaluationService.EvaluateDataset.
+ ///
+ [JsonPropertyName("aggregationOutput")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public AggregationOutput ? AggregationOutput { get; set; }
+
+ ///
+ /// Output only. Output info for EvaluationService.EvaluateDataset.
+ ///
+ [JsonPropertyName("outputInfo")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public OutputInfo
+ ? OutputInfo {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a EvaluateDatasetResponse object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized EvaluateDatasetResponse object, or null if deserialization
+ /// fails.
+ public static EvaluateDatasetResponse
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/EvaluateDatasetRun.cs b/Google.GenAI/types/EvaluateDatasetRun.cs
new file mode 100644
index 00000000..62e4a74a
--- /dev/null
+++ b/Google.GenAI/types/EvaluateDatasetRun.cs
@@ -0,0 +1,86 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Evaluate Dataset Run Result for Tuning Job. This data type is not supported in Gemini API.
+ ///
+
+ public record EvaluateDatasetRun {
+ ///
+ /// Output only. The checkpoint id used in the evaluation run. Only populated when evaluating
+ /// checkpoints.
+ ///
+ [JsonPropertyName("checkpointId")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string ? CheckpointId { get; set; }
+
+ ///
+ /// Output only. The error of the evaluation run if any.
+ ///
+ [JsonPropertyName("error")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public GoogleRpcStatus
+ ? Error {
+ get; set;
+ }
+
+ ///
+ /// Output only. Results for EvaluationService.EvaluateDataset.
+ ///
+ [JsonPropertyName("evaluateDatasetResponse")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public EvaluateDatasetResponse
+ ? EvaluateDatasetResponse {
+ get; set;
+ }
+
+ ///
+ /// Output only. The operation ID of the evaluation run. Format:
+ /// `projects/{project}/locations/{location}/operations/{operation_id}`.
+ ///
+ [JsonPropertyName("operationName")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? OperationName {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a EvaluateDatasetRun object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized EvaluateDatasetRun object, or null if deserialization
+ /// fails.
+ public static EvaluateDatasetRun
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/EvaluationDataset.cs b/Google.GenAI/types/EvaluationDataset.cs
new file mode 100644
index 00000000..4bfde10c
--- /dev/null
+++ b/Google.GenAI/types/EvaluationDataset.cs
@@ -0,0 +1,65 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The dataset used for evaluation. This data type is not supported in Gemini API.
+ ///
+
+ public record EvaluationDataset {
+ ///
+ /// BigQuery source holds the dataset.
+ ///
+ [JsonPropertyName("bigquerySource")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public BigQuerySource ? BigquerySource { get; set; }
+
+ ///
+ /// Cloud storage source holds the dataset. Currently only one Cloud Storage file path is
+ /// supported.
+ ///
+ [JsonPropertyName("gcsSource")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public GcsSource
+ ? GcsSource {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a EvaluationDataset object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized EvaluationDataset object, or null if deserialization
+ /// fails.
+ public static EvaluationDataset
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/ExactMatchMetricValue.cs b/Google.GenAI/types/ExactMatchMetricValue.cs
new file mode 100644
index 00000000..8710b052
--- /dev/null
+++ b/Google.GenAI/types/ExactMatchMetricValue.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Exact match metric value for an instance. This data type is not supported in Gemini API.
+ ///
+
+ public record ExactMatchMetricValue {
+ ///
+ /// Output only. Exact match score.
+ ///
+ [JsonPropertyName("score")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public double ? Score { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a ExactMatchMetricValue object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized ExactMatchMetricValue object, or null if deserialization
+ /// fails.
+ public static ExactMatchMetricValue
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/FileData.cs b/Google.GenAI/types/FileData.cs
index 5a8d938a..93156e2d 100644
--- a/Google.GenAI/types/FileData.cs
+++ b/Google.GenAI/types/FileData.cs
@@ -23,23 +23,23 @@
namespace Google.GenAI.Types {
///
- /// URI based data.
+ /// URI-based data. A FileData message contains a URI pointing to data of a specific media type.
+ /// It is used to represent images, audio, and video stored in Google Cloud Storage.
///
public record FileData {
///
- /// Optional. Display name of the file data. Used to provide a label or filename to distinguish
- /// file datas. This field is only returned in PromptMessage for prompt management. It is
- /// currently used in the Gemini GenerateContent calls only when server side tools
- /// (code_execution, google_search, and url_context) are enabled. This field is not supported in
- /// Gemini API.
+ /// Optional. The display name of the file. Used to provide a label or filename to distinguish
+ /// files. This field is only returned in `PromptMessage` for prompt management. It is used in
+ /// the Gemini calls only when server side tools (`code_execution`, `google_search`, and
+ /// `url_context`) are enabled. This field is not supported in Gemini API.
///
[JsonPropertyName("displayName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string ? DisplayName { get; set; }
///
- /// URI.
+ /// The URI of the file in Google Cloud Storage.
///
[JsonPropertyName("fileUri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/FileSearch.cs b/Google.GenAI/types/FileSearch.cs
new file mode 100644
index 00000000..e6d256a8
--- /dev/null
+++ b/Google.GenAI/types/FileSearch.cs
@@ -0,0 +1,75 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The FileSearch tool that retrieves knowledge from Semantic Retrieval corpora. Files are
+ /// imported to Semantic Retrieval corpora using the ImportFile API. This data type is not
+ /// supported in Vertex AI.
+ ///
+
+ public record FileSearch {
+ ///
+ /// The names of the file_search_stores to retrieve from. Example:
+ /// `fileSearchStores/my-file-search-store-123`
+ ///
+ [JsonPropertyName("fileSearchStoreNames")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List ? FileSearchStoreNames { get; set; }
+
+ ///
+ /// Optional. Metadata filter to apply to the semantic retrieval documents and chunks.
+ ///
+ [JsonPropertyName("metadataFilter")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? MetadataFilter {
+ get; set;
+ }
+
+ ///
+ /// Optional. The number of semantic retrieval chunks to retrieve.
+ ///
+ [JsonPropertyName("topK")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public int
+ ? TopK {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a FileSearch object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized FileSearch object, or null if deserialization fails.
+ public static FileSearch ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/FullFineTuningSpec.cs b/Google.GenAI/types/FullFineTuningSpec.cs
new file mode 100644
index 00000000..1920539f
--- /dev/null
+++ b/Google.GenAI/types/FullFineTuningSpec.cs
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Tuning Spec for Full Fine Tuning. This data type is not supported in Gemini API.
+ ///
+
+ public record FullFineTuningSpec {
+ ///
+ /// Optional. Hyperparameters for Full Fine Tuning.
+ ///
+ [JsonPropertyName("hyperParameters")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public SupervisedHyperParameters ? HyperParameters { get; set; }
+
+ ///
+ /// Training dataset used for tuning. The dataset can be specified as either a Cloud Storage
+ /// path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.
+ ///
+ [JsonPropertyName("trainingDatasetUri")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? TrainingDatasetUri {
+ get; set;
+ }
+
+ ///
+ /// Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud
+ /// Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.
+ ///
+ [JsonPropertyName("validationDatasetUri")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? ValidationDatasetUri {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a FullFineTuningSpec object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized FullFineTuningSpec object, or null if deserialization
+ /// fails.
+ public static FullFineTuningSpec
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/FunctionDeclaration.cs b/Google.GenAI/types/FunctionDeclaration.cs
index 7e3f74a9..99fe759d 100644
--- a/Google.GenAI/types/FunctionDeclaration.cs
+++ b/Google.GenAI/types/FunctionDeclaration.cs
@@ -41,7 +41,7 @@ public record FunctionDeclaration {
///
/// The name of the function to call. Must start with a letter or an underscore. Must be a-z,
- /// A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.
+ /// A-Z, 0-9, or contain underscores, dots, colons and dashes, with a maximum length of 64.
///
[JsonPropertyName("name")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GcsSource.cs b/Google.GenAI/types/GcsSource.cs
new file mode 100644
index 00000000..5ffed5f4
--- /dev/null
+++ b/Google.GenAI/types/GcsSource.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The Google Cloud Storage location for the input content. This data type is not supported in
+ /// Gemini API.
+ ///
+
+ public record GcsSource {
+ ///
+ /// Google Cloud Storage URI(-s) to the input file(s). May contain wildcards. For more
+ /// information on wildcards, see https://cloud.google.com/storage/docs/wildcards.
+ ///
+ [JsonPropertyName("uris")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List ? Uris { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a GcsSource object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized GcsSource object, or null if deserialization fails.
+ public static GcsSource ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/GenerateContentResponse.cs b/Google.GenAI/types/GenerateContentResponse.cs
index 04cc12ca..617c2010 100644
--- a/Google.GenAI/types/GenerateContentResponse.cs
+++ b/Google.GenAI/types/GenerateContentResponse.cs
@@ -97,6 +97,17 @@ public GenerateContentResponseUsageMetadata
get; set;
}
+ ///
+ /// Output only. The current model status of this model. This field is not supported in Vertex
+ /// AI.
+ ///
+ [JsonPropertyName("modelStatus")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public ModelStatus
+ ? ModelStatus {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a GenerateContentResponse object.
///
diff --git a/Google.GenAI/types/GenerationConfig.cs b/Google.GenAI/types/GenerationConfig.cs
index d5544804..26a51c58 100644
--- a/Google.GenAI/types/GenerationConfig.cs
+++ b/Google.GenAI/types/GenerationConfig.cs
@@ -46,8 +46,9 @@ public object
}
///
- /// Optional. If enabled, audio timestamp will be included in the request to the model. This
- /// field is not supported in Gemini API.
+ /// Optional. If enabled, audio timestamps will be included in the request to the model. This
+ /// can be useful for synchronizing audio with other modalities in the response. This field is
+ /// not supported in Gemini API.
///
[JsonPropertyName("audioTimestamp")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -57,7 +58,9 @@ public bool
}
///
- /// Optional. Number of candidates to generate.
+ /// Optional. The number of candidate responses to generate. A higher `candidate_count` can
+ /// provide more options to choose from, but it also consumes more resources. This can be useful
+ /// for generating a variety of responses and selecting the best one.
///
[JsonPropertyName("candidateCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -68,7 +71,8 @@ public int
///
/// Optional. If enabled, the model will detect emotions and adapt its responses accordingly.
- /// This field is not supported in Gemini API.
+ /// For example, if the model detects that the user is frustrated, it may provide a more
+ /// empathetic response. This field is not supported in Gemini API.
///
[JsonPropertyName("enableAffectiveDialog")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -78,7 +82,9 @@ public bool
}
///
- /// Optional. Frequency penalties.
+ /// Optional. Penalizes tokens based on their frequency in the generated text. A positive value
+ /// helps to reduce the repetition of words and phrases. Valid values can range from
+ /// [-2.0, 2.0].
///
[JsonPropertyName("frequencyPenalty")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -88,7 +94,9 @@ public double
}
///
- /// Optional. Logit probabilities.
+ /// Optional. The number of top log probabilities to return for each token. This can be used to
+ /// see which other tokens were considered likely candidates for a given position. A higher
+ /// value will return more options, but it will also increase the size of the response.
///
[JsonPropertyName("logprobs")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -98,7 +106,9 @@ public int
}
///
- /// Optional. The maximum number of output tokens to generate per message.
+ /// Optional. The maximum number of tokens to generate in the response. A token is approximately
+ /// four characters. The default value varies by model. This parameter can be used to control
+ /// the length of the generated text and prevent overly long responses.
///
[JsonPropertyName("maxOutputTokens")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -108,7 +118,11 @@ public int
}
///
- /// Optional. If specified, the media resolution specified will be used.
+ /// Optional. The token resolution at which input media content is sampled. This is used to
+ /// control the trade-off between the quality of the response and the number of tokens used to
+ /// represent the media. A higher resolution allows the model to perceive more detail, which can
+ /// lead to a more nuanced response, but it will also use more tokens. This does not affect the
+ /// image dimensions sent to the model.
///
[JsonPropertyName("mediaResolution")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -118,7 +132,9 @@ public MediaResolution
}
///
- /// Optional. Positive penalties.
+ /// Optional. Penalizes tokens that have already appeared in the generated text. A positive
+ /// value encourages the model to generate more diverse and less repetitive text. Valid values
+ /// can range from [-2.0, 2.0].
///
[JsonPropertyName("presencePenalty")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -128,7 +144,10 @@ public double
}
///
- /// Optional. If true, export the logprobs results in response.
+ /// Optional. If set to true, the log probabilities of the output tokens are returned. Log
+ /// probabilities are the logarithm of the probability of a token appearing in the output. A
+ /// higher log probability means the token is more likely to be generated. This can be useful
+ /// for analyzing the model's confidence in its own output and for debugging.
///
[JsonPropertyName("responseLogprobs")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -138,10 +157,10 @@ public bool
}
///
- /// Optional. Output response mimetype of the generated candidate text. Supported mimetype: -
- /// `text/plain`: (default) Text output. - `application/json`: JSON response in the candidates.
- /// The model needs to be prompted to output the appropriate response type, otherwise the
- /// behavior is undefined. This is a preview feature.
+ /// Optional. The IANA standard MIME type of the response. The model will generate output that
+ /// conforms to this MIME type. Supported values include 'text/plain' (default) and
+ /// 'application/json'. The model needs to be prompted to output the appropriate response type,
+ /// otherwise the behavior is undefined. This is a preview feature.
///
[JsonPropertyName("responseMimeType")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -151,7 +170,9 @@ public string
}
///
- /// Optional. The modalities of the response.
+ /// Optional. The modalities of the response. The model will generate a response that includes
+ /// all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response
+ /// will include both text and an image.
///
[JsonPropertyName("responseModalities")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -161,11 +182,11 @@ public List
}
///
- /// Optional. The `Schema` object allows the definition of input and output data types. These
- /// types can be objects, but also primitives and arrays. Represents a select subset of an
- /// OpenAPI 3.0 schema object (https://spec.openapis.org/oas/v3.0.3#schema). If set, a
- /// compatible response_mime_type must also be set. Compatible mimetypes: `application/json`:
- /// Schema for JSON response.
+ /// Optional. Lets you to specify a schema for the model's response, ensuring that the output
+ /// conforms to a particular structure. This is useful for generating structured data such as
+ /// JSON. The schema is a subset of the OpenAPI 3.0 schema object
+ /// (https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also
+ /// set the `response_mime_type` to `application/json`.
///
[JsonPropertyName("responseSchema")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -185,7 +206,13 @@ public GenerationConfigRoutingConfig
}
///
- /// Optional. Seed.
+ /// Optional. A seed for the random number generator. By setting a seed, you can make the
+ /// model's output mostly deterministic. For a given prompt and parameters (like temperature,
+ /// top_p, etc.), the model will produce the same response every time. However, it's not a
+ /// guaranteed absolute deterministic behavior. This is different from parameters like
+ /// `temperature`, which control the *level* of randomness. `seed` ensures that the "random"
+ /// choices the model makes are the same on every run, making it essential for testing and
+ /// ensuring reproducible results.
///
[JsonPropertyName("seed")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -205,7 +232,10 @@ public SpeechConfig
}
///
- /// Optional. Stop sequences.
+ /// Optional. A list of character sequences that will stop the model from generating further
+ /// tokens. If a stop sequence is generated, the output will end at that point. This is useful
+ /// for controlling the length and structure of the output. For example, you can use ["\n",
+ /// "###"] to stop generation at a new line or a specific marker.
///
[JsonPropertyName("stopSequences")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -215,7 +245,9 @@ public List
}
///
- /// Optional. Controls the randomness of predictions.
+ /// Optional. Controls the randomness of the output. A higher temperature results in more
+ /// creative and diverse responses, while a lower temperature makes the output more predictable
+ /// and focused. The valid range is (0.0, 2.0].
///
[JsonPropertyName("temperature")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -225,8 +257,8 @@ public double
}
///
- /// Optional. Config for thinking features. An error will be returned if this field is set for
- /// models that don't support thinking.
+ /// Optional. Configuration for thinking features. An error will be returned if this field is
+ /// set for models that don't support thinking.
///
[JsonPropertyName("thinkingConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -236,7 +268,10 @@ public ThinkingConfig
}
///
- /// Optional. If specified, top-k sampling will be used.
+ /// Optional. Specifies the top-k sampling threshold. The model considers only the top k most
+ /// probable tokens for the next token. This can be useful for generating more coherent and less
+ /// random text. For example, a `top_k` of 40 means the model will choose the next word from the
+ /// 40 most likely words.
///
[JsonPropertyName("topK")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -246,7 +281,11 @@ public double
}
///
- /// Optional. If specified, nucleus sampling will be used.
+ /// Optional. Specifies the nucleus sampling threshold. The model considers only the smallest
+ /// set of tokens whose cumulative probability is at least `top_p`. This helps generate more
+ /// diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model
+ /// considers tokens until the cumulative probability of the tokens to select from reaches 0.9.
+ /// It's recommended to adjust either temperature or `top_p`, but not both.
///
[JsonPropertyName("topP")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GenerationConfigRoutingConfig.cs b/Google.GenAI/types/GenerationConfigRoutingConfig.cs
index 2f453dcf..6484c7cb 100644
--- a/Google.GenAI/types/GenerationConfigRoutingConfig.cs
+++ b/Google.GenAI/types/GenerationConfigRoutingConfig.cs
@@ -23,20 +23,21 @@
namespace Google.GenAI.Types {
///
- /// The configuration for routing the request to a specific model. This data type is not supported
- /// in Gemini API.
+ /// The configuration for routing the request to a specific model. This can be used to control
+ /// which model is used for the generation, either automatically or by specifying a model name.
+ /// This data type is not supported in Gemini API.
///
public record GenerationConfigRoutingConfig {
///
- /// Automated routing.
+ /// In this mode, the model is selected automatically based on the content of the request.
///
[JsonPropertyName("autoMode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GenerationConfigRoutingConfigAutoRoutingMode ? AutoMode { get; set; }
///
- /// Manual routing.
+ /// In this mode, the model is specified manually.
///
[JsonPropertyName("manualMode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GenerationConfigRoutingConfigAutoRoutingMode.cs b/Google.GenAI/types/GenerationConfigRoutingConfigAutoRoutingMode.cs
index b6199cde..f6f58b2b 100644
--- a/Google.GenAI/types/GenerationConfigRoutingConfigAutoRoutingMode.cs
+++ b/Google.GenAI/types/GenerationConfigRoutingConfigAutoRoutingMode.cs
@@ -23,9 +23,9 @@
namespace Google.GenAI.Types {
///
- /// When automated routing is specified, the routing will be determined by the pretrained routing
- /// model and customer provided model routing preference. This data type is not supported in
- /// Gemini API.
+ /// The configuration for automated routing. When automated routing is specified, the routing will
+ /// be determined by the pretrained routing model and customer provided model routing preference.
+ /// This data type is not supported in Gemini API.
///
public record GenerationConfigRoutingConfigAutoRoutingMode {
diff --git a/Google.GenAI/types/GenerationConfigRoutingConfigManualRoutingMode.cs b/Google.GenAI/types/GenerationConfigRoutingConfigManualRoutingMode.cs
index 3bbc2e70..b36a73b5 100644
--- a/Google.GenAI/types/GenerationConfigRoutingConfigManualRoutingMode.cs
+++ b/Google.GenAI/types/GenerationConfigRoutingConfigManualRoutingMode.cs
@@ -23,14 +23,13 @@
namespace Google.GenAI.Types {
///
- /// When manual routing is set, the specified model will be used directly. This data type is not
- /// supported in Gemini API.
+ /// The configuration for manual routing. When manual routing is specified, the model will be
+ /// selected based on the model name provided. This data type is not supported in Gemini API.
///
public record GenerationConfigRoutingConfigManualRoutingMode {
///
- /// The model name to use. Only the public LLM models are accepted. See Supported models
- /// (https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).
+ /// The name of the model to use. Only public LLM models are accepted.
///
[JsonPropertyName("modelName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GoogleMaps.cs b/Google.GenAI/types/GoogleMaps.cs
index f34be064..c3202ec9 100644
--- a/Google.GenAI/types/GoogleMaps.cs
+++ b/Google.GenAI/types/GoogleMaps.cs
@@ -23,7 +23,7 @@
namespace Google.GenAI.Types {
///
- /// Tool to retrieve public maps data for grounding, powered by Google.
+ /// Tool to retrieve knowledge from Google Maps.
///
public record GoogleMaps {
@@ -36,7 +36,9 @@ public record GoogleMaps {
public AuthConfig ? AuthConfig { get; set; }
///
- /// Optional. If true, include the widget context token in the response.
+ /// Optional. Whether to return a widget context token in the GroundingMetadata of the response.
+ /// Developers can use the widget context token to render a Google Maps widget with geospatial
+ /// context related to the places that the model references in the response.
///
[JsonPropertyName("enableWidget")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GoogleSearch.cs b/Google.GenAI/types/GoogleSearch.cs
index a163f4bf..2586fbcf 100644
--- a/Google.GenAI/types/GoogleSearch.cs
+++ b/Google.GenAI/types/GoogleSearch.cs
@@ -28,21 +28,21 @@ namespace Google.GenAI.Types {
public record GoogleSearch {
///
- /// Optional. List of domains to be excluded from the search results. The default limit is 2000
- /// domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API.
+ /// Optional. Sites with confidence level chosen & above this value will be blocked from the
+ /// search results. This field is not supported in Gemini API.
///
- [JsonPropertyName("excludeDomains")]
+ [JsonPropertyName("blockingConfidence")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List ? ExcludeDomains { get; set; }
+ public PhishBlockThreshold ? BlockingConfidence { get; set; }
///
- /// Optional. Sites with confidence level chosen & above this value will be blocked from the
- /// search results. This field is not supported in Gemini API.
+ /// Optional. List of domains to be excluded from the search results. The default limit is 2000
+ /// domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API.
///
- [JsonPropertyName("blockingConfidence")]
+ [JsonPropertyName("excludeDomains")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public PhishBlockThreshold
- ? BlockingConfidence {
+ public List
+ ? ExcludeDomains {
get; set;
}
diff --git a/Google.GenAI/types/GroundingChunk.cs b/Google.GenAI/types/GroundingChunk.cs
index e8b9a456..221d8b55 100644
--- a/Google.GenAI/types/GroundingChunk.cs
+++ b/Google.GenAI/types/GroundingChunk.cs
@@ -23,20 +23,22 @@
namespace Google.GenAI.Types {
///
- /// Grounding chunk.
+ /// A chunk of evidence that was used to generate the response.
///
public record GroundingChunk {
///
- /// Grounding chunk from Google Maps. This field is not supported in Gemini API.
+ /// A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information
+ /// about a place, such as its name, address, and reviews. This is used to provide the user with
+ /// rich, location-based information.
///
[JsonPropertyName("maps")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GroundingChunkMaps ? Maps { get; set; }
///
- /// Grounding chunk from context retrieved by the retrieval tools. This field is not supported
- /// in Gemini API.
+ /// A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI
+ /// Search. See the `RetrievedContext` message for details
///
[JsonPropertyName("retrievedContext")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -46,7 +48,8 @@ public GroundingChunkRetrievedContext
}
///
- /// Grounding chunk from the web.
+ /// A grounding chunk from a web page, typically from Google Search. See the `Web` message for
+ /// details.
///
[JsonPropertyName("web")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GroundingChunkMaps.cs b/Google.GenAI/types/GroundingChunkMaps.cs
index bf4df52f..91b364a4 100644
--- a/Google.GenAI/types/GroundingChunkMaps.cs
+++ b/Google.GenAI/types/GroundingChunkMaps.cs
@@ -23,20 +23,23 @@
namespace Google.GenAI.Types {
///
- /// Chunk from Google Maps. This data type is not supported in Gemini API.
+ /// A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information
+ /// about a place, such as its name, address, and reviews. This is used to provide the user with
+ /// rich, location-based information.
///
public record GroundingChunkMaps {
///
- /// Sources used to generate the place answer. This includes review snippets and photos that
- /// were used to generate the answer, as well as uris to flag content.
+ /// The sources that were used to generate the place answer. This includes review snippets and
+ /// photos that were used to generate the answer, as well as URIs to flag content.
///
[JsonPropertyName("placeAnswerSources")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public GroundingChunkMapsPlaceAnswerSources ? PlaceAnswerSources { get; set; }
///
- /// This Place's resource name, in `places/{place_id}` format. Can be used to look up the Place.
+ /// This Place's resource name, in `places/{place_id}` format. This can be used to look up the
+ /// place in the Google Maps API.
///
[JsonPropertyName("placeId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -46,7 +49,7 @@ public string
}
///
- /// Text of the place answer.
+ /// The text of the place answer.
///
[JsonPropertyName("text")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -56,7 +59,7 @@ public string
}
///
- /// Title of the place.
+ /// The title of the place.
///
[JsonPropertyName("title")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -66,7 +69,7 @@ public string
}
///
- /// URI reference of the place.
+ /// The URI of the place.
///
[JsonPropertyName("uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSources.cs b/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSources.cs
index e4da31df..edc97f4b 100644
--- a/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSources.cs
+++ b/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSources.cs
@@ -23,19 +23,30 @@
namespace Google.GenAI.Types {
///
- /// Sources used to generate the place answer. This data type is not supported in Gemini API.
+ /// The sources that were used to generate the place answer. This includes review snippets and
+ /// photos that were used to generate the answer, as well as URIs to flag content.
///
public record GroundingChunkMapsPlaceAnswerSources {
+ ///
+ /// Snippets of reviews that were used to generate the answer.
+ ///
+ [JsonPropertyName("reviewSnippet")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List ? ReviewSnippet { get; set; }
+
///
/// A link where users can flag a problem with the generated answer.
///
[JsonPropertyName("flagContentUri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string ? FlagContentUri { get; set; }
+ public string
+ ? FlagContentUri {
+ get; set;
+ }
///
- /// Snippets of reviews that are used to generate the answer.
+ /// Snippets of reviews that were used to generate the answer.
///
[JsonPropertyName("reviewSnippets")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.cs b/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.cs
index d2a3d29c..08d18b46 100644
--- a/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.cs
+++ b/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution.cs
@@ -23,7 +23,7 @@
namespace Google.GenAI.Types {
///
- /// Author attribution for a photo or review. This data type is not supported in Gemini API.
+ /// Author attribution for a photo or review.
///
public record GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution {
diff --git a/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.cs b/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.cs
index 53305e1b..b4fbbd0d 100644
--- a/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.cs
+++ b/Google.GenAI/types/GroundingChunkMapsPlaceAnswerSourcesReviewSnippet.cs
@@ -23,7 +23,7 @@
namespace Google.GenAI.Types {
///
- /// Encapsulates a review snippet. This data type is not supported in Gemini API.
+ /// Encapsulates a review snippet.
///
public record GroundingChunkMapsPlaceAnswerSourcesReviewSnippet {
diff --git a/Google.GenAI/types/GroundingChunkRetrievedContext.cs b/Google.GenAI/types/GroundingChunkRetrievedContext.cs
index 4285907f..15e43d6b 100644
--- a/Google.GenAI/types/GroundingChunkRetrievedContext.cs
+++ b/Google.GenAI/types/GroundingChunkRetrievedContext.cs
@@ -23,21 +23,25 @@
namespace Google.GenAI.Types {
///
- /// Chunk from context retrieved by the retrieval tools. This data type is not supported in Gemini
- /// API.
+ /// Context retrieved from a data source to ground the model's response. This is used when a
+ /// retrieval tool fetches information from a user-provided corpus or a public dataset.
///
public record GroundingChunkRetrievedContext {
///
- /// Output only. The full document name for the referenced Vertex AI Search document.
+ /// Output only. The full resource name of the referenced Vertex AI Search document. This is
+ /// used to identify the specific document that was retrieved. The format is
+ /// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
+ /// This field is not supported in Gemini API.
///
[JsonPropertyName("documentName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string ? DocumentName { get; set; }
///
- /// Additional context for the RAG retrieval result. This is only populated when using the RAG
- /// retrieval tool.
+ /// Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is
+ /// populated only when the RAG retrieval tool is used. This field is not supported in Gemini
+ /// API.
///
[JsonPropertyName("ragChunk")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -47,7 +51,7 @@ public RagChunk
}
///
- /// Text of the attribution.
+ /// The content of the retrieved data source.
///
[JsonPropertyName("text")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -57,7 +61,7 @@ public string
}
///
- /// Title of the attribution.
+ /// The title of the retrieved data source.
///
[JsonPropertyName("title")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -67,7 +71,7 @@ public string
}
///
- /// URI reference of the attribution.
+ /// The URI of the retrieved data source.
///
[JsonPropertyName("uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -76,6 +80,17 @@ public string
get; set;
}
+ ///
+ /// Optional. Name of the `FileSearchStore` containing the document. Example:
+ /// `fileSearchStores/123`. This field is not supported in Vertex AI.
+ ///
+ [JsonPropertyName("fileSearchStore")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? FileSearchStore {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a GroundingChunkRetrievedContext object.
///
diff --git a/Google.GenAI/types/GroundingChunkWeb.cs b/Google.GenAI/types/GroundingChunkWeb.cs
index b26c8618..19b24b3e 100644
--- a/Google.GenAI/types/GroundingChunkWeb.cs
+++ b/Google.GenAI/types/GroundingChunkWeb.cs
@@ -23,19 +23,22 @@
namespace Google.GenAI.Types {
///
- /// Chunk from the web.
+ /// A `Web` chunk is a piece of evidence that comes from a web page. It contains the URI of the
+ /// web page, the title of the page, and the domain of the page. This is used to provide the user
+ /// with a link to the source of the information.
///
public record GroundingChunkWeb {
///
- /// Domain of the (original) URI. This field is not supported in Gemini API.
+ /// The domain of the web page that contains the evidence. This can be used to filter out
+ /// low-quality sources. This field is not supported in Gemini API.
///
[JsonPropertyName("domain")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string ? Domain { get; set; }
///
- /// Title of the chunk.
+ /// The title of the web page that contains the evidence.
///
[JsonPropertyName("title")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -45,7 +48,7 @@ public string
}
///
- /// URI reference of the chunk.
+ /// The URI of the web page that contains the evidence.
///
[JsonPropertyName("uri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GroundingMetadata.cs b/Google.GenAI/types/GroundingMetadata.cs
index 6e198e0e..e10d3503 100644
--- a/Google.GenAI/types/GroundingMetadata.cs
+++ b/Google.GenAI/types/GroundingMetadata.cs
@@ -27,27 +27,15 @@ namespace Google.GenAI.Types {
///
public record GroundingMetadata {
- ///
- /// Optional. Output only. Resource name of the Google Maps widget context token to be used with
- /// the PlacesContextElement widget to render contextual data. This is populated only for Google
- /// Maps grounding. This field is not supported in Gemini API.
- ///
- [JsonPropertyName("googleMapsWidgetContextToken")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string ? GoogleMapsWidgetContextToken { get; set; }
-
///
/// List of supporting references retrieved from specified grounding source.
///
[JsonPropertyName("groundingChunks")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List
- ? GroundingChunks {
- get; set;
- }
+ public List ? GroundingChunks { get; set; }
///
- /// Optional. List of grounding support.
+ /// List of grounding support.
///
[JsonPropertyName("groundingSupports")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -57,7 +45,7 @@ public List
}
///
- /// Optional. Output only. Retrieval metadata.
+ /// Metadata related to retrieval in the grounding flow.
///
[JsonPropertyName("retrievalMetadata")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -67,44 +55,57 @@ public RetrievalMetadata
}
///
- /// Optional. Queries executed by the retrieval tools. This field is not supported in Gemini
- /// API.
+ /// Optional. Google search entry for the following-up web searches.
///
- [JsonPropertyName("retrievalQueries")]
+ [JsonPropertyName("searchEntryPoint")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List
- ? RetrievalQueries {
+ public SearchEntryPoint
+ ? SearchEntryPoint {
get; set;
}
///
- /// Optional. Google search entry for the following-up web searches.
+ /// Web search queries for the following-up web search.
///
- [JsonPropertyName("searchEntryPoint")]
+ [JsonPropertyName("webSearchQueries")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public SearchEntryPoint
- ? SearchEntryPoint {
+ public List
+ ? WebSearchQueries {
get; set;
}
///
- /// Optional. Output only. List of source flagging uris. This is currently populated only for
- /// Google Maps grounding. This field is not supported in Gemini API.
+ /// Optional. Output only. A token that can be used to render a Google Maps widget with the
+ /// contextual data. This field is populated only when the grounding source is Google Maps.
///
- [JsonPropertyName("sourceFlaggingUris")]
+ [JsonPropertyName("googleMapsWidgetContextToken")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public List
- ? SourceFlaggingUris {
+ public string
+ ? GoogleMapsWidgetContextToken {
get; set;
}
///
- /// Optional. Web search queries for the following-up web search.
+ /// Optional. The queries that were executed by the retrieval tools. This field is populated
+ /// only when the grounding source is a retrieval tool, such as Vertex AI Search. This field is
+ /// not supported in Gemini API.
///
- [JsonPropertyName("webSearchQueries")]
+ [JsonPropertyName("retrievalQueries")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List
- ? WebSearchQueries {
+ ? RetrievalQueries {
+ get; set;
+ }
+
+ ///
+ /// Optional. Output only. A list of URIs that can be used to flag a place or review for
+ /// inappropriate content. This field is populated only when the grounding source is Google
+ /// Maps. This field is not supported in Gemini API.
+ ///
+ [JsonPropertyName("sourceFlaggingUris")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List
+ ? SourceFlaggingUris {
get; set;
}
diff --git a/Google.GenAI/types/GroundingMetadataSourceFlaggingUri.cs b/Google.GenAI/types/GroundingMetadataSourceFlaggingUri.cs
index db26e760..a861fa47 100644
--- a/Google.GenAI/types/GroundingMetadataSourceFlaggingUri.cs
+++ b/Google.GenAI/types/GroundingMetadataSourceFlaggingUri.cs
@@ -23,20 +23,20 @@
namespace Google.GenAI.Types {
///
- /// Source content flagging uri for a place or review. This is currently populated only for Google
- /// Maps grounding. This data type is not supported in Gemini API.
+ /// A URI that can be used to flag a place or review for inappropriate content. This is populated
+ /// only when the grounding source is Google Maps. This data type is not supported in Gemini API.
///
public record GroundingMetadataSourceFlaggingUri {
///
- /// A link where users can flag a problem with the source (place or review).
+ /// The URI that can be used to flag the content.
///
[JsonPropertyName("flagContentUri")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string ? FlagContentUri { get; set; }
///
- /// Id of the place or review.
+ /// The ID of the place or review.
///
[JsonPropertyName("sourceId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/GroundingSupport.cs b/Google.GenAI/types/GroundingSupport.cs
index f556ec23..1dd61331 100644
--- a/Google.GenAI/types/GroundingSupport.cs
+++ b/Google.GenAI/types/GroundingSupport.cs
@@ -28,9 +28,8 @@ namespace Google.GenAI.Types {
public record GroundingSupport {
///
- /// Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident. For
- /// Gemini 2.0 and before, this list must have the same size as the grounding_chunk_indices. For
- /// Gemini 2.5 and after, this list will be empty and should be ignored.
+ /// Confidence score of the support references. Ranges from 0 to 1. 1 is the most confident.
+ /// This list must have the same size as the grounding_chunk_indices.
///
[JsonPropertyName("confidenceScores")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/HarmBlockMethod.cs b/Google.GenAI/types/HarmBlockMethod.cs
index c55aa25f..27b48697 100644
--- a/Google.GenAI/types/HarmBlockMethod.cs
+++ b/Google.GenAI/types/HarmBlockMethod.cs
@@ -20,8 +20,8 @@
namespace Google.GenAI.Types {
///
- /// Specify if the threshold is used for probability or severity score. If not specified, the
- /// threshold is used for probability score. This enum is not supported in Gemini API.
+ /// The method for blocking content. If not specified, the default behavior is to use the
+ /// probability score. This enum is not supported in Gemini API.
///
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum HarmBlockMethod {
diff --git a/Google.GenAI/types/HarmBlockThreshold.cs b/Google.GenAI/types/HarmBlockThreshold.cs
index e9016d6b..cfaae238 100644
--- a/Google.GenAI/types/HarmBlockThreshold.cs
+++ b/Google.GenAI/types/HarmBlockThreshold.cs
@@ -20,37 +20,38 @@
namespace Google.GenAI.Types {
///
- /// The harm block threshold.
+ /// The threshold for blocking content. If the harm probability exceeds this threshold, the
+ /// content will be blocked.
///
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum HarmBlockThreshold {
///
- /// Unspecified harm block threshold.
+ /// The harm block threshold is unspecified.
///
[JsonPropertyName("HARM_BLOCK_THRESHOLD_UNSPECIFIED")] HARM_BLOCK_THRESHOLD_UNSPECIFIED,
///
- /// Block low threshold and above (i.e. block more).
+ /// Block content with a low harm probability or higher.
///
[JsonPropertyName("BLOCK_LOW_AND_ABOVE")] BLOCK_LOW_AND_ABOVE,
///
- /// Block medium threshold and above.
+ /// Block content with a medium harm probability or higher.
///
[JsonPropertyName("BLOCK_MEDIUM_AND_ABOVE")] BLOCK_MEDIUM_AND_ABOVE,
///
- /// Block only high threshold (i.e. block less).
+ /// Block content with a high harm probability.
///
[JsonPropertyName("BLOCK_ONLY_HIGH")] BLOCK_ONLY_HIGH,
///
- /// Block none.
+ /// Do not block any content, regardless of its harm probability.
///
[JsonPropertyName("BLOCK_NONE")] BLOCK_NONE,
///
- /// Turn off the safety filter.
+ /// Turn off the safety filter entirely.
///
[JsonPropertyName("OFF")] OFF
}
diff --git a/Google.GenAI/types/HarmCategory.cs b/Google.GenAI/types/HarmCategory.cs
index 9d5f97b5..79d3bcdc 100644
--- a/Google.GenAI/types/HarmCategory.cs
+++ b/Google.GenAI/types/HarmCategory.cs
@@ -20,32 +20,33 @@
namespace Google.GenAI.Types {
///
- /// Harm category.
+ /// The harm category to be blocked.
///
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum HarmCategory {
///
- /// The harm category is unspecified.
+ /// Default value. This value is unused.
///
[JsonPropertyName("HARM_CATEGORY_UNSPECIFIED")] HARM_CATEGORY_UNSPECIFIED,
///
- /// The harm category is harassment.
+ /// Abusive, threatening, or content intended to bully, torment, or ridicule.
///
[JsonPropertyName("HARM_CATEGORY_HARASSMENT")] HARM_CATEGORY_HARASSMENT,
///
- /// The harm category is hate speech.
+ /// Content that promotes violence or incites hatred against individuals or groups based on
+ /// certain attributes.
///
[JsonPropertyName("HARM_CATEGORY_HATE_SPEECH")] HARM_CATEGORY_HATE_SPEECH,
///
- /// The harm category is sexually explicit content.
+ /// Content that contains sexually explicit material.
///
[JsonPropertyName("HARM_CATEGORY_SEXUALLY_EXPLICIT")] HARM_CATEGORY_SEXUALLY_EXPLICIT,
///
- /// The harm category is dangerous content.
+ /// Content that promotes, facilitates, or enables dangerous activities.
///
[JsonPropertyName("HARM_CATEGORY_DANGEROUS_CONTENT")] HARM_CATEGORY_DANGEROUS_CONTENT,
@@ -55,31 +56,30 @@ public enum HarmCategory {
[JsonPropertyName("HARM_CATEGORY_CIVIC_INTEGRITY")] HARM_CATEGORY_CIVIC_INTEGRITY,
///
- /// The harm category is image hate. This enum value is not supported in Gemini API.
+ /// Images that contain hate speech. This enum value is not supported in Gemini API.
///
[JsonPropertyName("HARM_CATEGORY_IMAGE_HATE")] HARM_CATEGORY_IMAGE_HATE,
///
- /// The harm category is image dangerous content. This enum value is not supported in Gemini
- /// API.
+ /// Images that contain dangerous content. This enum value is not supported in Gemini API.
///
[JsonPropertyName(
"HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT")] HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT,
///
- /// The harm category is image harassment. This enum value is not supported in Gemini API.
+ /// Images that contain harassment. This enum value is not supported in Gemini API.
///
[JsonPropertyName("HARM_CATEGORY_IMAGE_HARASSMENT")] HARM_CATEGORY_IMAGE_HARASSMENT,
///
- /// The harm category is image sexually explicit content. This enum value is not supported in
- /// Gemini API.
+ /// Images that contain sexually explicit content. This enum value is not supported in Gemini
+ /// API.
///
[JsonPropertyName(
"HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT")] HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT,
///
- /// The harm category is for jailbreak prompts. This enum value is not supported in Gemini API.
+ /// Prompts designed to bypass safety filters. This enum value is not supported in Gemini API.
///
[JsonPropertyName("HARM_CATEGORY_JAILBREAK")] HARM_CATEGORY_JAILBREAK
}
diff --git a/Google.GenAI/types/HarmProbability.cs b/Google.GenAI/types/HarmProbability.cs
index a8a28e38..f1c5a341 100644
--- a/Google.GenAI/types/HarmProbability.cs
+++ b/Google.GenAI/types/HarmProbability.cs
@@ -20,32 +20,32 @@
namespace Google.GenAI.Types {
///
- /// Output only. Harm probability levels in the content.
+ /// Output only. The probability of harm for this category.
///
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum HarmProbability {
///
- /// Harm probability unspecified.
+ /// The harm probability is unspecified.
///
[JsonPropertyName("HARM_PROBABILITY_UNSPECIFIED")] HARM_PROBABILITY_UNSPECIFIED,
///
- /// Negligible level of harm.
+ /// The harm probability is negligible.
///
[JsonPropertyName("NEGLIGIBLE")] NEGLIGIBLE,
///
- /// Low level of harm.
+ /// The harm probability is low.
///
[JsonPropertyName("LOW")] LOW,
///
- /// Medium level of harm.
+ /// The harm probability is medium.
///
[JsonPropertyName("MEDIUM")] MEDIUM,
///
- /// High level of harm.
+ /// The harm probability is high.
///
[JsonPropertyName("HIGH")] HIGH
}
diff --git a/Google.GenAI/types/HarmSeverity.cs b/Google.GenAI/types/HarmSeverity.cs
index 275091ae..7491e6e6 100644
--- a/Google.GenAI/types/HarmSeverity.cs
+++ b/Google.GenAI/types/HarmSeverity.cs
@@ -20,32 +20,32 @@
namespace Google.GenAI.Types {
///
- /// Output only. Harm severity levels in the content. This enum is not supported in Gemini API.
+ /// Output only. The severity of harm for this category. This enum is not supported in Gemini API.
///
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum HarmSeverity {
///
- /// Harm severity unspecified.
+ /// The harm severity is unspecified.
///
[JsonPropertyName("HARM_SEVERITY_UNSPECIFIED")] HARM_SEVERITY_UNSPECIFIED,
///
- /// Negligible level of harm severity.
+ /// The harm severity is negligible.
///
[JsonPropertyName("HARM_SEVERITY_NEGLIGIBLE")] HARM_SEVERITY_NEGLIGIBLE,
///
- /// Low level of harm severity.
+ /// The harm severity is low.
///
[JsonPropertyName("HARM_SEVERITY_LOW")] HARM_SEVERITY_LOW,
///
- /// Medium level of harm severity.
+ /// The harm severity is medium.
///
[JsonPropertyName("HARM_SEVERITY_MEDIUM")] HARM_SEVERITY_MEDIUM,
///
- /// High level of harm severity.
+ /// The harm severity is high.
///
[JsonPropertyName("HARM_SEVERITY_HIGH")] HARM_SEVERITY_HIGH
}
diff --git a/Google.GenAI/types/ImageConfig.cs b/Google.GenAI/types/ImageConfig.cs
index 1184442a..1b396b23 100644
--- a/Google.GenAI/types/ImageConfig.cs
+++ b/Google.GenAI/types/ImageConfig.cs
@@ -77,6 +77,17 @@ public int
get; set;
}
+ ///
+ /// Optional. The image output format for generated images. This field is not supported in
+ /// Gemini API.
+ ///
+ [JsonPropertyName("imageOutputOptions")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public ImageConfigImageOutputOptions
+ ? ImageOutputOptions {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a ImageConfig object.
///
diff --git a/Google.GenAI/types/ImageConfigImageOutputOptions.cs b/Google.GenAI/types/ImageConfigImageOutputOptions.cs
new file mode 100644
index 00000000..b9cafec0
--- /dev/null
+++ b/Google.GenAI/types/ImageConfigImageOutputOptions.cs
@@ -0,0 +1,64 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The image output format for generated images. This data type is not supported in Gemini API.
+ ///
+
+ public record ImageConfigImageOutputOptions {
+ ///
+ /// Optional. The compression quality of the output image.
+ ///
+ [JsonPropertyName("compressionQuality")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public int ? CompressionQuality { get; set; }
+
+ ///
+ /// Optional. The image format that the output should be saved as.
+ ///
+ [JsonPropertyName("mimeType")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? MimeType {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a ImageConfigImageOutputOptions object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized ImageConfigImageOutputOptions object, or null if deserialization
+ /// fails.
+ public static ImageConfigImageOutputOptions
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/InlinedEmbedContentResponse.cs b/Google.GenAI/types/InlinedEmbedContentResponse.cs
index 1b5c1f47..c8972239 100644
--- a/Google.GenAI/types/InlinedEmbedContentResponse.cs
+++ b/Google.GenAI/types/InlinedEmbedContentResponse.cs
@@ -44,6 +44,16 @@ public JobError
get; set;
}
+ ///
+ /// Output only. The metadata associated with the request.
+ ///
+ [JsonPropertyName("metadata")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public Dictionary
+ ? Metadata {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a InlinedEmbedContentResponse object.
///
diff --git a/Google.GenAI/types/LogprobsResult.cs b/Google.GenAI/types/LogprobsResult.cs
index a6161f0b..1f449144 100644
--- a/Google.GenAI/types/LogprobsResult.cs
+++ b/Google.GenAI/types/LogprobsResult.cs
@@ -23,20 +23,26 @@
namespace Google.GenAI.Types {
///
- /// Logprobs Result
+ /// The log probabilities of the tokens generated by the model. This is useful for understanding
+ /// the model's confidence in its predictions and for debugging. For example, you can use log
+ /// probabilities to identify when the model is making a less confident prediction or to explore
+ /// alternative responses that the model considered. A low log probability can also indicate that
+ /// the model is "hallucinating" or generating factually incorrect information.
///
public record LogprobsResult {
///
- /// Length = total number of decoding steps. The chosen candidates may or may not be in
- /// top_candidates.
+ /// A list of the chosen candidate tokens at each decoding step. The length of this list is
+ /// equal to the total number of decoding steps. Note that the chosen candidate might not be in
+ /// `top_candidates`.
///
[JsonPropertyName("chosenCandidates")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List ? ChosenCandidates { get; set; }
///
- /// Length = total number of decoding steps.
+ /// A list of the top candidate tokens at each decoding step. The length of this list is equal
+ /// to the total number of decoding steps.
///
[JsonPropertyName("topCandidates")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -45,6 +51,16 @@ public List
get; set;
}
+ ///
+ /// Sum of log probabilities for all tokens. This field is not supported in Vertex AI.
+ ///
+ [JsonPropertyName("logProbabilitySum")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public double
+ ? LogProbabilitySum {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a LogprobsResult object.
///
diff --git a/Google.GenAI/types/LogprobsResultCandidate.cs b/Google.GenAI/types/LogprobsResultCandidate.cs
index 09f4c665..858f055a 100644
--- a/Google.GenAI/types/LogprobsResultCandidate.cs
+++ b/Google.GenAI/types/LogprobsResultCandidate.cs
@@ -23,19 +23,21 @@
namespace Google.GenAI.Types {
///
- /// Candidate for the logprobs token and score.
+ /// A single token and its associated log probability.
///
public record LogprobsResultCandidate {
///
- /// The candidate's log probability.
+ /// The log probability of this token. A higher value indicates that the model was more
+ /// confident in this token. The log probability can be used to assess the relative likelihood
+ /// of different tokens and to identify when the model is uncertain.
///
[JsonPropertyName("logProbability")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public double ? LogProbability { get; set; }
///
- /// The candidate's token string value.
+ /// The token's string representation.
///
[JsonPropertyName("token")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -45,7 +47,9 @@ public string
}
///
- /// The candidate's token id value.
+ /// The token's numerical ID. While the `token` field provides the string representation of the
+ /// token, the `token_id` is the numerical representation that the model uses internally. This
+ /// can be useful for developers who want to build custom logic based on the model's vocabulary.
///
[JsonPropertyName("tokenId")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/LogprobsResultTopCandidates.cs b/Google.GenAI/types/LogprobsResultTopCandidates.cs
index a74eb166..ae4e5f02 100644
--- a/Google.GenAI/types/LogprobsResultTopCandidates.cs
+++ b/Google.GenAI/types/LogprobsResultTopCandidates.cs
@@ -23,12 +23,13 @@
namespace Google.GenAI.Types {
///
- /// Candidates with top log probabilities at each decoding step.
+ /// A list of the top candidate tokens and their log probabilities at each decoding step. This can
+ /// be used to see what other tokens the model considered.
///
public record LogprobsResultTopCandidates {
///
- /// Sorted by log probability in descending order.
+ /// The list of candidate tokens, sorted by log probability in descending order.
///
[JsonPropertyName("candidates")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/McpServer.cs b/Google.GenAI/types/McpServer.cs
new file mode 100644
index 00000000..77b302bd
--- /dev/null
+++ b/Google.GenAI/types/McpServer.cs
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// A MCPServer is a server that can be called by the model to perform actions. It is a server
+ /// that implements the MCP protocol. Next ID: 5. This data type is not supported in Vertex AI.
+ ///
+
+ public record McpServer {
+ ///
+ /// The name of the MCPServer.
+ ///
+ [JsonPropertyName("name")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string ? Name { get; set; }
+
+ ///
+ /// A transport that can stream HTTP requests and responses.
+ ///
+ [JsonPropertyName("streamableHttpTransport")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public StreamableHttpTransport
+ ? StreamableHttpTransport {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a McpServer object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized McpServer object, or null if deserialization fails.
+ public static McpServer ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/ModalityTokenCount.cs b/Google.GenAI/types/ModalityTokenCount.cs
index 2c372f8d..a0afb4f7 100644
--- a/Google.GenAI/types/ModalityTokenCount.cs
+++ b/Google.GenAI/types/ModalityTokenCount.cs
@@ -35,7 +35,7 @@ public record ModalityTokenCount {
public MediaModality ? Modality { get; set; }
///
- /// Number of tokens.
+ /// The number of tokens counted for this modality.
///
[JsonPropertyName("tokenCount")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/ModelArmorConfig.cs b/Google.GenAI/types/ModelArmorConfig.cs
index 5c247f54..fd119e7f 100644
--- a/Google.GenAI/types/ModelArmorConfig.cs
+++ b/Google.GenAI/types/ModelArmorConfig.cs
@@ -23,20 +23,30 @@
namespace Google.GenAI.Types {
///
- /// Configuration for Model Armor integrations of prompt and responses. This data type is not
- /// supported in Gemini API.
+ /// Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and
+ /// security filtering for prompts and responses. It helps protect your AI applications from risks
+ /// such as harmful content, sensitive data leakage, and prompt injection attacks. This data type
+ /// is not supported in Gemini API.
///
public record ModelArmorConfig {
///
- /// Optional. The name of the Model Armor template to use for prompt sanitization.
+ /// Optional. The resource name of the Model Armor template to use for prompt screening. A Model
+ /// Armor template is a set of customized filters and thresholds that define how Model Armor
+ /// screens content. If specified, Model Armor will use this template to check the user's prompt
+ /// for safety and security risks before it is sent to the model. The name must be in the format
+ /// `projects/{project}/locations/{location}/templates/{template}`.
///
[JsonPropertyName("promptTemplateName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string ? PromptTemplateName { get; set; }
///
- /// Optional. The name of the Model Armor template to use for response sanitization.
+ /// Optional. The resource name of the Model Armor template to use for response screening. A
+ /// Model Armor template is a set of customized filters and thresholds that define how Model
+ /// Armor screens content. If specified, Model Armor will use this template to check the model's
+ /// response for safety and security risks before it is returned to the user. The name must be
+ /// in the format `projects/{project}/locations/{location}/templates/{template}`.
///
[JsonPropertyName("responseTemplateName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/ModelStage.cs b/Google.GenAI/types/ModelStage.cs
new file mode 100644
index 00000000..5ee008cc
--- /dev/null
+++ b/Google.GenAI/types/ModelStage.cs
@@ -0,0 +1,68 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System.Text.Json.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The stage of the underlying model. This enum is not supported in Vertex AI.
+ ///
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum ModelStage {
+ ///
+ /// Unspecified model stage.
+ ///
+ [JsonPropertyName("MODEL_STAGE_UNSPECIFIED")] MODEL_STAGE_UNSPECIFIED,
+
+ ///
+ /// The underlying model is subject to lots of tunings.
+ ///
+ [JsonPropertyName("UNSTABLE_EXPERIMENTAL")] UNSTABLE_EXPERIMENTAL,
+
+ ///
+ /// Models in this stage are for experimental purposes only.
+ ///
+ [JsonPropertyName("EXPERIMENTAL")] EXPERIMENTAL,
+
+ ///
+ /// Models in this stage are more mature than experimental models.
+ ///
+ [JsonPropertyName("PREVIEW")] PREVIEW,
+
+ ///
+ /// Models in this stage are considered stable and ready for production use.
+ ///
+ [JsonPropertyName("STABLE")] STABLE,
+
+ ///
+ /// If the model is on this stage, it means that this model is on the path to deprecation in
+ /// near future. Only existing customers can use this model.
+ ///
+ [JsonPropertyName("LEGACY")] LEGACY,
+
+ ///
+ /// Models in this stage are deprecated. These models cannot be used.
+ ///
+ [JsonPropertyName("DEPRECATED")] DEPRECATED,
+
+ ///
+ /// Models in this stage are retired. These models cannot be used.
+ ///
+ [JsonPropertyName("RETIRED")] RETIRED
+ }
+}
diff --git a/Google.GenAI/types/ModelStatus.cs b/Google.GenAI/types/ModelStatus.cs
new file mode 100644
index 00000000..bf64db89
--- /dev/null
+++ b/Google.GenAI/types/ModelStatus.cs
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// The status of the underlying model. This is used to indicate the stage of the underlying model
+ /// and the retirement time if applicable. This data type is not supported in Vertex AI.
+ ///
+
+ public record ModelStatus {
+ ///
+ /// A message explaining the model status.
+ ///
+ [JsonPropertyName("message")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string ? Message { get; set; }
+
+ ///
+ /// The stage of the underlying model.
+ ///
+ [JsonPropertyName("modelStage")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public ModelStage
+ ? ModelStage {
+ get; set;
+ }
+
+ ///
+ /// The time at which the model will be retired.
+ ///
+ [JsonPropertyName("retirementTime")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public DateTime
+ ? RetirementTime {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a ModelStatus object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized ModelStatus object, or null if deserialization fails.
+ public static ModelStatus ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/OutputInfo.cs b/Google.GenAI/types/OutputInfo.cs
new file mode 100644
index 00000000..47633f62
--- /dev/null
+++ b/Google.GenAI/types/OutputInfo.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Describes the info for output of EvaluationService.EvaluateDataset. This data type is not
+ /// supported in Gemini API.
+ ///
+
+ public record OutputInfo {
+ ///
+ /// Output only. The full path of the Cloud Storage directory created, into which the evaluation
+ /// results and aggregation results are written.
+ ///
+ [JsonPropertyName("gcsOutputDirectory")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string ? GcsOutputDirectory { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a OutputInfo object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized OutputInfo object, or null if deserialization fails.
+ public static OutputInfo ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/PairwiseChoice.cs b/Google.GenAI/types/PairwiseChoice.cs
new file mode 100644
index 00000000..892fdaab
--- /dev/null
+++ b/Google.GenAI/types/PairwiseChoice.cs
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System.Text.Json.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Output only. Pairwise metric choice. This enum is not supported in Gemini API.
+ ///
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum PairwiseChoice {
+ ///
+ /// Unspecified prediction choice.
+ ///
+ [JsonPropertyName("PAIRWISE_CHOICE_UNSPECIFIED")] PAIRWISE_CHOICE_UNSPECIFIED,
+
+ ///
+ /// Baseline prediction wins
+ ///
+ [JsonPropertyName("BASELINE")] BASELINE,
+
+ ///
+ /// Candidate prediction wins
+ ///
+ [JsonPropertyName("CANDIDATE")] CANDIDATE,
+
+ ///
+ /// Winner cannot be determined
+ ///
+ [JsonPropertyName("TIE")] TIE
+ }
+}
diff --git a/Google.GenAI/types/PairwiseMetricResult.cs b/Google.GenAI/types/PairwiseMetricResult.cs
new file mode 100644
index 00000000..4edace79
--- /dev/null
+++ b/Google.GenAI/types/PairwiseMetricResult.cs
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Spec for pairwise metric result. This data type is not supported in Gemini API.
+ ///
+
+ public record PairwiseMetricResult {
+ ///
+ /// Output only. Spec for custom output.
+ ///
+ [JsonPropertyName("customOutput")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public CustomOutput ? CustomOutput { get; set; }
+
+ ///
+ /// Output only. Explanation for pairwise metric score.
+ ///
+ [JsonPropertyName("explanation")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? Explanation {
+ get; set;
+ }
+
+ ///
+ /// Output only. Pairwise metric choice.
+ ///
+ [JsonPropertyName("pairwiseChoice")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public PairwiseChoice
+ ? PairwiseChoice {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a PairwiseMetricResult object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized PairwiseMetricResult object, or null if deserialization
+ /// fails.
+ public static PairwiseMetricResult
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/Part.cs b/Google.GenAI/types/Part.cs
index 00cf0e30..961be713 100644
--- a/Google.GenAI/types/Part.cs
+++ b/Google.GenAI/types/Part.cs
@@ -37,7 +37,7 @@ public record Part {
public PartMediaResolution ? MediaResolution { get; set; }
///
- /// Optional. Result of executing the [ExecutableCode].
+ /// Optional. The result of executing the ExecutableCode.
///
[JsonPropertyName("codeExecutionResult")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -47,7 +47,7 @@ public CodeExecutionResult
}
///
- /// Optional. Code generated by the model that is meant to be executed.
+ /// Optional. Code generated by the model that is intended to be executed.
///
[JsonPropertyName("executableCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -57,7 +57,8 @@ public ExecutableCode
}
///
- /// Optional. URI based data.
+ /// Optional. The URI-based data of the part. This can be used to include files from Google
+ /// Cloud Storage.
///
[JsonPropertyName("fileData")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -67,8 +68,8 @@ public FileData
}
///
- /// Optional. A predicted [FunctionCall] returned from the model that contains a string
- /// representing the [FunctionDeclaration.name] with the parameters and their values.
+ /// Optional. A predicted function call returned from the model. This contains the name of the
+ /// function to call and the arguments to pass to the function.
///
[JsonPropertyName("functionCall")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -78,9 +79,8 @@ public FunctionCall
}
///
- /// Optional. The result output of a [FunctionCall] that contains a string representing the
- /// [FunctionDeclaration.name] and a structured JSON object containing any output from the
- /// function call. It is used as context to the model.
+ /// Optional. The result of a function call. This is used to provide the model with the result
+ /// of a function call that it predicted.
///
[JsonPropertyName("functionResponse")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -90,7 +90,8 @@ public FunctionResponse
}
///
- /// Optional. Inlined bytes data.
+ /// Optional. The inline data content of the part. This can be used to include images, audio, or
+ /// video in a request.
///
[JsonPropertyName("inlineData")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -100,7 +101,7 @@ public Blob
}
///
- /// Optional. Text part (can be code).
+ /// Optional. The text content of the part.
///
[JsonPropertyName("text")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -110,7 +111,7 @@ public string
}
///
- /// Optional. Indicates if the part is thought from the model.
+ /// Optional. Indicates whether the `part` represents the model's thought process or reasoning.
///
[JsonPropertyName("thought")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -140,6 +141,19 @@ public VideoMetadata
get; set;
}
+ ///
+ /// Custom metadata associated with the Part. Agents using genai.Part as content representation
+ /// may need to keep track of the additional information. For example it can be name of a
+ /// file/source from which the Part originates or a way to multiplex multiple Part streams. This
+ /// field is not supported in Vertex AI.
+ ///
+ [JsonPropertyName("partMetadata")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public Dictionary
+ ? PartMetadata {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a Part object.
///
diff --git a/Google.GenAI/types/PartialArg.cs b/Google.GenAI/types/PartialArg.cs
index 92819d5b..31633b8c 100644
--- a/Google.GenAI/types/PartialArg.cs
+++ b/Google.GenAI/types/PartialArg.cs
@@ -28,50 +28,50 @@ namespace Google.GenAI.Types {
public record PartialArg {
///
- /// Optional. Represents a null value.
+ /// Optional. Represents a boolean value.
///
- [JsonPropertyName("nullValue")]
+ [JsonPropertyName("boolValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public string ? NullValue { get; set; }
+ public bool ? BoolValue { get; set; }
///
- /// Optional. Represents a double value.
+ /// A JSON Path (RFC 9535) to the argument being streamed.
+ /// https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
///
- [JsonPropertyName("numberValue")]
+ [JsonPropertyName("jsonPath")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public double
- ? NumberValue {
+ public string
+ ? JsonPath {
get; set;
}
///
- /// Optional. Represents a string value.
+ /// Optional. Represents a null value.
///
- [JsonPropertyName("stringValue")]
+ [JsonPropertyName("nullValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string
- ? StringValue {
+ ? NullValue {
get; set;
}
///
- /// Optional. Represents a boolean value.
+ /// Optional. Represents a double value.
///
- [JsonPropertyName("boolValue")]
+ [JsonPropertyName("numberValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public bool
- ? BoolValue {
+ public double
+ ? NumberValue {
get; set;
}
///
- /// A JSON Path (RFC 9535) to the argument being streamed.
- /// https://datatracker.ietf.org/doc/html/rfc9535. e.g. "$.foo.bar[0].data".
+ /// Optional. Represents a string value.
///
- [JsonPropertyName("jsonPath")]
+ [JsonPropertyName("stringValue")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string
- ? JsonPath {
+ ? StringValue {
get; set;
}
diff --git a/Google.GenAI/types/PointwiseMetricResult.cs b/Google.GenAI/types/PointwiseMetricResult.cs
new file mode 100644
index 00000000..8f6d86ff
--- /dev/null
+++ b/Google.GenAI/types/PointwiseMetricResult.cs
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Spec for pointwise metric result. This data type is not supported in Gemini API.
+ ///
+
+ public record PointwiseMetricResult {
+ ///
+ /// Output only. Spec for custom output.
+ ///
+ [JsonPropertyName("customOutput")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public CustomOutput ? CustomOutput { get; set; }
+
+ ///
+ /// Output only. Explanation for pointwise metric score.
+ ///
+ [JsonPropertyName("explanation")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? Explanation {
+ get; set;
+ }
+
+ ///
+ /// Output only. Pointwise metric score.
+ ///
+ [JsonPropertyName("score")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public double
+ ? Score {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a PointwiseMetricResult object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized PointwiseMetricResult object, or null if deserialization
+ /// fails.
+ public static PointwiseMetricResult
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/PrebuiltVoiceConfig.cs b/Google.GenAI/types/PrebuiltVoiceConfig.cs
index 69a2284f..efea66fd 100644
--- a/Google.GenAI/types/PrebuiltVoiceConfig.cs
+++ b/Google.GenAI/types/PrebuiltVoiceConfig.cs
@@ -23,12 +23,12 @@
namespace Google.GenAI.Types {
///
- /// The configuration for the prebuilt speaker to use.
+ /// Configuration for a prebuilt voice.
///
public record PrebuiltVoiceConfig {
///
- /// The name of the preset voice to use.
+ /// The name of the prebuilt voice to use.
///
[JsonPropertyName("voiceName")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/PreferenceOptimizationDataStats.cs b/Google.GenAI/types/PreferenceOptimizationDataStats.cs
index 51b11b3d..1c8c4440 100644
--- a/Google.GenAI/types/PreferenceOptimizationDataStats.cs
+++ b/Google.GenAI/types/PreferenceOptimizationDataStats.cs
@@ -28,12 +28,34 @@ namespace Google.GenAI.Types {
///
public record PreferenceOptimizationDataStats {
+ ///
+ /// Output only. A partial sample of the indices (starting from 1) of the dropped examples.
+ ///
+ [JsonPropertyName("droppedExampleIndices")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ [JsonConverter(typeof(StringToNullableLongListConverter))]
+ public List ? DroppedExampleIndices { get; set; }
+
+ ///
+ /// Output only. For each index in `dropped_example_indices`, the user-facing reason why the
+ /// example was dropped.
+ ///
+ [JsonPropertyName("droppedExampleReasons")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List
+ ? DroppedExampleReasons {
+ get; set;
+ }
+
///
/// Output only. Dataset distributions for scores variance per example.
///
[JsonPropertyName("scoreVariancePerExampleDistribution")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public DatasetDistribution ? ScoreVariancePerExampleDistribution { get; set; }
+ public DatasetDistribution
+ ? ScoreVariancePerExampleDistribution {
+ get; set;
+ }
///
/// Output only. Dataset distributions for scores.
diff --git a/Google.GenAI/types/RawOutput.cs b/Google.GenAI/types/RawOutput.cs
new file mode 100644
index 00000000..03704a40
--- /dev/null
+++ b/Google.GenAI/types/RawOutput.cs
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Raw output. This data type is not supported in Gemini API.
+ ///
+
+ public record RawOutput {
+ ///
+ /// Output only. Raw output string.
+ ///
+ [JsonPropertyName("rawOutput")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List ? RawOutputField { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a RawOutput object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized RawOutput object, or null if deserialization fails.
+ public static RawOutput ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/RetrievalMetadata.cs b/Google.GenAI/types/RetrievalMetadata.cs
index 3e376d21..e9be53f1 100644
--- a/Google.GenAI/types/RetrievalMetadata.cs
+++ b/Google.GenAI/types/RetrievalMetadata.cs
@@ -23,15 +23,15 @@
namespace Google.GenAI.Types {
///
- /// Metadata related to retrieval in the grounding flow.
+ /// Metadata returned to client when grounding is enabled.
///
public record RetrievalMetadata {
///
- /// Optional. Score indicating how likely information from Google Search could help answer the
- /// prompt. The score is in the range `[0, 1]`, where 0 is the least likely and 1 is the most
- /// likely. This score is only populated when Google Search grounding and dynamic retrieval is
- /// enabled. It will be compared to the threshold to determine whether to trigger Google Search.
+ /// Optional. Score indicating how likely information from google search could help answer the
+ /// prompt. The score is in the range [0, 1], where 0 is the least likely and 1 is the most
+ /// likely. This score is only populated when google search grounding and dynamic retrieval is
+ /// enabled. It will be compared to the threshold to determine whether to trigger Google search.
///
[JsonPropertyName("googleSearchDynamicRetrievalScore")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/RougeMetricValue.cs b/Google.GenAI/types/RougeMetricValue.cs
new file mode 100644
index 00000000..12d0884e
--- /dev/null
+++ b/Google.GenAI/types/RougeMetricValue.cs
@@ -0,0 +1,54 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Rouge metric value for an instance. This data type is not supported in Gemini API.
+ ///
+
+ public record RougeMetricValue {
+ ///
+ /// Output only. Rouge score.
+ ///
+ [JsonPropertyName("score")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public double ? Score { get; set; }
+
+ ///
+ /// Deserializes a JSON string to a RougeMetricValue object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized RougeMetricValue object, or null if deserialization
+ /// fails.
+ public static RougeMetricValue
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/SafetyRating.cs b/Google.GenAI/types/SafetyRating.cs
index 89fe39b9..d0335509 100644
--- a/Google.GenAI/types/SafetyRating.cs
+++ b/Google.GenAI/types/SafetyRating.cs
@@ -23,19 +23,20 @@
namespace Google.GenAI.Types {
///
- /// Safety rating corresponding to the generated content.
+ /// A safety rating for a piece of content. The safety rating contains the harm category and the
+ /// harm probability level.
///
public record SafetyRating {
///
- /// Output only. Indicates whether the content was filtered out because of this rating.
+ /// Output only. Indicates whether the content was blocked because of this rating.
///
[JsonPropertyName("blocked")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool ? Blocked { get; set; }
///
- /// Output only. Harm category.
+ /// Output only. The harm category of this rating.
///
[JsonPropertyName("category")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -57,7 +58,7 @@ public HarmBlockThreshold
}
///
- /// Output only. Harm probability levels in the content.
+ /// Output only. The probability of harm for this category.
///
[JsonPropertyName("probability")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -67,7 +68,8 @@ public HarmProbability
}
///
- /// Output only. Harm probability score. This field is not supported in Gemini API.
+ /// Output only. The probability score of harm for this category. This field is not supported in
+ /// Gemini API.
///
[JsonPropertyName("probabilityScore")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -77,7 +79,8 @@ public double
}
///
- /// Output only. Harm severity levels in the content. This field is not supported in Gemini API.
+ /// Output only. The severity of harm for this category. This field is not supported in Gemini
+ /// API.
///
[JsonPropertyName("severity")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -87,7 +90,8 @@ public HarmSeverity
}
///
- /// Output only. Harm severity score. This field is not supported in Gemini API.
+ /// Output only. The severity score of harm for this category. This field is not supported in
+ /// Gemini API.
///
[JsonPropertyName("severityScore")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/SafetySetting.cs b/Google.GenAI/types/SafetySetting.cs
index 0846c02b..860beba7 100644
--- a/Google.GenAI/types/SafetySetting.cs
+++ b/Google.GenAI/types/SafetySetting.cs
@@ -23,21 +23,21 @@
namespace Google.GenAI.Types {
///
- /// Safety settings.
+ /// A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm
+ /// category and a threshold for that category.
///
public record SafetySetting {
///
- /// Harm category.
+ /// The harm category to be blocked.
///
[JsonPropertyName("category")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public HarmCategory ? Category { get; set; }
///
- /// Optional. Specify if the threshold is used for probability or severity score. If not
- /// specified, the threshold is used for probability score. This field is not supported in
- /// Gemini API.
+ /// Optional. The method for blocking content. If not specified, the default behavior is to use
+ /// the probability score. This field is not supported in Gemini API.
///
[JsonPropertyName("method")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -47,7 +47,8 @@ public HarmBlockMethod
}
///
- /// The harm block threshold.
+ /// The threshold for blocking content. If the harm probability exceeds this threshold, the
+ /// content will be blocked.
///
[JsonPropertyName("threshold")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/Schema.cs b/Google.GenAI/types/Schema.cs
index 6e6d0186..e3dbfb00 100644
--- a/Google.GenAI/types/Schema.cs
+++ b/Google.GenAI/types/Schema.cs
@@ -63,8 +63,8 @@ public string
}
///
- /// Optional. The value should be validated against any (one or more) of the subschemas in the
- /// list.
+ /// Optional. The instance must be valid against any (one or more) of the subschemas listed in
+ /// `any_of`.
///
[JsonPropertyName("anyOf")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -74,7 +74,7 @@ public List
}
///
- /// Optional. Default value of the data.
+ /// Optional. Default value to use if the field is not specified.
///
[JsonPropertyName("default")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -84,7 +84,7 @@ public object
}
///
- /// Optional. The description of the data.
+ /// Optional. Description of the schema.
///
[JsonPropertyName("description")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -94,10 +94,11 @@ public string
}
///
- /// Optional. Possible values of the element of primitive type with enum format. Examples: 1. We
- /// can define direction as : {type:STRING, format:enum, enum:["EAST", NORTH", "SOUTH",
- /// "WEST"]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:["101",
- /// "201", "301"]}
+ /// Optional. Possible values of the field. This field can be used to restrict a value to a
+ /// fixed set of values. To mark a field as an enum, set `format` to `enum` and provide the list
+ /// of possible values in `enum`. For example: 1. To define directions: `{type:STRING,
+ /// format:enum, enum:["EAST", "NORTH", "SOUTH", "WEST"]}` 2. To define apartment numbers:
+ /// `{type:INTEGER, format:enum, enum:["101", "201", "301"]}`
///
[JsonPropertyName("enum")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -107,7 +108,7 @@ public List
}
///
- /// Optional. Example of the object. Will only populated when the object is the root.
+ /// Optional. Example of an instance of this schema.
///
[JsonPropertyName("example")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -117,8 +118,9 @@ public object
}
///
- /// Optional. The format of the data. Supported formats: for NUMBER type: "float", "double" for
- /// INTEGER type: "int32", "int64" for STRING type: "email", "byte", etc
+ /// Optional. The format of the data. For `NUMBER` type, format can be `float` or `double`. For
+ /// `INTEGER` type, format can be `int32` or `int64`. For `STRING` type, format can be `email`,
+ /// `byte`, `date`, `date-time`, `password`, and other formats to further refine the data type.
///
[JsonPropertyName("format")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -128,7 +130,7 @@ public string
}
///
- /// Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
+ /// Optional. If type is `ARRAY`, `items` specifies the schema of elements in the array.
///
[JsonPropertyName("items")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -138,7 +140,7 @@ public Schema
}
///
- /// Optional. Maximum number of the elements for Type.ARRAY.
+ /// Optional. If type is `ARRAY`, `max_items` specifies the maximum number of items in an array.
///
[JsonPropertyName("maxItems")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -149,7 +151,7 @@ public long
}
///
- /// Optional. Maximum length of the Type.STRING
+ /// Optional. If type is `STRING`, `max_length` specifies the maximum length of the string.
///
[JsonPropertyName("maxLength")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -160,7 +162,8 @@ public long
}
///
- /// Optional. Maximum number of the properties for Type.OBJECT.
+ /// Optional. If type is `OBJECT`, `max_properties` specifies the maximum number of properties
+ /// that can be provided.
///
[JsonPropertyName("maxProperties")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -171,7 +174,7 @@ public long
}
///
- /// Optional. Maximum value of the Type.INTEGER and Type.NUMBER
+ /// Optional. If type is `INTEGER` or `NUMBER`, `maximum` specifies the maximum allowed value.
///
[JsonPropertyName("maximum")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -181,7 +184,7 @@ public double
}
///
- /// Optional. Minimum number of the elements for Type.ARRAY.
+ /// Optional. If type is `ARRAY`, `min_items` specifies the minimum number of items in an array.
///
[JsonPropertyName("minItems")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -192,7 +195,7 @@ public long
}
///
- /// Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
+ /// Optional. If type is `STRING`, `min_length` specifies the minimum length of the string.
///
[JsonPropertyName("minLength")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -203,7 +206,8 @@ public long
}
///
- /// Optional. Minimum number of the properties for Type.OBJECT.
+ /// Optional. If type is `OBJECT`, `min_properties` specifies the minimum number of properties
+ /// that can be provided.
///
[JsonPropertyName("minProperties")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -214,8 +218,7 @@ public long
}
///
- /// Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and
- /// Type.NUMBER
+ /// Optional. If type is `INTEGER` or `NUMBER`, `minimum` specifies the minimum allowed value.
///
[JsonPropertyName("minimum")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -225,7 +228,7 @@ public double
}
///
- /// Optional. Indicates if the value may be null.
+ /// Optional. Indicates if the value of this field can be null.
///
[JsonPropertyName("nullable")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -235,7 +238,8 @@ public bool
}
///
- /// Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
+ /// Optional. If type is `STRING`, `pattern` specifies a regular expression that the string must
+ /// match.
///
[JsonPropertyName("pattern")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -245,7 +249,8 @@ public string
}
///
- /// Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
+ /// Optional. If type is `OBJECT`, `properties` is a map of property names to schema definitions
+ /// for each property of the object.
///
[JsonPropertyName("properties")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -255,8 +260,8 @@ public Dictionary
}
///
- /// Optional. The order of the properties. Not a standard field in open api spec. Only used to
- /// support the order of the properties.
+ /// Optional. Order of properties displayed or used where order matters. This is not a standard
+ /// field in OpenAPI specification, but can be used to control the order of properties.
///
[JsonPropertyName("propertyOrdering")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -266,7 +271,8 @@ public List
}
///
- /// Optional. Required properties of Type.OBJECT.
+ /// Optional. If type is `OBJECT`, `required` lists the names of properties that must be
+ /// present.
///
[JsonPropertyName("required")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -276,7 +282,7 @@ public List
}
///
- /// Optional. The title of the Schema.
+ /// Optional. Title for the schema.
///
[JsonPropertyName("title")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -286,7 +292,7 @@ public string
}
///
- /// Optional. The type of the data.
+ /// Optional. Data type of the schema field.
///
[JsonPropertyName("type")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/SearchEntryPoint.cs b/Google.GenAI/types/SearchEntryPoint.cs
index 5301184a..b950fa79 100644
--- a/Google.GenAI/types/SearchEntryPoint.cs
+++ b/Google.GenAI/types/SearchEntryPoint.cs
@@ -23,7 +23,7 @@
namespace Google.GenAI.Types {
///
- /// Google search entry point.
+ /// The entry point used to search for grounding sources.
///
public record SearchEntryPoint {
@@ -35,7 +35,7 @@ public record SearchEntryPoint {
public string ? RenderedContent { get; set; }
///
- /// Optional. Base64 encoded JSON representing array of tuple.
+ /// Optional. JSON representing array of tuples.
///
[JsonPropertyName("sdkBlob")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/Segment.cs b/Google.GenAI/types/Segment.cs
index 5527d918..7c8dc73a 100644
--- a/Google.GenAI/types/Segment.cs
+++ b/Google.GenAI/types/Segment.cs
@@ -23,36 +23,36 @@
namespace Google.GenAI.Types {
///
- /// Segment of the content.
+ /// Segment of the content this support belongs to.
///
public record Segment {
///
- /// Output only. End index in the given Part, measured in bytes. Offset from the start of the
- /// Part, exclusive, starting at zero.
+ /// Output only. Start index in the given Part, measured in bytes. Offset from the start of the
+ /// Part, inclusive, starting at zero.
///
- [JsonPropertyName("endIndex")]
+ [JsonPropertyName("startIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public int ? EndIndex { get; set; }
+ public int ? StartIndex { get; set; }
///
- /// Output only. The index of a Part object within its parent Content object.
+ /// Output only. End index in the given Part, measured in bytes. Offset from the start of the
+ /// Part, exclusive, starting at zero.
///
- [JsonPropertyName("partIndex")]
+ [JsonPropertyName("endIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int
- ? PartIndex {
+ ? EndIndex {
get; set;
}
///
- /// Output only. Start index in the given Part, measured in bytes. Offset from the start of the
- /// Part, inclusive, starting at zero.
+ /// Output only. The index of a Part object within its parent Content object.
///
- [JsonPropertyName("startIndex")]
+ [JsonPropertyName("partIndex")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int
- ? StartIndex {
+ ? PartIndex {
get; set;
}
diff --git a/Google.GenAI/types/SpeakerVoiceConfig.cs b/Google.GenAI/types/SpeakerVoiceConfig.cs
index 926ad13e..c1c6bc6a 100644
--- a/Google.GenAI/types/SpeakerVoiceConfig.cs
+++ b/Google.GenAI/types/SpeakerVoiceConfig.cs
@@ -23,7 +23,7 @@
namespace Google.GenAI.Types {
///
- /// Configuration for a single speaker in a multi speaker setup.
+ /// Configuration for a single speaker in a multi-speaker setup.
///
public record SpeakerVoiceConfig {
diff --git a/Google.GenAI/types/SpeechConfig.cs b/Google.GenAI/types/SpeechConfig.cs
index f872f7a4..b4055e2f 100644
--- a/Google.GenAI/types/SpeechConfig.cs
+++ b/Google.GenAI/types/SpeechConfig.cs
@@ -32,7 +32,7 @@ public record SpeechConfig {
public VoiceConfig ? VoiceConfig { get; set; }
///
- /// Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization.
+ /// Optional. The language code (ISO 639-1) for the speech synthesis.
///
[JsonPropertyName("languageCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/StreamableHttpTransport.cs b/Google.GenAI/types/StreamableHttpTransport.cs
new file mode 100644
index 00000000..4015c51f
--- /dev/null
+++ b/Google.GenAI/types/StreamableHttpTransport.cs
@@ -0,0 +1,95 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// A transport that can stream HTTP requests and responses. Next ID: 6. This data type is not
+ /// supported in Vertex AI.
+ ///
+
+ public record StreamableHttpTransport {
+ ///
+ /// Optional: Fields for authentication headers, timeouts, etc., if needed.
+ ///
+ [JsonPropertyName("headers")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public Dictionary ? Headers { get; set; }
+
+ ///
+ /// Timeout for SSE read operations.
+ ///
+ [JsonPropertyName("sseReadTimeout")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? SseReadTimeout {
+ get; set;
+ }
+
+ ///
+ /// Whether to close the client session when the transport closes.
+ ///
+ [JsonPropertyName("terminateOnClose")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public bool
+ ? TerminateOnClose {
+ get; set;
+ }
+
+ ///
+ /// HTTP timeout for regular operations.
+ ///
+ [JsonPropertyName("timeout")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? Timeout {
+ get; set;
+ }
+
+ ///
+ /// The full URL for the MCPServer endpoint. Example: "https://api.example.com/mcp".
+ ///
+ [JsonPropertyName("url")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string
+ ? Url {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a StreamableHttpTransport object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized StreamableHttpTransport object, or null if deserialization
+ /// fails.
+ public static StreamableHttpTransport
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/ThinkingLevel.cs b/Google.GenAI/types/ThinkingLevel.cs
index 78be551b..9d1e32dc 100644
--- a/Google.GenAI/types/ThinkingLevel.cs
+++ b/Google.GenAI/types/ThinkingLevel.cs
@@ -29,6 +29,11 @@ public enum ThinkingLevel {
///
[JsonPropertyName("THINKING_LEVEL_UNSPECIFIED")] THINKING_LEVEL_UNSPECIFIED,
+ ///
+ /// MINIMAL thinking level.
+ ///
+ [JsonPropertyName("MINIMAL")] MINIMAL,
+
///
/// Low thinking level.
///
@@ -42,11 +47,6 @@ public enum ThinkingLevel {
///
/// High thinking level.
///
- [JsonPropertyName("HIGH")] HIGH,
-
- ///
- /// MINIMAL thinking level.
- ///
- [JsonPropertyName("MINIMAL")] MINIMAL
+ [JsonPropertyName("HIGH")] HIGH
}
}
diff --git a/Google.GenAI/types/Tool.cs b/Google.GenAI/types/Tool.cs
index 8dea5697..852aff36 100644
--- a/Google.GenAI/types/Tool.cs
+++ b/Google.GenAI/types/Tool.cs
@@ -47,6 +47,17 @@ public ComputerUse
get; set;
}
+ ///
+ /// Optional. Tool that allows grounding the model's response with geospatial context related to
+ /// the user's query.
+ ///
+ [JsonPropertyName("googleMaps")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public GoogleMaps
+ ? GoogleMaps {
+ get; set;
+ }
+
///
/// Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
///
@@ -82,16 +93,6 @@ public List
get; set;
}
- ///
- /// Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
- ///
- [JsonPropertyName("googleMaps")]
- [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
- public GoogleMaps
- ? GoogleMaps {
- get; set;
- }
-
///
/// Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
///
@@ -112,6 +113,18 @@ public GoogleSearchRetrieval
get; set;
}
+ ///
+ /// Optional. If specified, Vertex AI will use Parallel.ai to search for information to answer
+ /// user queries. The search results will be grounded on Parallel.ai and presented to the model
+ /// for response generation. This field is not supported in Gemini API.
+ ///
+ [JsonPropertyName("parallelAiSearch")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public ToolParallelAiSearch
+ ? ParallelAiSearch {
+ get; set;
+ }
+
///
/// Optional. Tool to support URL context retrieval.
///
@@ -122,6 +135,16 @@ public UrlContext
get; set;
}
+ ///
+ /// Optional. MCP Servers to connect to. This field is not supported in Vertex AI.
+ ///
+ [JsonPropertyName("mcpServers")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List
+ ? McpServers {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a Tool object.
///
diff --git a/Google.GenAI/types/ToolParallelAiSearch.cs b/Google.GenAI/types/ToolParallelAiSearch.cs
new file mode 100644
index 00000000..6efe059f
--- /dev/null
+++ b/Google.GenAI/types/ToolParallelAiSearch.cs
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System;
+using System.Text.Json;
+using System.Text.Json.Serialization;
+using Google.GenAI.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// ParallelAiSearch tool type. A tool that uses the Parallel.ai search engine for grounding. This
+ /// data type is not supported in Gemini API.
+ ///
+
+ public record ToolParallelAiSearch {
+ ///
+ /// Optional. The API key for ParallelAiSearch. If an API key is not provided, the system will
+ /// attempt to verify access by checking for an active Parallel.ai subscription through the
+ /// Google Cloud Marketplace. See https://docs.parallel.ai/search/search-quickstart for more
+ /// details.
+ ///
+ [JsonPropertyName("apiKey")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public string ? ApiKey { get; set; }
+
+ ///
+ /// Optional. Custom configs for ParallelAiSearch. This field can be used to pass any parameter
+ /// from the Parallel.ai Search API. See the Parallel.ai documentation for the full list of
+ /// available parameters and their usage:
+ /// https://docs.parallel.ai/api-reference/search-beta/search Currently only `source_policy`,
+ /// `excerpts`, `max_results`, `mode`, `fetch_policy` can be set via this field. For example: {
+ /// "source_policy": { "include_domains": ["google.com", "wikipedia.org"], "exclude_domains":
+ /// ["example.com"] }, "fetch_policy": { "max_age_seconds": 3600 } }
+ ///
+ [JsonPropertyName("customConfigs")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public Dictionary
+ ? CustomConfigs {
+ get; set;
+ }
+
+ ///
+ /// Deserializes a JSON string to a ToolParallelAiSearch object.
+ ///
+ /// The JSON string to deserialize.
+ /// Optional JsonSerializerOptions.
+ /// The deserialized ToolParallelAiSearch object, or null if deserialization
+ /// fails.
+ public static ToolParallelAiSearch
+ ? FromJson(string jsonString, JsonSerializerOptions? options = null) {
+ try {
+ return JsonSerializer.Deserialize(jsonString, options);
+ } catch (JsonException e) {
+ Console.Error.WriteLine($"Error deserializing JSON: {e.ToString()}");
+ return null;
+ }
+ }
+ }
+}
diff --git a/Google.GenAI/types/TuningDataStats.cs b/Google.GenAI/types/TuningDataStats.cs
index b09c742b..83845c85 100644
--- a/Google.GenAI/types/TuningDataStats.cs
+++ b/Google.GenAI/types/TuningDataStats.cs
@@ -28,7 +28,8 @@ namespace Google.GenAI.Types {
public record TuningDataStats {
///
- /// Output only. Statistics for distillation.
+ /// Output only. Statistics for distillation prompt dataset. These statistics do not include the
+ /// responses sampled from the teacher model.
///
[JsonPropertyName("distillationDataStats")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/TuningJob.cs b/Google.GenAI/types/TuningJob.cs
index 69a38e43..baad560c 100644
--- a/Google.GenAI/types/TuningJob.cs
+++ b/Google.GenAI/types/TuningJob.cs
@@ -213,6 +213,16 @@ public string
get; set;
}
+ ///
+ /// Output only. Evaluation runs for the Tuning Job.
+ ///
+ [JsonPropertyName("evaluateDatasetRuns")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public List
+ ? EvaluateDatasetRuns {
+ get; set;
+ }
+
///
/// Output only. The Experiment associated with this TuningJob.
///
@@ -223,6 +233,16 @@ public string
get; set;
}
+ ///
+ /// Tuning Spec for Full Fine Tuning.
+ ///
+ [JsonPropertyName("fullFineTuningSpec")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public FullFineTuningSpec
+ ? FullFineTuningSpec {
+ get; set;
+ }
+
///
/// Optional. The labels with user-defined metadata to organize TuningJob and generated
/// resources such as Model and Endpoint. Label keys and values can be no longer than 64
@@ -286,6 +306,16 @@ public string
get; set;
}
+ ///
+ /// Output only. The detail state of the tuning job (while the overall `JobState` is running).
+ ///
+ [JsonPropertyName("tuningJobState")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public TuningJobState
+ ? TuningJobState {
+ get; set;
+ }
+
///
/// Tuning Spec for Veo Tuning.
///
diff --git a/Google.GenAI/types/TuningJobState.cs b/Google.GenAI/types/TuningJobState.cs
new file mode 100644
index 00000000..8fe485a2
--- /dev/null
+++ b/Google.GenAI/types/TuningJobState.cs
@@ -0,0 +1,59 @@
+/*
+ * Copyright 2025 Google LLC
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// Auto-generated code. Do not edit.
+
+using System.Text.Json.Serialization;
+
+namespace Google.GenAI.Types {
+ ///
+ /// Output only. The detail state of the tuning job (while the overall `JobState` is running).
+ /// This enum is not supported in Gemini API.
+ ///
+ [JsonConverter(typeof(JsonStringEnumConverter))]
+ public enum TuningJobState {
+ ///
+ /// Default tuning job state.
+ ///
+ [JsonPropertyName("TUNING_JOB_STATE_UNSPECIFIED")] TUNING_JOB_STATE_UNSPECIFIED,
+
+ ///
+ /// Tuning job is waiting for job quota.
+ ///
+ [JsonPropertyName("TUNING_JOB_STATE_WAITING_FOR_QUOTA")] TUNING_JOB_STATE_WAITING_FOR_QUOTA,
+
+ ///
+ /// Tuning job is validating the dataset.
+ ///
+ [JsonPropertyName("TUNING_JOB_STATE_PROCESSING_DATASET")] TUNING_JOB_STATE_PROCESSING_DATASET,
+
+ ///
+ /// Tuning job is waiting for hardware capacity.
+ ///
+ [JsonPropertyName(
+ "TUNING_JOB_STATE_WAITING_FOR_CAPACITY")] TUNING_JOB_STATE_WAITING_FOR_CAPACITY,
+
+ ///
+ /// Tuning job is running.
+ ///
+ [JsonPropertyName("TUNING_JOB_STATE_TUNING")] TUNING_JOB_STATE_TUNING,
+
+ ///
+ /// Tuning job is doing some post processing steps.
+ ///
+ [JsonPropertyName("TUNING_JOB_STATE_POST_PROCESSING")] TUNING_JOB_STATE_POST_PROCESSING
+ }
+}
diff --git a/Google.GenAI/types/Type.cs b/Google.GenAI/types/Type.cs
index bb9e70f1..66b44cf6 100644
--- a/Google.GenAI/types/Type.cs
+++ b/Google.GenAI/types/Type.cs
@@ -20,7 +20,7 @@
namespace Google.GenAI.Types {
///
- /// The type of the data.
+ /// Data type of the schema field.
///
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum Type {
diff --git a/Google.GenAI/types/UrlContextMetadata.cs b/Google.GenAI/types/UrlContextMetadata.cs
index b76f4505..ff020400 100644
--- a/Google.GenAI/types/UrlContextMetadata.cs
+++ b/Google.GenAI/types/UrlContextMetadata.cs
@@ -23,12 +23,13 @@
namespace Google.GenAI.Types {
///
- /// Metadata related to url context retrieval tool.
+ /// Metadata returned when the model uses the `url_context` tool to get information from a
+ /// user-provided URL.
///
public record UrlContextMetadata {
///
- /// Output only. List of url context.
+ /// Output only. A list of URL metadata, with one entry for each URL retrieved by the tool.
///
[JsonPropertyName("urlMetadata")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/UrlMetadata.cs b/Google.GenAI/types/UrlMetadata.cs
index dc2ca14e..ccd2e23a 100644
--- a/Google.GenAI/types/UrlMetadata.cs
+++ b/Google.GenAI/types/UrlMetadata.cs
@@ -23,19 +23,19 @@
namespace Google.GenAI.Types {
///
- /// Context of the a single url retrieval.
+ /// The metadata for a single URL retrieval.
///
public record UrlMetadata {
///
- /// Retrieved url by the tool.
+ /// The URL retrieved by the tool.
///
[JsonPropertyName("retrievedUrl")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string ? RetrievedUrl { get; set; }
///
- /// Status of the url retrieval.
+ /// The status of the URL retrieval.
///
[JsonPropertyName("urlRetrievalStatus")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/UrlRetrievalStatus.cs b/Google.GenAI/types/UrlRetrievalStatus.cs
index 48d4e1fd..fda3f661 100644
--- a/Google.GenAI/types/UrlRetrievalStatus.cs
+++ b/Google.GenAI/types/UrlRetrievalStatus.cs
@@ -20,7 +20,7 @@
namespace Google.GenAI.Types {
///
- /// Status of the url retrieval.
+ /// The status of the URL retrieval.
///
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum UrlRetrievalStatus {
@@ -30,12 +30,12 @@ public enum UrlRetrievalStatus {
[JsonPropertyName("URL_RETRIEVAL_STATUS_UNSPECIFIED")] URL_RETRIEVAL_STATUS_UNSPECIFIED,
///
- /// Url retrieval is successful.
+ /// The URL was retrieved successfully.
///
[JsonPropertyName("URL_RETRIEVAL_STATUS_SUCCESS")] URL_RETRIEVAL_STATUS_SUCCESS,
///
- /// Url retrieval is failed due to error.
+ /// The URL retrieval failed.
///
[JsonPropertyName("URL_RETRIEVAL_STATUS_ERROR")] URL_RETRIEVAL_STATUS_ERROR,
diff --git a/Google.GenAI/types/VeoHyperParameters.cs b/Google.GenAI/types/VeoHyperParameters.cs
index 96e4a2c9..3dce92e1 100644
--- a/Google.GenAI/types/VeoHyperParameters.cs
+++ b/Google.GenAI/types/VeoHyperParameters.cs
@@ -56,6 +56,18 @@ public TuningTask
get; set;
}
+ ///
+ /// Optional. The ratio of Google internal dataset to use in the training mixture, in range of
+ /// `[0, 1)`. If `0.2`, it means 20% of Google internal dataset and 80% of user dataset will be
+ /// used for training.
+ ///
+ [JsonPropertyName("veoDataMixtureRatio")]
+ [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
+ public double
+ ? VeoDataMixtureRatio {
+ get; set;
+ }
+
///
/// Deserializes a JSON string to a VeoHyperParameters object.
///
diff --git a/Google.GenAI/types/VideoMetadata.cs b/Google.GenAI/types/VideoMetadata.cs
index b7bde237..777faa8c 100644
--- a/Google.GenAI/types/VideoMetadata.cs
+++ b/Google.GenAI/types/VideoMetadata.cs
@@ -23,7 +23,8 @@
namespace Google.GenAI.Types {
///
- /// Metadata describes the input video content.
+ /// Provides metadata for a video, including the start and end offsets for clipping and the frame
+ /// rate.
///
public record VideoMetadata {
@@ -36,7 +37,7 @@ public record VideoMetadata {
///
/// Optional. The frame rate of the video sent to the model. If not specified, the default value
- /// will be 1.0. The fps range is (0.0, 24.0].
+ /// is 1.0. The valid range is (0.0, 24.0].
///
[JsonPropertyName("fps")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
diff --git a/Google.GenAI/types/VoiceConfig.cs b/Google.GenAI/types/VoiceConfig.cs
index 352aaddb..80536060 100644
--- a/Google.GenAI/types/VoiceConfig.cs
+++ b/Google.GenAI/types/VoiceConfig.cs
@@ -32,7 +32,7 @@ public record VoiceConfig {
public ReplicatedVoiceConfig ? ReplicatedVoiceConfig { get; set; }
///
- /// The configuration for the prebuilt voice to use.
+ /// The configuration for a prebuilt voice.
///
[JsonPropertyName("prebuiltVoiceConfig")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]