Skip to content

Commit b4b3e4b

Browse files
jscudcopybara-github
authored andcommitted
chore: Update data types from discovery doc.
PiperOrigin-RevId: 832486480
1 parent 4385bf9 commit b4b3e4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+1760
-456
lines changed

Google.GenAI/LiveConverters.cs

Lines changed: 243 additions & 64 deletions
Large diffs are not rendered by default.

Google.GenAI/Models.cs

Lines changed: 257 additions & 58 deletions
Large diffs are not rendered by default.

Google.GenAI/types/BatchState.cs

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
* Copyright 2025 Google LLC
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
// Auto-generated code. Do not edit.
18+
19+
using System.Text.Json.Serialization;
20+
21+
namespace Google.GenAI.Types {
22+
/// <summary>
23+
/// Output only. The state of the batch. This enum is not supported in Vertex AI.
24+
/// </summary>
25+
[JsonConverter(typeof(JsonStringEnumConverter))]
26+
public enum BatchState {
27+
/// <summary>
28+
/// The batch state is unspecified.
29+
/// </summary>
30+
[JsonPropertyName("BATCH_STATE_UNSPECIFIED")] BATCH_STATE_UNSPECIFIED,
31+
32+
/// <summary>
33+
/// The service is preparing to run the batch.
34+
/// </summary>
35+
[JsonPropertyName("BATCH_STATE_PENDING")] BATCH_STATE_PENDING,
36+
37+
/// <summary>
38+
/// The batch is in progress.
39+
/// </summary>
40+
[JsonPropertyName("BATCH_STATE_RUNNING")] BATCH_STATE_RUNNING,
41+
42+
/// <summary>
43+
/// The batch completed successfully.
44+
/// </summary>
45+
[JsonPropertyName("BATCH_STATE_SUCCEEDED")] BATCH_STATE_SUCCEEDED,
46+
47+
/// <summary>
48+
/// The batch failed.
49+
/// </summary>
50+
[JsonPropertyName("BATCH_STATE_FAILED")] BATCH_STATE_FAILED,
51+
52+
/// <summary>
53+
/// The batch has been cancelled.
54+
/// </summary>
55+
[JsonPropertyName("BATCH_STATE_CANCELLED")] BATCH_STATE_CANCELLED,
56+
57+
/// <summary>
58+
/// The batch has expired.
59+
/// </summary>
60+
[JsonPropertyName("BATCH_STATE_EXPIRED")] BATCH_STATE_EXPIRED
61+
}
62+
}

Google.GenAI/types/Blob.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,23 @@
2323

2424
namespace Google.GenAI.Types {
2525
/// <summary>
26-
/// Content blob.
26+
/// A content blob. A Blob contains data of a specific media type. It is used to represent images,
27+
/// audio, and video.
2728
/// </summary>
2829

2930
public record Blob {
3031
/// <summary>
31-
/// Raw bytes.
32+
/// The raw bytes of the data.
3233
/// </summary>
3334
[JsonPropertyName("data")]
3435
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
3536
public byte[] ? Data { get; set; }
3637

3738
/// <summary>
38-
/// Optional. Display name of the blob. Used to provide a label or filename to distinguish
39-
/// blobs. This field is only returned in PromptMessage for prompt management. It is currently
40-
/// used in the Gemini GenerateContent calls only when server side tools (code_execution,
41-
/// google_search, and url_context) are enabled. This field is not supported in Gemini API.
39+
/// Optional. The display name of the blob. Used to provide a label or filename to distinguish
40+
/// blobs. This field is only returned in `PromptMessage` for prompt management. It is used in
41+
/// the Gemini calls only when server-side tools (`code_execution`, `google_search`, and
42+
/// `url_context`) are enabled. This field is not supported in Gemini API.
4243
/// </summary>
4344
[JsonPropertyName("displayName")]
4445
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]

Google.GenAI/types/Candidate.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ public FinishReason
7676
}
7777

7878
/// <summary>
79-
/// Output only. Average log probability score of the candidate.
79+
/// Output only. The average log probability of the tokens in this candidate. This is a
80+
/// length-normalized score that can be used to compare the quality of candidates of different
81+
/// lengths. A higher average log probability suggests a more confident and coherent response.
8082
/// </summary>
8183
[JsonPropertyName("avgLogprobs")]
8284
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -86,7 +88,8 @@ public double
8688
}
8789

8890
/// <summary>
89-
/// Output only. Metadata specifies sources used to ground generated content.
91+
/// Output only. Metadata returned when grounding is enabled. It contains the sources used to
92+
/// ground the generated content.
9093
/// </summary>
9194
[JsonPropertyName("groundingMetadata")]
9295
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -96,7 +99,8 @@ public GroundingMetadata
9699
}
97100

98101
/// <summary>
99-
/// Output only. Index of the candidate.
102+
/// Output only. The 0-based index of this candidate in the list of generated responses. This is
103+
/// useful for distinguishing between multiple candidates when `candidate_count` > 1.
100104
/// </summary>
101105
[JsonPropertyName("index")]
102106
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -106,7 +110,9 @@ public int
106110
}
107111

108112
/// <summary>
109-
/// Output only. Log-likelihood scores for the response tokens and top tokens
113+
/// Output only. The detailed log probability information for the tokens in this candidate. This
114+
/// is useful for debugging, understanding model uncertainty, and identifying potential
115+
/// "hallucinations".
110116
/// </summary>
111117
[JsonPropertyName("logprobsResult")]
112118
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -116,7 +122,7 @@ public LogprobsResult
116122
}
117123

118124
/// <summary>
119-
/// Output only. List of ratings for the safety of a response candidate. There is at most one
125+
/// Output only. A list of ratings for the safety of a response candidate. There is at most one
120126
/// rating per category.
121127
/// </summary>
122128
[JsonPropertyName("safetyRatings")]
@@ -127,7 +133,8 @@ public List<SafetyRating>
127133
}
128134

129135
/// <summary>
130-
/// Output only. Metadata related to url context retrieval tool.
136+
/// Output only. Metadata returned when the model uses the `url_context` tool to get information
137+
/// from a user-provided URL.
131138
/// </summary>
132139
[JsonPropertyName("urlContextMetadata")]
133140
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]

Google.GenAI/types/Citation.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,19 @@
2323

2424
namespace Google.GenAI.Types {
2525
/// <summary>
26-
/// Source attributions for content. This data type is not supported in Gemini API.
26+
/// A citation for a piece of generatedcontent. This data type is not supported in Gemini API.
2727
/// </summary>
2828

2929
public record Citation {
3030
/// <summary>
31-
/// Output only. End index into the content.
31+
/// Output only. The end index of the citation in the content.
3232
/// </summary>
3333
[JsonPropertyName("endIndex")]
3434
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
3535
public int ? EndIndex { get; set; }
3636

3737
/// <summary>
38-
/// Output only. License of the attribution.
38+
/// Output only. The license of the source of the citation.
3939
/// </summary>
4040
[JsonPropertyName("license")]
4141
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -45,7 +45,7 @@ public string
4545
}
4646

4747
/// <summary>
48-
/// Output only. Publication date of the attribution.
48+
/// Output only. The publication date of the source of the citation.
4949
/// </summary>
5050
[JsonPropertyName("publicationDate")]
5151
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -55,7 +55,7 @@ public GoogleTypeDate
5555
}
5656

5757
/// <summary>
58-
/// Output only. Start index into the content.
58+
/// Output only. The start index of the citation in the content.
5959
/// </summary>
6060
[JsonPropertyName("startIndex")]
6161
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -65,7 +65,7 @@ public int
6565
}
6666

6767
/// <summary>
68-
/// Output only. Title of the attribution.
68+
/// Output only. The title of the source of the citation.
6969
/// </summary>
7070
[JsonPropertyName("title")]
7171
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
@@ -75,7 +75,7 @@ public string
7575
}
7676

7777
/// <summary>
78-
/// Output only. Url reference of the attribution.
78+
/// Output only. The URI of the source of the citation.
7979
/// </summary>
8080
[JsonPropertyName("uri")]
8181
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]

Google.GenAI/types/Content.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public record Content {
3636
public List<Part> ? Parts { get; set; }
3737

3838
/// <summary>
39-
/// Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for
40-
/// multi-turn conversations, otherwise can be left blank or unset.
39+
/// Optional. The producer of the content. Must be either 'user' or 'model'. If not set, the
40+
/// service will default to 'user'.
4141
/// </summary>
4242
[JsonPropertyName("role")]
4343
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]

Google.GenAI/types/EmbedContentBatch.cs

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,118 @@ public EmbedContentConfig
4444
get; set;
4545
}
4646

47+
/// <summary>
48+
/// Output only. Stats about the batch.
49+
/// </summary>
50+
[JsonPropertyName("batchStats")]
51+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
52+
public EmbedContentBatchStats
53+
? BatchStats {
54+
get; set;
55+
}
56+
57+
/// <summary>
58+
/// Output only. The time at which the batch was created.
59+
/// </summary>
60+
[JsonPropertyName("createTime")]
61+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
62+
public DateTime
63+
? CreateTime {
64+
get; set;
65+
}
66+
67+
/// <summary>
68+
/// The user-defined name of this batch.
69+
/// </summary>
70+
[JsonPropertyName("displayName")]
71+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
72+
public string
73+
? DisplayName {
74+
get; set;
75+
}
76+
77+
/// <summary>
78+
/// Output only. The time at which the batch processing completed.
79+
/// </summary>
80+
[JsonPropertyName("endTime")]
81+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
82+
public DateTime
83+
? EndTime {
84+
get; set;
85+
}
86+
87+
/// <summary>
88+
/// Input configuration of the instances on which batch processing are performed.
89+
/// </summary>
90+
[JsonPropertyName("inputConfig")]
91+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
92+
public InputEmbedContentConfig
93+
? InputConfig {
94+
get; set;
95+
}
96+
97+
/// <summary>
98+
/// The name of the `Model` to use for generating the completion. Format: `models/{model}`.
99+
/// </summary>
100+
[JsonPropertyName("model")]
101+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
102+
public string
103+
? Model {
104+
get; set;
105+
}
106+
107+
/// <summary>
108+
/// Output only. Identifier. Resource name of the batch. Format: `batches/{batch_id}`.
109+
/// </summary>
110+
[JsonPropertyName("name")]
111+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
112+
public string
113+
? Name {
114+
get; set;
115+
}
116+
117+
/// <summary>
118+
/// Output only. The output of the batch request.
119+
/// </summary>
120+
[JsonPropertyName("output")]
121+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
122+
public EmbedContentBatchOutput
123+
? Output {
124+
get; set;
125+
}
126+
127+
/// <summary>
128+
/// Optional. The priority of the batch. Batches with a higher priority value will be processed
129+
/// before batches with a lower priority value. Negative values are allowed. Default is 0.
130+
/// </summary>
131+
[JsonPropertyName("priority")]
132+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
133+
[JsonConverter(typeof(StringToNullableLongConverter))]
134+
public long
135+
? Priority {
136+
get; set;
137+
}
138+
139+
/// <summary>
140+
/// Output only. The state of the batch.
141+
/// </summary>
142+
[JsonPropertyName("state")]
143+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
144+
public BatchState
145+
? State {
146+
get; set;
147+
}
148+
149+
/// <summary>
150+
/// Output only. The time at which the batch was last updated.
151+
/// </summary>
152+
[JsonPropertyName("updateTime")]
153+
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
154+
public DateTime
155+
? UpdateTime {
156+
get; set;
157+
}
158+
47159
/// <summary>
48160
/// Deserializes a JSON string to a EmbedContentBatch object.
49161
/// </summary>

0 commit comments

Comments
 (0)