google-genai 1.46.0__py3-none-any.whl → 1.47.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
google/genai/types.py CHANGED
@@ -118,7 +118,7 @@ MetricSubclass = typing.TypeVar('MetricSubclass', bound='Metric')
118
118
 
119
119
 
120
120
  class Outcome(_common.CaseInSensitiveEnum):
121
- """Required. Outcome of the code execution."""
121
+ """Outcome of the code execution."""
122
122
 
123
123
  OUTCOME_UNSPECIFIED = 'OUTCOME_UNSPECIFIED'
124
124
  """Unspecified status. This value should not be used."""
@@ -131,7 +131,7 @@ class Outcome(_common.CaseInSensitiveEnum):
131
131
 
132
132
 
133
133
  class Language(_common.CaseInSensitiveEnum):
134
- """Required. Programming language of the `code`."""
134
+ """Programming language of the `code`."""
135
135
 
136
136
  LANGUAGE_UNSPECIFIED = 'LANGUAGE_UNSPECIFIED'
137
137
  """Unspecified language. This value should not be used."""
@@ -153,7 +153,7 @@ class FunctionResponseScheduling(_common.CaseInSensitiveEnum):
153
153
 
154
154
 
155
155
  class Type(_common.CaseInSensitiveEnum):
156
- """Optional. The type of the data."""
156
+ """The type of the data."""
157
157
 
158
158
  TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED'
159
159
  """Not specified, should not be used."""
@@ -173,8 +173,49 @@ class Type(_common.CaseInSensitiveEnum):
173
173
  """Null type"""
174
174
 
175
175
 
176
+ class Mode(_common.CaseInSensitiveEnum):
177
+ """The mode of the predictor to be used in dynamic retrieval."""
178
+
179
+ MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'
180
+ """Always trigger retrieval."""
181
+ MODE_DYNAMIC = 'MODE_DYNAMIC'
182
+ """Run retrieval only when system decides it is necessary."""
183
+
184
+
185
+ class AuthType(_common.CaseInSensitiveEnum):
186
+ """Type of auth scheme. This enum is not supported in Gemini API."""
187
+
188
+ AUTH_TYPE_UNSPECIFIED = 'AUTH_TYPE_UNSPECIFIED'
189
+ NO_AUTH = 'NO_AUTH'
190
+ """No Auth."""
191
+ API_KEY_AUTH = 'API_KEY_AUTH'
192
+ """API Key Auth."""
193
+ HTTP_BASIC_AUTH = 'HTTP_BASIC_AUTH'
194
+ """HTTP Basic Auth."""
195
+ GOOGLE_SERVICE_ACCOUNT_AUTH = 'GOOGLE_SERVICE_ACCOUNT_AUTH'
196
+ """Google Service Account Auth."""
197
+ OAUTH = 'OAUTH'
198
+ """OAuth auth."""
199
+ OIDC_AUTH = 'OIDC_AUTH'
200
+ """OpenID Connect (OIDC) Auth."""
201
+
202
+
203
+ class ApiSpec(_common.CaseInSensitiveEnum):
204
+ """The API spec that the external API implements.
205
+
206
+ This enum is not supported in Gemini API.
207
+ """
208
+
209
+ API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
210
+ """Unspecified API spec. This value should not be used."""
211
+ SIMPLE_SEARCH = 'SIMPLE_SEARCH'
212
+ """Simple search API spec."""
213
+ ELASTIC_SEARCH = 'ELASTIC_SEARCH'
214
+ """Elastic search API spec."""
215
+
216
+
176
217
  class HarmCategory(_common.CaseInSensitiveEnum):
177
- """Required. Harm category."""
218
+ """Harm category."""
178
219
 
179
220
  HARM_CATEGORY_UNSPECIFIED = 'HARM_CATEGORY_UNSPECIFIED'
180
221
  """The harm category is unspecified."""
@@ -189,26 +230,26 @@ class HarmCategory(_common.CaseInSensitiveEnum):
189
230
  HARM_CATEGORY_CIVIC_INTEGRITY = 'HARM_CATEGORY_CIVIC_INTEGRITY'
190
231
  """Deprecated: Election filter is not longer supported. The harm category is civic integrity."""
191
232
  HARM_CATEGORY_IMAGE_HATE = 'HARM_CATEGORY_IMAGE_HATE'
192
- """The harm category is image hate."""
233
+ """The harm category is image hate. This enum value is not supported in Gemini API."""
193
234
  HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT = (
194
235
  'HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT'
195
236
  )
196
- """The harm category is image dangerous content."""
237
+ """The harm category is image dangerous content. This enum value is not supported in Gemini API."""
197
238
  HARM_CATEGORY_IMAGE_HARASSMENT = 'HARM_CATEGORY_IMAGE_HARASSMENT'
198
- """The harm category is image harassment."""
239
+ """The harm category is image harassment. This enum value is not supported in Gemini API."""
199
240
  HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = (
200
241
  'HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT'
201
242
  )
202
- """The harm category is image sexually explicit content."""
243
+ """The harm category is image sexually explicit content. This enum value is not supported in Gemini API."""
203
244
  HARM_CATEGORY_JAILBREAK = 'HARM_CATEGORY_JAILBREAK'
204
- """The harm category is for jailbreak prompts."""
245
+ """The harm category is for jailbreak prompts. This enum value is not supported in Gemini API."""
205
246
 
206
247
 
207
248
  class HarmBlockMethod(_common.CaseInSensitiveEnum):
208
- """Optional.
249
+ """Specify if the threshold is used for probability or severity score.
209
250
 
210
- Specify if the threshold is used for probability or severity score. If not
211
- specified, the threshold is used for probability score.
251
+ If not specified, the threshold is used for probability score. This enum is
252
+ not supported in Gemini API.
212
253
  """
213
254
 
214
255
  HARM_BLOCK_METHOD_UNSPECIFIED = 'HARM_BLOCK_METHOD_UNSPECIFIED'
@@ -220,7 +261,7 @@ class HarmBlockMethod(_common.CaseInSensitiveEnum):
220
261
 
221
262
 
222
263
  class HarmBlockThreshold(_common.CaseInSensitiveEnum):
223
- """Required. The harm block threshold."""
264
+ """The harm block threshold."""
224
265
 
225
266
  HARM_BLOCK_THRESHOLD_UNSPECIFIED = 'HARM_BLOCK_THRESHOLD_UNSPECIFIED'
226
267
  """Unspecified harm block threshold."""
@@ -236,59 +277,6 @@ class HarmBlockThreshold(_common.CaseInSensitiveEnum):
236
277
  """Turn off the safety filter."""
237
278
 
238
279
 
239
- class Mode(_common.CaseInSensitiveEnum):
240
- """The mode of the predictor to be used in dynamic retrieval."""
241
-
242
- MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'
243
- """Always trigger retrieval."""
244
- MODE_DYNAMIC = 'MODE_DYNAMIC'
245
- """Run retrieval only when system decides it is necessary."""
246
-
247
-
248
- class AuthType(_common.CaseInSensitiveEnum):
249
- """Type of auth scheme."""
250
-
251
- AUTH_TYPE_UNSPECIFIED = 'AUTH_TYPE_UNSPECIFIED'
252
- NO_AUTH = 'NO_AUTH'
253
- """No Auth."""
254
- API_KEY_AUTH = 'API_KEY_AUTH'
255
- """API Key Auth."""
256
- HTTP_BASIC_AUTH = 'HTTP_BASIC_AUTH'
257
- """HTTP Basic Auth."""
258
- GOOGLE_SERVICE_ACCOUNT_AUTH = 'GOOGLE_SERVICE_ACCOUNT_AUTH'
259
- """Google Service Account Auth."""
260
- OAUTH = 'OAUTH'
261
- """OAuth auth."""
262
- OIDC_AUTH = 'OIDC_AUTH'
263
- """OpenID Connect (OIDC) Auth."""
264
-
265
-
266
- class ApiSpec(_common.CaseInSensitiveEnum):
267
- """The API spec that the external API implements."""
268
-
269
- API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
270
- """Unspecified API spec. This value should not be used."""
271
- SIMPLE_SEARCH = 'SIMPLE_SEARCH'
272
- """Simple search API spec."""
273
- ELASTIC_SEARCH = 'ELASTIC_SEARCH'
274
- """Elastic search API spec."""
275
-
276
-
277
- class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
278
- """Status of the url retrieval."""
279
-
280
- URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
281
- """Default value. This value is unused"""
282
- URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
283
- """Url retrieval is successful."""
284
- URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
285
- """Url retrieval is failed due to error."""
286
- URL_RETRIEVAL_STATUS_PAYWALL = 'URL_RETRIEVAL_STATUS_PAYWALL'
287
- """Url retrieval is failed because the content is behind paywall."""
288
- URL_RETRIEVAL_STATUS_UNSAFE = 'URL_RETRIEVAL_STATUS_UNSAFE'
289
- """Url retrieval is failed because the content is unsafe."""
290
-
291
-
292
280
  class FinishReason(_common.CaseInSensitiveEnum):
293
281
  """Output only. The reason why the model stopped generating tokens.
294
282
 
@@ -343,7 +331,10 @@ class HarmProbability(_common.CaseInSensitiveEnum):
343
331
 
344
332
 
345
333
  class HarmSeverity(_common.CaseInSensitiveEnum):
346
- """Output only. Harm severity levels in the content."""
334
+ """Output only.
335
+
336
+ Harm severity levels in the content. This enum is not supported in Gemini API.
337
+ """
347
338
 
348
339
  HARM_SEVERITY_UNSPECIFIED = 'HARM_SEVERITY_UNSPECIFIED'
349
340
  """Harm severity unspecified."""
@@ -357,6 +348,21 @@ class HarmSeverity(_common.CaseInSensitiveEnum):
357
348
  """High level of harm severity."""
358
349
 
359
350
 
351
+ class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
352
+ """Status of the url retrieval."""
353
+
354
+ URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
355
+ """Default value. This value is unused."""
356
+ URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
357
+ """Url retrieval is successful."""
358
+ URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
359
+ """Url retrieval is failed due to error."""
360
+ URL_RETRIEVAL_STATUS_PAYWALL = 'URL_RETRIEVAL_STATUS_PAYWALL'
361
+ """Url retrieval is failed because the content is behind paywall. This enum value is not supported in Vertex AI."""
362
+ URL_RETRIEVAL_STATUS_UNSAFE = 'URL_RETRIEVAL_STATUS_UNSAFE'
363
+ """Url retrieval is failed because the content is unsafe. This enum value is not supported in Vertex AI."""
364
+
365
+
360
366
  class BlockedReason(_common.CaseInSensitiveEnum):
361
367
  """Output only. The reason why the prompt was blocked."""
362
368
 
@@ -373,16 +379,16 @@ class BlockedReason(_common.CaseInSensitiveEnum):
373
379
  IMAGE_SAFETY = 'IMAGE_SAFETY'
374
380
  """The prompt was blocked because it contains content that is unsafe for image generation."""
375
381
  MODEL_ARMOR = 'MODEL_ARMOR'
376
- """The prompt was blocked by Model Armor."""
382
+ """The prompt was blocked by Model Armor. This enum value is not supported in Gemini API."""
377
383
  JAILBREAK = 'JAILBREAK'
378
- """The prompt was blocked as a jailbreak attempt."""
384
+ """The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API."""
379
385
 
380
386
 
381
387
  class TrafficType(_common.CaseInSensitiveEnum):
382
388
  """Output only.
383
389
 
384
390
  Traffic type. This shows whether a request consumes Pay-As-You-Go or
385
- Provisioned Throughput quota.
391
+ Provisioned Throughput quota. This enum is not supported in Gemini API.
386
392
  """
387
393
 
388
394
  TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'
@@ -419,6 +425,36 @@ class MediaResolution(_common.CaseInSensitiveEnum):
419
425
  """Media resolution set to high (zoomed reframing with 256 tokens)."""
420
426
 
421
427
 
428
+ class TuningMode(_common.CaseInSensitiveEnum):
429
+ """Tuning mode. This enum is not supported in Gemini API."""
430
+
431
+ TUNING_MODE_UNSPECIFIED = 'TUNING_MODE_UNSPECIFIED'
432
+ """Tuning mode is unspecified."""
433
+ TUNING_MODE_FULL = 'TUNING_MODE_FULL'
434
+ """Full fine-tuning mode."""
435
+ TUNING_MODE_PEFT_ADAPTER = 'TUNING_MODE_PEFT_ADAPTER'
436
+ """PEFT adapter tuning mode."""
437
+
438
+
439
+ class AdapterSize(_common.CaseInSensitiveEnum):
440
+ """Adapter size for tuning. This enum is not supported in Gemini API."""
441
+
442
+ ADAPTER_SIZE_UNSPECIFIED = 'ADAPTER_SIZE_UNSPECIFIED'
443
+ """Adapter size is unspecified."""
444
+ ADAPTER_SIZE_ONE = 'ADAPTER_SIZE_ONE'
445
+ """Adapter size 1."""
446
+ ADAPTER_SIZE_TWO = 'ADAPTER_SIZE_TWO'
447
+ """Adapter size 2."""
448
+ ADAPTER_SIZE_FOUR = 'ADAPTER_SIZE_FOUR'
449
+ """Adapter size 4."""
450
+ ADAPTER_SIZE_EIGHT = 'ADAPTER_SIZE_EIGHT'
451
+ """Adapter size 8."""
452
+ ADAPTER_SIZE_SIXTEEN = 'ADAPTER_SIZE_SIXTEEN'
453
+ """Adapter size 16."""
454
+ ADAPTER_SIZE_THIRTY_TWO = 'ADAPTER_SIZE_THIRTY_TWO'
455
+ """Adapter size 32."""
456
+
457
+
422
458
  class JobState(_common.CaseInSensitiveEnum):
423
459
  """Job state."""
424
460
 
@@ -448,38 +484,11 @@ class JobState(_common.CaseInSensitiveEnum):
448
484
  """The job is partially succeeded, some results may be missing due to errors."""
449
485
 
450
486
 
451
- class TuningMode(_common.CaseInSensitiveEnum):
452
- """Tuning mode."""
453
-
454
- TUNING_MODE_UNSPECIFIED = 'TUNING_MODE_UNSPECIFIED'
455
- """Tuning mode is unspecified."""
456
- TUNING_MODE_FULL = 'TUNING_MODE_FULL'
457
- """Full fine-tuning mode."""
458
- TUNING_MODE_PEFT_ADAPTER = 'TUNING_MODE_PEFT_ADAPTER'
459
- """PEFT adapter tuning mode."""
460
-
461
-
462
- class AdapterSize(_common.CaseInSensitiveEnum):
463
- """Optional. Adapter size for tuning."""
464
-
465
- ADAPTER_SIZE_UNSPECIFIED = 'ADAPTER_SIZE_UNSPECIFIED'
466
- """Adapter size is unspecified."""
467
- ADAPTER_SIZE_ONE = 'ADAPTER_SIZE_ONE'
468
- """Adapter size 1."""
469
- ADAPTER_SIZE_TWO = 'ADAPTER_SIZE_TWO'
470
- """Adapter size 2."""
471
- ADAPTER_SIZE_FOUR = 'ADAPTER_SIZE_FOUR'
472
- """Adapter size 4."""
473
- ADAPTER_SIZE_EIGHT = 'ADAPTER_SIZE_EIGHT'
474
- """Adapter size 8."""
475
- ADAPTER_SIZE_SIXTEEN = 'ADAPTER_SIZE_SIXTEEN'
476
- """Adapter size 16."""
477
- ADAPTER_SIZE_THIRTY_TWO = 'ADAPTER_SIZE_THIRTY_TWO'
478
- """Adapter size 32."""
479
-
480
-
481
487
  class TuningTask(_common.CaseInSensitiveEnum):
482
- """Optional. The tuning task. Either I2V or T2V."""
488
+ """The tuning task.
489
+
490
+ Either I2V or T2V. This enum is not supported in Gemini API.
491
+ """
483
492
 
484
493
  TUNING_TASK_UNSPECIFIED = 'TUNING_TASK_UNSPECIFIED'
485
494
  """Default value. This value is unused."""
@@ -695,6 +704,15 @@ class VideoCompressionQuality(_common.CaseInSensitiveEnum):
695
704
  with a larger file size."""
696
705
 
697
706
 
707
+ class TuningMethod(_common.CaseInSensitiveEnum):
708
+ """Enum representing the tuning method."""
709
+
710
+ SUPERVISED_FINE_TUNING = 'SUPERVISED_FINE_TUNING'
711
+ """Supervised fine tuning."""
712
+ PREFERENCE_TUNING = 'PREFERENCE_TUNING'
713
+ """Preference optimization tuning."""
714
+
715
+
698
716
  class FileState(_common.CaseInSensitiveEnum):
699
717
  """State for the lifecycle of a File."""
700
718
 
@@ -850,182 +868,72 @@ class LiveMusicPlaybackControl(_common.CaseInSensitiveEnum):
850
868
  Retains the current prompts and config."""
851
869
 
852
870
 
853
- class VideoMetadata(_common.BaseModel):
854
- """Describes how the video in the Part should be used by the model."""
871
+ class FunctionCall(_common.BaseModel):
872
+ """A function call."""
855
873
 
856
- fps: Optional[float] = Field(
874
+ id: Optional[str] = Field(
857
875
  default=None,
858
- description="""The frame rate of the video sent to the model. If not specified, the
859
- default value will be 1.0. The fps range is (0.0, 24.0].""",
876
+ description="""The unique id of the function call. If populated, the client to execute the
877
+ `function_call` and return the response with the matching `id`.""",
860
878
  )
861
- end_offset: Optional[str] = Field(
862
- default=None, description="""Optional. The end offset of the video."""
879
+ args: Optional[dict[str, Any]] = Field(
880
+ default=None,
881
+ description="""Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.""",
863
882
  )
864
- start_offset: Optional[str] = Field(
865
- default=None, description="""Optional. The start offset of the video."""
883
+ name: Optional[str] = Field(
884
+ default=None,
885
+ description="""Required. The name of the function to call. Matches [FunctionDeclaration.name].""",
866
886
  )
867
887
 
868
888
 
869
- class VideoMetadataDict(TypedDict, total=False):
870
- """Describes how the video in the Part should be used by the model."""
889
+ class FunctionCallDict(TypedDict, total=False):
890
+ """A function call."""
871
891
 
872
- fps: Optional[float]
873
- """The frame rate of the video sent to the model. If not specified, the
874
- default value will be 1.0. The fps range is (0.0, 24.0]."""
892
+ id: Optional[str]
893
+ """The unique id of the function call. If populated, the client to execute the
894
+ `function_call` and return the response with the matching `id`."""
875
895
 
876
- end_offset: Optional[str]
877
- """Optional. The end offset of the video."""
896
+ args: Optional[dict[str, Any]]
897
+ """Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details."""
878
898
 
879
- start_offset: Optional[str]
880
- """Optional. The start offset of the video."""
899
+ name: Optional[str]
900
+ """Required. The name of the function to call. Matches [FunctionDeclaration.name]."""
881
901
 
882
902
 
883
- VideoMetadataOrDict = Union[VideoMetadata, VideoMetadataDict]
903
+ FunctionCallOrDict = Union[FunctionCall, FunctionCallDict]
884
904
 
885
905
 
886
- class Blob(_common.BaseModel):
887
- """Content blob."""
906
+ class CodeExecutionResult(_common.BaseModel):
907
+ """Result of executing the [ExecutableCode].
888
908
 
889
- display_name: Optional[str] = Field(
890
- default=None,
891
- description="""Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.""",
892
- )
893
- data: Optional[bytes] = Field(
894
- default=None, description="""Required. Raw bytes."""
909
+ Only generated when using the [CodeExecution] tool, and always follows a
910
+ `part` containing the [ExecutableCode].
911
+ """
912
+
913
+ outcome: Optional[Outcome] = Field(
914
+ default=None, description="""Required. Outcome of the code execution."""
895
915
  )
896
- mime_type: Optional[str] = Field(
916
+ output: Optional[str] = Field(
897
917
  default=None,
898
- description="""Required. The IANA standard MIME type of the source data.""",
918
+ description="""Optional. Contains stdout when code execution is successful, stderr or other description otherwise.""",
899
919
  )
900
920
 
901
- def as_image(self) -> Optional['Image']:
902
- """Returns the Blob as a Image, or None if the Blob is not an image."""
903
- if (
904
- not self.data
905
- or not self.mime_type
906
- or not self.mime_type.startswith('image/')
907
- ):
908
- return None
909
- return Image(
910
- image_bytes=self.data,
911
- mime_type=self.mime_type,
912
- )
913
921
 
922
+ class CodeExecutionResultDict(TypedDict, total=False):
923
+ """Result of executing the [ExecutableCode].
914
924
 
915
- class BlobDict(TypedDict, total=False):
916
- """Content blob."""
925
+ Only generated when using the [CodeExecution] tool, and always follows a
926
+ `part` containing the [ExecutableCode].
927
+ """
917
928
 
918
- display_name: Optional[str]
919
- """Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls."""
929
+ outcome: Optional[Outcome]
930
+ """Required. Outcome of the code execution."""
920
931
 
921
- data: Optional[bytes]
922
- """Required. Raw bytes."""
932
+ output: Optional[str]
933
+ """Optional. Contains stdout when code execution is successful, stderr or other description otherwise."""
923
934
 
924
- mime_type: Optional[str]
925
- """Required. The IANA standard MIME type of the source data."""
926
935
 
927
-
928
- BlobOrDict = Union[Blob, BlobDict]
929
-
930
-
931
- class FileData(_common.BaseModel):
932
- """URI based data."""
933
-
934
- display_name: Optional[str] = Field(
935
- default=None,
936
- description="""Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. It is not currently used in the Gemini GenerateContent calls.""",
937
- )
938
- file_uri: Optional[str] = Field(
939
- default=None, description="""Required. URI."""
940
- )
941
- mime_type: Optional[str] = Field(
942
- default=None,
943
- description="""Required. The IANA standard MIME type of the source data.""",
944
- )
945
-
946
-
947
- class FileDataDict(TypedDict, total=False):
948
- """URI based data."""
949
-
950
- display_name: Optional[str]
951
- """Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. It is not currently used in the Gemini GenerateContent calls."""
952
-
953
- file_uri: Optional[str]
954
- """Required. URI."""
955
-
956
- mime_type: Optional[str]
957
- """Required. The IANA standard MIME type of the source data."""
958
-
959
-
960
- FileDataOrDict = Union[FileData, FileDataDict]
961
-
962
-
963
- class FunctionCall(_common.BaseModel):
964
- """A function call."""
965
-
966
- id: Optional[str] = Field(
967
- default=None,
968
- description="""The unique id of the function call. If populated, the client to execute the
969
- `function_call` and return the response with the matching `id`.""",
970
- )
971
- args: Optional[dict[str, Any]] = Field(
972
- default=None,
973
- description="""Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.""",
974
- )
975
- name: Optional[str] = Field(
976
- default=None,
977
- description="""Required. The name of the function to call. Matches [FunctionDeclaration.name].""",
978
- )
979
-
980
-
981
- class FunctionCallDict(TypedDict, total=False):
982
- """A function call."""
983
-
984
- id: Optional[str]
985
- """The unique id of the function call. If populated, the client to execute the
986
- `function_call` and return the response with the matching `id`."""
987
-
988
- args: Optional[dict[str, Any]]
989
- """Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details."""
990
-
991
- name: Optional[str]
992
- """Required. The name of the function to call. Matches [FunctionDeclaration.name]."""
993
-
994
-
995
- FunctionCallOrDict = Union[FunctionCall, FunctionCallDict]
996
-
997
-
998
- class CodeExecutionResult(_common.BaseModel):
999
- """Result of executing the [ExecutableCode].
1000
-
1001
- Only generated when using the [CodeExecution] tool, and always follows a
1002
- `part` containing the [ExecutableCode].
1003
- """
1004
-
1005
- outcome: Optional[Outcome] = Field(
1006
- default=None, description="""Required. Outcome of the code execution."""
1007
- )
1008
- output: Optional[str] = Field(
1009
- default=None,
1010
- description="""Optional. Contains stdout when code execution is successful, stderr or other description otherwise.""",
1011
- )
1012
-
1013
-
1014
- class CodeExecutionResultDict(TypedDict, total=False):
1015
- """Result of executing the [ExecutableCode].
1016
-
1017
- Only generated when using the [CodeExecution] tool, and always follows a
1018
- `part` containing the [ExecutableCode].
1019
- """
1020
-
1021
- outcome: Optional[Outcome]
1022
- """Required. Outcome of the code execution."""
1023
-
1024
- output: Optional[str]
1025
- """Optional. Contains stdout when code execution is successful, stderr or other description otherwise."""
1026
-
1027
-
1028
- CodeExecutionResultOrDict = Union[CodeExecutionResult, CodeExecutionResultDict]
936
+ CodeExecutionResultOrDict = Union[CodeExecutionResult, CodeExecutionResultDict]
1029
937
 
1030
938
 
1031
939
  class ExecutableCode(_common.BaseModel):
@@ -1063,6 +971,38 @@ class ExecutableCodeDict(TypedDict, total=False):
1063
971
  ExecutableCodeOrDict = Union[ExecutableCode, ExecutableCodeDict]
1064
972
 
1065
973
 
974
+ class FileData(_common.BaseModel):
975
+ """URI based data."""
976
+
977
+ display_name: Optional[str] = Field(
978
+ default=None,
979
+ description="""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.""",
980
+ )
981
+ file_uri: Optional[str] = Field(
982
+ default=None, description="""Required. URI."""
983
+ )
984
+ mime_type: Optional[str] = Field(
985
+ default=None,
986
+ description="""Required. The IANA standard MIME type of the source data.""",
987
+ )
988
+
989
+
990
+ class FileDataDict(TypedDict, total=False):
991
+ """URI based data."""
992
+
993
+ display_name: Optional[str]
994
+ """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."""
995
+
996
+ file_uri: Optional[str]
997
+ """Required. URI."""
998
+
999
+ mime_type: Optional[str]
1000
+ """Required. The IANA standard MIME type of the source data."""
1001
+
1002
+
1003
+ FileDataOrDict = Union[FileData, FileDataDict]
1004
+
1005
+
1066
1006
  class FunctionResponseBlob(_common.BaseModel):
1067
1007
  """Raw media bytes for function response.
1068
1008
 
@@ -1274,31 +1214,90 @@ class FunctionResponseDict(TypedDict, total=False):
1274
1214
  FunctionResponseOrDict = Union[FunctionResponse, FunctionResponseDict]
1275
1215
 
1276
1216
 
1277
- class Part(_common.BaseModel):
1278
- """A datatype containing media content.
1279
-
1280
- Exactly one field within a Part should be set, representing the specific type
1281
- of content being conveyed. Using multiple fields within the same `Part`
1282
- instance is considered invalid.
1283
- """
1217
+ class Blob(_common.BaseModel):
1218
+ """Content blob."""
1284
1219
 
1285
- video_metadata: Optional[VideoMetadata] = Field(
1286
- default=None, description="""Metadata for a given video."""
1220
+ data: Optional[bytes] = Field(
1221
+ default=None, description="""Required. Raw bytes."""
1287
1222
  )
1288
- thought: Optional[bool] = Field(
1223
+ display_name: Optional[str] = Field(
1289
1224
  default=None,
1290
- description="""Indicates if the part is thought from the model.""",
1225
+ description="""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.""",
1291
1226
  )
1292
- inline_data: Optional[Blob] = Field(
1293
- default=None, description="""Optional. Inlined bytes data."""
1227
+ mime_type: Optional[str] = Field(
1228
+ default=None,
1229
+ description="""Required. The IANA standard MIME type of the source data.""",
1294
1230
  )
1295
- file_data: Optional[FileData] = Field(
1296
- default=None, description="""Optional. URI based data."""
1231
+
1232
+ def as_image(self) -> Optional['Image']:
1233
+ """Returns the Blob as a Image, or None if the Blob is not an image."""
1234
+ if (
1235
+ not self.data
1236
+ or not self.mime_type
1237
+ or not self.mime_type.startswith('image/')
1238
+ ):
1239
+ return None
1240
+ return Image(
1241
+ image_bytes=self.data,
1242
+ mime_type=self.mime_type,
1243
+ )
1244
+
1245
+
1246
+ class BlobDict(TypedDict, total=False):
1247
+ """Content blob."""
1248
+
1249
+ data: Optional[bytes]
1250
+ """Required. Raw bytes."""
1251
+
1252
+ display_name: Optional[str]
1253
+ """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."""
1254
+
1255
+ mime_type: Optional[str]
1256
+ """Required. The IANA standard MIME type of the source data."""
1257
+
1258
+
1259
+ BlobOrDict = Union[Blob, BlobDict]
1260
+
1261
+
1262
+ class VideoMetadata(_common.BaseModel):
1263
+ """Metadata describes the input video content."""
1264
+
1265
+ end_offset: Optional[str] = Field(
1266
+ default=None, description="""Optional. The end offset of the video."""
1297
1267
  )
1298
- thought_signature: Optional[bytes] = Field(
1268
+ fps: Optional[float] = Field(
1299
1269
  default=None,
1300
- description="""An opaque signature for the thought so it can be reused in subsequent requests.""",
1270
+ description="""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].""",
1271
+ )
1272
+ start_offset: Optional[str] = Field(
1273
+ default=None, description="""Optional. The start offset of the video."""
1301
1274
  )
1275
+
1276
+
1277
+ class VideoMetadataDict(TypedDict, total=False):
1278
+ """Metadata describes the input video content."""
1279
+
1280
+ end_offset: Optional[str]
1281
+ """Optional. The end offset of the video."""
1282
+
1283
+ fps: Optional[float]
1284
+ """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]."""
1285
+
1286
+ start_offset: Optional[str]
1287
+ """Optional. The start offset of the video."""
1288
+
1289
+
1290
+ VideoMetadataOrDict = Union[VideoMetadata, VideoMetadataDict]
1291
+
1292
+
1293
+ class Part(_common.BaseModel):
1294
+ """A datatype containing media content.
1295
+
1296
+ Exactly one field within a Part should be set, representing the specific type
1297
+ of content being conveyed. Using multiple fields within the same `Part`
1298
+ instance is considered invalid.
1299
+ """
1300
+
1302
1301
  function_call: Optional[FunctionCall] = Field(
1303
1302
  default=None,
1304
1303
  description="""A predicted [FunctionCall] returned from the model that contains a string
@@ -1313,13 +1312,31 @@ class Part(_common.BaseModel):
1313
1312
  default=None,
1314
1313
  description="""Optional. Code generated by the model that is meant to be executed.""",
1315
1314
  )
1315
+ file_data: Optional[FileData] = Field(
1316
+ default=None, description="""Optional. URI based data."""
1317
+ )
1316
1318
  function_response: Optional[FunctionResponse] = Field(
1317
1319
  default=None,
1318
1320
  description="""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.""",
1319
1321
  )
1322
+ inline_data: Optional[Blob] = Field(
1323
+ default=None, description="""Optional. Inlined bytes data."""
1324
+ )
1320
1325
  text: Optional[str] = Field(
1321
1326
  default=None, description="""Optional. Text part (can be code)."""
1322
1327
  )
1328
+ thought: Optional[bool] = Field(
1329
+ default=None,
1330
+ description="""Optional. Indicates if the part is thought from the model.""",
1331
+ )
1332
+ thought_signature: Optional[bytes] = Field(
1333
+ default=None,
1334
+ description="""Optional. An opaque signature for the thought so it can be reused in subsequent requests.""",
1335
+ )
1336
+ video_metadata: Optional[VideoMetadata] = Field(
1337
+ default=None,
1338
+ description="""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.""",
1339
+ )
1323
1340
 
1324
1341
  def as_image(self) -> Optional['Image']:
1325
1342
  """Returns the part as a PIL Image, or None if the part is not an image."""
@@ -1398,21 +1415,6 @@ class PartDict(TypedDict, total=False):
1398
1415
  instance is considered invalid.
1399
1416
  """
1400
1417
 
1401
- video_metadata: Optional[VideoMetadataDict]
1402
- """Metadata for a given video."""
1403
-
1404
- thought: Optional[bool]
1405
- """Indicates if the part is thought from the model."""
1406
-
1407
- inline_data: Optional[BlobDict]
1408
- """Optional. Inlined bytes data."""
1409
-
1410
- file_data: Optional[FileDataDict]
1411
- """Optional. URI based data."""
1412
-
1413
- thought_signature: Optional[bytes]
1414
- """An opaque signature for the thought so it can be reused in subsequent requests."""
1415
-
1416
1418
  function_call: Optional[FunctionCallDict]
1417
1419
  """A predicted [FunctionCall] returned from the model that contains a string
1418
1420
  representing the [FunctionDeclaration.name] and a structured JSON object
@@ -1424,12 +1426,27 @@ class PartDict(TypedDict, total=False):
1424
1426
  executable_code: Optional[ExecutableCodeDict]
1425
1427
  """Optional. Code generated by the model that is meant to be executed."""
1426
1428
 
1429
+ file_data: Optional[FileDataDict]
1430
+ """Optional. URI based data."""
1431
+
1427
1432
  function_response: Optional[FunctionResponseDict]
1428
1433
  """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."""
1429
1434
 
1435
+ inline_data: Optional[BlobDict]
1436
+ """Optional. Inlined bytes data."""
1437
+
1430
1438
  text: Optional[str]
1431
1439
  """Optional. Text part (can be code)."""
1432
1440
 
1441
+ thought: Optional[bool]
1442
+ """Optional. Indicates if the part is thought from the model."""
1443
+
1444
+ thought_signature: Optional[bytes]
1445
+ """Optional. An opaque signature for the thought so it can be reused in subsequent requests."""
1446
+
1447
+ video_metadata: Optional[VideoMetadataDict]
1448
+ """Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."""
1449
+
1433
1450
 
1434
1451
  PartOrDict = Union[Part, PartDict]
1435
1452
 
@@ -1444,9 +1461,7 @@ class Content(_common.BaseModel):
1444
1461
  )
1445
1462
  role: Optional[str] = Field(
1446
1463
  default=None,
1447
- description="""Optional. The producer of the content. Must be either 'user' or
1448
- 'model'. Useful to set for multi-turn conversations, otherwise can be
1449
- empty. If role is not specified, SDK will determine the role.""",
1464
+ description="""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.""",
1450
1465
  )
1451
1466
 
1452
1467
 
@@ -1458,9 +1473,7 @@ class ContentDict(TypedDict, total=False):
1458
1473
  a different IANA MIME type."""
1459
1474
 
1460
1475
  role: Optional[str]
1461
- """Optional. The producer of the content. Must be either 'user' or
1462
- 'model'. Useful to set for multi-turn conversations, otherwise can be
1463
- empty. If role is not specified, SDK will determine the role."""
1476
+ """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."""
1464
1477
 
1465
1478
 
1466
1479
  ContentOrDict = Union[Content, ContentDict]
@@ -1472,27 +1485,28 @@ class HttpRetryOptions(_common.BaseModel):
1472
1485
  attempts: Optional[int] = Field(
1473
1486
  default=None,
1474
1487
  description="""Maximum number of attempts, including the original request.
1475
- If 0 or 1, it means no retries.""",
1488
+ If 0 or 1, it means no retries. If not specified, default to 5.""",
1476
1489
  )
1477
1490
  initial_delay: Optional[float] = Field(
1478
1491
  default=None,
1479
- description="""Initial delay before the first retry, in fractions of a second.""",
1492
+ description="""Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.""",
1480
1493
  )
1481
1494
  max_delay: Optional[float] = Field(
1482
1495
  default=None,
1483
- description="""Maximum delay between retries, in fractions of a second.""",
1496
+ description="""Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.""",
1484
1497
  )
1485
1498
  exp_base: Optional[float] = Field(
1486
1499
  default=None,
1487
- description="""Multiplier by which the delay increases after each attempt.""",
1500
+ description="""Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.""",
1488
1501
  )
1489
1502
  jitter: Optional[float] = Field(
1490
- default=None, description="""Randomness factor for the delay."""
1503
+ default=None,
1504
+ description="""Randomness factor for the delay. If not specified, default to 1.0.""",
1491
1505
  )
1492
1506
  http_status_codes: Optional[list[int]] = Field(
1493
1507
  default=None,
1494
1508
  description="""List of HTTP status codes that should trigger a retry.
1495
- If not specified, a default set of retryable codes may be used.""",
1509
+ If not specified, a default set of retryable codes (408, 429, and 5xx) may be used.""",
1496
1510
  )
1497
1511
 
1498
1512
 
@@ -1501,23 +1515,23 @@ class HttpRetryOptionsDict(TypedDict, total=False):
1501
1515
 
1502
1516
  attempts: Optional[int]
1503
1517
  """Maximum number of attempts, including the original request.
1504
- If 0 or 1, it means no retries."""
1518
+ If 0 or 1, it means no retries. If not specified, default to 5."""
1505
1519
 
1506
1520
  initial_delay: Optional[float]
1507
- """Initial delay before the first retry, in fractions of a second."""
1521
+ """Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second."""
1508
1522
 
1509
1523
  max_delay: Optional[float]
1510
- """Maximum delay between retries, in fractions of a second."""
1524
+ """Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds."""
1511
1525
 
1512
1526
  exp_base: Optional[float]
1513
- """Multiplier by which the delay increases after each attempt."""
1527
+ """Multiplier by which the delay increases after each attempt. If not specified, default to 2.0."""
1514
1528
 
1515
1529
  jitter: Optional[float]
1516
- """Randomness factor for the delay."""
1530
+ """Randomness factor for the delay. If not specified, default to 1.0."""
1517
1531
 
1518
1532
  http_status_codes: Optional[list[int]]
1519
1533
  """List of HTTP status codes that should trigger a retry.
1520
- If not specified, a default set of retryable codes may be used."""
1534
+ If not specified, a default set of retryable codes (408, 429, and 5xx) may be used."""
1521
1535
 
1522
1536
 
1523
1537
  HttpRetryOptionsOrDict = Union[HttpRetryOptions, HttpRetryOptionsDict]
@@ -2196,7 +2210,7 @@ class Schema(_common.BaseModel):
2196
2210
  for this_field_value in field_value
2197
2211
  ]
2198
2212
  setattr(schema, field_name, list_schema_field_value)
2199
- if not schema.type and not is_union_like_type:
2213
+ if not schema.type and not is_union_like_type and not schema.any_of:
2200
2214
  schema.type = Type('OBJECT')
2201
2215
  elif field_name in dict_schema_field_names:
2202
2216
  dict_schema_field_value: dict[str, 'Schema'] = {
@@ -2368,39 +2382,6 @@ ModelSelectionConfigOrDict = Union[
2368
2382
  ]
2369
2383
 
2370
2384
 
2371
- class SafetySetting(_common.BaseModel):
2372
- """Safety settings."""
2373
-
2374
- method: Optional[HarmBlockMethod] = Field(
2375
- default=None,
2376
- description="""Determines if the harm block method uses probability or probability
2377
- and severity scores.""",
2378
- )
2379
- category: Optional[HarmCategory] = Field(
2380
- default=None, description="""Required. Harm category."""
2381
- )
2382
- threshold: Optional[HarmBlockThreshold] = Field(
2383
- default=None, description="""Required. The harm block threshold."""
2384
- )
2385
-
2386
-
2387
- class SafetySettingDict(TypedDict, total=False):
2388
- """Safety settings."""
2389
-
2390
- method: Optional[HarmBlockMethod]
2391
- """Determines if the harm block method uses probability or probability
2392
- and severity scores."""
2393
-
2394
- category: Optional[HarmCategory]
2395
- """Required. Harm category."""
2396
-
2397
- threshold: Optional[HarmBlockThreshold]
2398
- """Required. The harm block threshold."""
2399
-
2400
-
2401
- SafetySettingOrDict = Union[SafetySetting, SafetySettingDict]
2402
-
2403
-
2404
2385
  class FunctionDeclaration(_common.BaseModel):
2405
2386
  """Defines a function that the model can generate JSON inputs for.
2406
2387
 
@@ -2661,72 +2642,6 @@ class FunctionDeclarationDict(TypedDict, total=False):
2661
2642
  FunctionDeclarationOrDict = Union[FunctionDeclaration, FunctionDeclarationDict]
2662
2643
 
2663
2644
 
2664
- class Interval(_common.BaseModel):
2665
- """Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
2666
-
2667
- The start time must be less than or equal to the end time.
2668
- When the start equals the end time, the interval is an empty interval.
2669
- (matches no time)
2670
- When both start and end are unspecified, the interval matches any time.
2671
- """
2672
-
2673
- start_time: Optional[datetime.datetime] = Field(
2674
- default=None, description="""The start time of the interval."""
2675
- )
2676
- end_time: Optional[datetime.datetime] = Field(
2677
- default=None, description="""The end time of the interval."""
2678
- )
2679
-
2680
-
2681
- class IntervalDict(TypedDict, total=False):
2682
- """Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
2683
-
2684
- The start time must be less than or equal to the end time.
2685
- When the start equals the end time, the interval is an empty interval.
2686
- (matches no time)
2687
- When both start and end are unspecified, the interval matches any time.
2688
- """
2689
-
2690
- start_time: Optional[datetime.datetime]
2691
- """The start time of the interval."""
2692
-
2693
- end_time: Optional[datetime.datetime]
2694
- """The end time of the interval."""
2695
-
2696
-
2697
- IntervalOrDict = Union[Interval, IntervalDict]
2698
-
2699
-
2700
- class GoogleSearch(_common.BaseModel):
2701
- """Tool to support Google Search in Model. Powered by Google."""
2702
-
2703
- time_range_filter: Optional[Interval] = Field(
2704
- default=None,
2705
- description="""Optional. Filter search results to a specific time range.
2706
- If customers set a start time, they must set an end time (and vice versa).
2707
- """,
2708
- )
2709
- exclude_domains: Optional[list[str]] = Field(
2710
- default=None,
2711
- description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"].""",
2712
- )
2713
-
2714
-
2715
- class GoogleSearchDict(TypedDict, total=False):
2716
- """Tool to support Google Search in Model. Powered by Google."""
2717
-
2718
- time_range_filter: Optional[IntervalDict]
2719
- """Optional. Filter search results to a specific time range.
2720
- If customers set a start time, they must set an end time (and vice versa).
2721
- """
2722
-
2723
- exclude_domains: Optional[list[str]]
2724
- """Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]."""
2725
-
2726
-
2727
- GoogleSearchOrDict = Union[GoogleSearch, GoogleSearchDict]
2728
-
2729
-
2730
2645
  class DynamicRetrievalConfig(_common.BaseModel):
2731
2646
  """Describes the options to customize dynamic retrieval."""
2732
2647
 
@@ -2776,25 +2691,6 @@ GoogleSearchRetrievalOrDict = Union[
2776
2691
  ]
2777
2692
 
2778
2693
 
2779
- class EnterpriseWebSearch(_common.BaseModel):
2780
- """Tool to search public web data, powered by Vertex AI Search and Sec4 compliance."""
2781
-
2782
- exclude_domains: Optional[list[str]] = Field(
2783
- default=None,
2784
- description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.""",
2785
- )
2786
-
2787
-
2788
- class EnterpriseWebSearchDict(TypedDict, total=False):
2789
- """Tool to search public web data, powered by Vertex AI Search and Sec4 compliance."""
2790
-
2791
- exclude_domains: Optional[list[str]]
2792
- """Optional. List of domains to be excluded from the search results. The default limit is 2000 domains."""
2793
-
2794
-
2795
- EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
2796
-
2797
-
2798
2694
  class ApiKeyConfig(_common.BaseModel):
2799
2695
  """Config for authentication with API key."""
2800
2696
 
@@ -2815,7 +2711,10 @@ ApiKeyConfigOrDict = Union[ApiKeyConfig, ApiKeyConfigDict]
2815
2711
 
2816
2712
 
2817
2713
  class AuthConfigGoogleServiceAccountConfig(_common.BaseModel):
2818
- """Config for Google Service Account Authentication."""
2714
+ """Config for Google Service Account Authentication.
2715
+
2716
+ This data type is not supported in Gemini API.
2717
+ """
2819
2718
 
2820
2719
  service_account: Optional[str] = Field(
2821
2720
  default=None,
@@ -2824,7 +2723,10 @@ class AuthConfigGoogleServiceAccountConfig(_common.BaseModel):
2824
2723
 
2825
2724
 
2826
2725
  class AuthConfigGoogleServiceAccountConfigDict(TypedDict, total=False):
2827
- """Config for Google Service Account Authentication."""
2726
+ """Config for Google Service Account Authentication.
2727
+
2728
+ This data type is not supported in Gemini API.
2729
+ """
2828
2730
 
2829
2731
  service_account: Optional[str]
2830
2732
  """Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension."""
@@ -2837,7 +2739,10 @@ AuthConfigGoogleServiceAccountConfigOrDict = Union[
2837
2739
 
2838
2740
 
2839
2741
  class AuthConfigHttpBasicAuthConfig(_common.BaseModel):
2840
- """Config for HTTP Basic Authentication."""
2742
+ """Config for HTTP Basic Authentication.
2743
+
2744
+ This data type is not supported in Gemini API.
2745
+ """
2841
2746
 
2842
2747
  credential_secret: Optional[str] = Field(
2843
2748
  default=None,
@@ -2846,7 +2751,10 @@ class AuthConfigHttpBasicAuthConfig(_common.BaseModel):
2846
2751
 
2847
2752
 
2848
2753
  class AuthConfigHttpBasicAuthConfigDict(TypedDict, total=False):
2849
- """Config for HTTP Basic Authentication."""
2754
+ """Config for HTTP Basic Authentication.
2755
+
2756
+ This data type is not supported in Gemini API.
2757
+ """
2850
2758
 
2851
2759
  credential_secret: Optional[str]
2852
2760
  """Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource."""
@@ -2858,7 +2766,7 @@ AuthConfigHttpBasicAuthConfigOrDict = Union[
2858
2766
 
2859
2767
 
2860
2768
  class AuthConfigOauthConfig(_common.BaseModel):
2861
- """Config for user oauth."""
2769
+ """Config for user oauth. This data type is not supported in Gemini API."""
2862
2770
 
2863
2771
  access_token: Optional[str] = Field(
2864
2772
  default=None,
@@ -2871,7 +2779,7 @@ class AuthConfigOauthConfig(_common.BaseModel):
2871
2779
 
2872
2780
 
2873
2781
  class AuthConfigOauthConfigDict(TypedDict, total=False):
2874
- """Config for user oauth."""
2782
+ """Config for user oauth. This data type is not supported in Gemini API."""
2875
2783
 
2876
2784
  access_token: Optional[str]
2877
2785
  """Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time."""
@@ -2886,7 +2794,10 @@ AuthConfigOauthConfigOrDict = Union[
2886
2794
 
2887
2795
 
2888
2796
  class AuthConfigOidcConfig(_common.BaseModel):
2889
- """Config for user OIDC auth."""
2797
+ """Config for user OIDC auth.
2798
+
2799
+ This data type is not supported in Gemini API.
2800
+ """
2890
2801
 
2891
2802
  id_token: Optional[str] = Field(
2892
2803
  default=None,
@@ -2899,7 +2810,10 @@ class AuthConfigOidcConfig(_common.BaseModel):
2899
2810
 
2900
2811
 
2901
2812
  class AuthConfigOidcConfigDict(TypedDict, total=False):
2902
- """Config for user OIDC auth."""
2813
+ """Config for user OIDC auth.
2814
+
2815
+ This data type is not supported in Gemini API.
2816
+ """
2903
2817
 
2904
2818
  id_token: Optional[str]
2905
2819
  """OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time."""
@@ -2991,21 +2905,6 @@ class GoogleMapsDict(TypedDict, total=False):
2991
2905
  GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
2992
2906
 
2993
2907
 
2994
- class UrlContext(_common.BaseModel):
2995
- """Tool to support URL context retrieval."""
2996
-
2997
- pass
2998
-
2999
-
3000
- class UrlContextDict(TypedDict, total=False):
3001
- """Tool to support URL context retrieval."""
3002
-
3003
- pass
3004
-
3005
-
3006
- UrlContextOrDict = Union[UrlContext, UrlContextDict]
3007
-
3008
-
3009
2908
  class ComputerUse(_common.BaseModel):
3010
2909
  """Tool to support computer use."""
3011
2910
 
@@ -3040,7 +2939,7 @@ ComputerUseOrDict = Union[ComputerUse, ComputerUseDict]
3040
2939
 
3041
2940
 
3042
2941
  class ApiAuthApiKeyConfig(_common.BaseModel):
3043
- """The API secret."""
2942
+ """The API secret. This data type is not supported in Gemini API."""
3044
2943
 
3045
2944
  api_key_secret_version: Optional[str] = Field(
3046
2945
  default=None,
@@ -3053,7 +2952,7 @@ class ApiAuthApiKeyConfig(_common.BaseModel):
3053
2952
 
3054
2953
 
3055
2954
  class ApiAuthApiKeyConfigDict(TypedDict, total=False):
3056
- """The API secret."""
2955
+ """The API secret. This data type is not supported in Gemini API."""
3057
2956
 
3058
2957
  api_key_secret_version: Optional[str]
3059
2958
  """Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
@@ -3069,7 +2968,7 @@ class ApiAuth(_common.BaseModel):
3069
2968
  """The generic reusable api auth config.
3070
2969
 
3071
2970
  Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
3072
- instead.
2971
+ instead. This data type is not supported in Gemini API.
3073
2972
  """
3074
2973
 
3075
2974
  api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
@@ -3081,7 +2980,7 @@ class ApiAuthDict(TypedDict, total=False):
3081
2980
  """The generic reusable api auth config.
3082
2981
 
3083
2982
  Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
3084
- instead.
2983
+ instead. This data type is not supported in Gemini API.
3085
2984
  """
3086
2985
 
3087
2986
  api_key_config: Optional[ApiAuthApiKeyConfigDict]
@@ -3092,7 +2991,10 @@ ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
3092
2991
 
3093
2992
 
3094
2993
  class ExternalApiElasticSearchParams(_common.BaseModel):
3095
- """The search parameters to use for the ELASTIC_SEARCH spec."""
2994
+ """The search parameters to use for the ELASTIC_SEARCH spec.
2995
+
2996
+ This data type is not supported in Gemini API.
2997
+ """
3096
2998
 
3097
2999
  index: Optional[str] = Field(
3098
3000
  default=None, description="""The ElasticSearch index to use."""
@@ -3107,7 +3009,10 @@ class ExternalApiElasticSearchParams(_common.BaseModel):
3107
3009
 
3108
3010
 
3109
3011
  class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
3110
- """The search parameters to use for the ELASTIC_SEARCH spec."""
3012
+ """The search parameters to use for the ELASTIC_SEARCH spec.
3013
+
3014
+ This data type is not supported in Gemini API.
3015
+ """
3111
3016
 
3112
3017
  index: Optional[str]
3113
3018
  """The ElasticSearch index to use."""
@@ -3125,13 +3030,19 @@ ExternalApiElasticSearchParamsOrDict = Union[
3125
3030
 
3126
3031
 
3127
3032
  class ExternalApiSimpleSearchParams(_common.BaseModel):
3128
- """The search parameters to use for SIMPLE_SEARCH spec."""
3033
+ """The search parameters to use for SIMPLE_SEARCH spec.
3034
+
3035
+ This data type is not supported in Gemini API.
3036
+ """
3129
3037
 
3130
3038
  pass
3131
3039
 
3132
3040
 
3133
3041
  class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
3134
- """The search parameters to use for SIMPLE_SEARCH spec."""
3042
+ """The search parameters to use for SIMPLE_SEARCH spec.
3043
+
3044
+ This data type is not supported in Gemini API.
3045
+ """
3135
3046
 
3136
3047
  pass
3137
3048
 
@@ -3145,7 +3056,7 @@ class ExternalApi(_common.BaseModel):
3145
3056
  """Retrieve from data source powered by external API for grounding.
3146
3057
 
3147
3058
  The external API is not owned by Google, but need to follow the pre-defined
3148
- API spec.
3059
+ API spec. This data type is not supported in Gemini API.
3149
3060
  """
3150
3061
 
3151
3062
  api_auth: Optional[ApiAuth] = Field(
@@ -3176,7 +3087,7 @@ class ExternalApiDict(TypedDict, total=False):
3176
3087
  """Retrieve from data source powered by external API for grounding.
3177
3088
 
3178
3089
  The external API is not owned by Google, but need to follow the pre-defined
3179
- API spec.
3090
+ API spec. This data type is not supported in Gemini API.
3180
3091
  """
3181
3092
 
3182
3093
  api_auth: Optional[ApiAuthDict]
@@ -3205,7 +3116,8 @@ class VertexAISearchDataStoreSpec(_common.BaseModel):
3205
3116
  """Define data stores within engine to filter on in a search call and configurations for those data stores.
3206
3117
 
3207
3118
  For more information, see
3208
- https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
3119
+ https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec.
3120
+ This data type is not supported in Gemini API.
3209
3121
  """
3210
3122
 
3211
3123
  data_store: Optional[str] = Field(
@@ -3222,7 +3134,8 @@ class VertexAISearchDataStoreSpecDict(TypedDict, total=False):
3222
3134
  """Define data stores within engine to filter on in a search call and configurations for those data stores.
3223
3135
 
3224
3136
  For more information, see
3225
- https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
3137
+ https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec.
3138
+ This data type is not supported in Gemini API.
3226
3139
  """
3227
3140
 
3228
3141
  data_store: Optional[str]
@@ -3241,7 +3154,8 @@ class VertexAISearch(_common.BaseModel):
3241
3154
  """Retrieve from Vertex AI Search datastore or engine for grounding.
3242
3155
 
3243
3156
  datastore and engine are mutually exclusive. See
3244
- https://cloud.google.com/products/agent-builder
3157
+ https://cloud.google.com/products/agent-builder. This data type is not
3158
+ supported in Gemini API.
3245
3159
  """
3246
3160
 
3247
3161
  data_store_specs: Optional[list[VertexAISearchDataStoreSpec]] = Field(
@@ -3270,7 +3184,8 @@ class VertexAISearchDict(TypedDict, total=False):
3270
3184
  """Retrieve from Vertex AI Search datastore or engine for grounding.
3271
3185
 
3272
3186
  datastore and engine are mutually exclusive. See
3273
- https://cloud.google.com/products/agent-builder
3187
+ https://cloud.google.com/products/agent-builder. This data type is not
3188
+ supported in Gemini API.
3274
3189
  """
3275
3190
 
3276
3191
  data_store_specs: Optional[list[VertexAISearchDataStoreSpecDict]]
@@ -3293,7 +3208,10 @@ VertexAISearchOrDict = Union[VertexAISearch, VertexAISearchDict]
3293
3208
 
3294
3209
 
3295
3210
  class VertexRagStoreRagResource(_common.BaseModel):
3296
- """The definition of the Rag resource."""
3211
+ """The definition of the Rag resource.
3212
+
3213
+ This data type is not supported in Gemini API.
3214
+ """
3297
3215
 
3298
3216
  rag_corpus: Optional[str] = Field(
3299
3217
  default=None,
@@ -3306,7 +3224,10 @@ class VertexRagStoreRagResource(_common.BaseModel):
3306
3224
 
3307
3225
 
3308
3226
  class VertexRagStoreRagResourceDict(TypedDict, total=False):
3309
- """The definition of the Rag resource."""
3227
+ """The definition of the Rag resource.
3228
+
3229
+ This data type is not supported in Gemini API.
3230
+ """
3310
3231
 
3311
3232
  rag_corpus: Optional[str]
3312
3233
  """Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`"""
@@ -3321,7 +3242,7 @@ VertexRagStoreRagResourceOrDict = Union[
3321
3242
 
3322
3243
 
3323
3244
  class RagRetrievalConfigFilter(_common.BaseModel):
3324
- """Config for filters."""
3245
+ """Config for filters. This data type is not supported in Gemini API."""
3325
3246
 
3326
3247
  metadata_filter: Optional[str] = Field(
3327
3248
  default=None, description="""Optional. String for metadata filtering."""
@@ -3337,7 +3258,7 @@ class RagRetrievalConfigFilter(_common.BaseModel):
3337
3258
 
3338
3259
 
3339
3260
  class RagRetrievalConfigFilterDict(TypedDict, total=False):
3340
- """Config for filters."""
3261
+ """Config for filters. This data type is not supported in Gemini API."""
3341
3262
 
3342
3263
  metadata_filter: Optional[str]
3343
3264
  """Optional. String for metadata filtering."""
@@ -3355,7 +3276,7 @@ RagRetrievalConfigFilterOrDict = Union[
3355
3276
 
3356
3277
 
3357
3278
  class RagRetrievalConfigHybridSearch(_common.BaseModel):
3358
- """Config for Hybrid Search."""
3279
+ """Config for Hybrid Search. This data type is not supported in Gemini API."""
3359
3280
 
3360
3281
  alpha: Optional[float] = Field(
3361
3282
  default=None,
@@ -3364,7 +3285,7 @@ class RagRetrievalConfigHybridSearch(_common.BaseModel):
3364
3285
 
3365
3286
 
3366
3287
  class RagRetrievalConfigHybridSearchDict(TypedDict, total=False):
3367
- """Config for Hybrid Search."""
3288
+ """Config for Hybrid Search. This data type is not supported in Gemini API."""
3368
3289
 
3369
3290
  alpha: Optional[float]
3370
3291
  """Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally."""
@@ -3376,7 +3297,7 @@ RagRetrievalConfigHybridSearchOrDict = Union[
3376
3297
 
3377
3298
 
3378
3299
  class RagRetrievalConfigRankingLlmRanker(_common.BaseModel):
3379
- """Config for LlmRanker."""
3300
+ """Config for LlmRanker. This data type is not supported in Gemini API."""
3380
3301
 
3381
3302
  model_name: Optional[str] = Field(
3382
3303
  default=None,
@@ -3385,7 +3306,7 @@ class RagRetrievalConfigRankingLlmRanker(_common.BaseModel):
3385
3306
 
3386
3307
 
3387
3308
  class RagRetrievalConfigRankingLlmRankerDict(TypedDict, total=False):
3388
- """Config for LlmRanker."""
3309
+ """Config for LlmRanker. This data type is not supported in Gemini API."""
3389
3310
 
3390
3311
  model_name: Optional[str]
3391
3312
  """Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models)."""
@@ -3397,7 +3318,7 @@ RagRetrievalConfigRankingLlmRankerOrDict = Union[
3397
3318
 
3398
3319
 
3399
3320
  class RagRetrievalConfigRankingRankService(_common.BaseModel):
3400
- """Config for Rank Service."""
3321
+ """Config for Rank Service. This data type is not supported in Gemini API."""
3401
3322
 
3402
3323
  model_name: Optional[str] = Field(
3403
3324
  default=None,
@@ -3406,7 +3327,7 @@ class RagRetrievalConfigRankingRankService(_common.BaseModel):
3406
3327
 
3407
3328
 
3408
3329
  class RagRetrievalConfigRankingRankServiceDict(TypedDict, total=False):
3409
- """Config for Rank Service."""
3330
+ """Config for Rank Service. This data type is not supported in Gemini API."""
3410
3331
 
3411
3332
  model_name: Optional[str]
3412
3333
  """Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`"""
@@ -3419,7 +3340,10 @@ RagRetrievalConfigRankingRankServiceOrDict = Union[
3419
3340
 
3420
3341
 
3421
3342
  class RagRetrievalConfigRanking(_common.BaseModel):
3422
- """Config for ranking and reranking."""
3343
+ """Config for ranking and reranking.
3344
+
3345
+ This data type is not supported in Gemini API.
3346
+ """
3423
3347
 
3424
3348
  llm_ranker: Optional[RagRetrievalConfigRankingLlmRanker] = Field(
3425
3349
  default=None, description="""Optional. Config for LlmRanker."""
@@ -3430,7 +3354,10 @@ class RagRetrievalConfigRanking(_common.BaseModel):
3430
3354
 
3431
3355
 
3432
3356
  class RagRetrievalConfigRankingDict(TypedDict, total=False):
3433
- """Config for ranking and reranking."""
3357
+ """Config for ranking and reranking.
3358
+
3359
+ This data type is not supported in Gemini API.
3360
+ """
3434
3361
 
3435
3362
  llm_ranker: Optional[RagRetrievalConfigRankingLlmRankerDict]
3436
3363
  """Optional. Config for LlmRanker."""
@@ -3445,7 +3372,10 @@ RagRetrievalConfigRankingOrDict = Union[
3445
3372
 
3446
3373
 
3447
3374
  class RagRetrievalConfig(_common.BaseModel):
3448
- """Specifies the context retrieval config."""
3375
+ """Specifies the context retrieval config.
3376
+
3377
+ This data type is not supported in Gemini API.
3378
+ """
3449
3379
 
3450
3380
  filter: Optional[RagRetrievalConfigFilter] = Field(
3451
3381
  default=None, description="""Optional. Config for filters."""
@@ -3464,7 +3394,10 @@ class RagRetrievalConfig(_common.BaseModel):
3464
3394
 
3465
3395
 
3466
3396
  class RagRetrievalConfigDict(TypedDict, total=False):
3467
- """Specifies the context retrieval config."""
3397
+ """Specifies the context retrieval config.
3398
+
3399
+ This data type is not supported in Gemini API.
3400
+ """
3468
3401
 
3469
3402
  filter: Optional[RagRetrievalConfigFilterDict]
3470
3403
  """Optional. Config for filters."""
@@ -3483,7 +3416,10 @@ RagRetrievalConfigOrDict = Union[RagRetrievalConfig, RagRetrievalConfigDict]
3483
3416
 
3484
3417
 
3485
3418
  class VertexRagStore(_common.BaseModel):
3486
- """Retrieve from Vertex RAG Store for grounding."""
3419
+ """Retrieve from Vertex RAG Store for grounding.
3420
+
3421
+ This data type is not supported in Gemini API.
3422
+ """
3487
3423
 
3488
3424
  rag_corpora: Optional[list[str]] = Field(
3489
3425
  default=None,
@@ -3512,7 +3448,10 @@ class VertexRagStore(_common.BaseModel):
3512
3448
 
3513
3449
 
3514
3450
  class VertexRagStoreDict(TypedDict, total=False):
3515
- """Retrieve from Vertex RAG Store for grounding."""
3451
+ """Retrieve from Vertex RAG Store for grounding.
3452
+
3453
+ This data type is not supported in Gemini API.
3454
+ """
3516
3455
 
3517
3456
  rag_corpora: Optional[list[str]]
3518
3457
  """Optional. Deprecated. Please use rag_resources instead."""
@@ -3537,7 +3476,10 @@ VertexRagStoreOrDict = Union[VertexRagStore, VertexRagStoreDict]
3537
3476
 
3538
3477
 
3539
3478
  class Retrieval(_common.BaseModel):
3540
- """Defines a retrieval tool that model can call to access external knowledge."""
3479
+ """Defines a retrieval tool that model can call to access external knowledge.
3480
+
3481
+ This data type is not supported in Gemini API.
3482
+ """
3541
3483
 
3542
3484
  disable_attribution: Optional[bool] = Field(
3543
3485
  default=None,
@@ -3558,7 +3500,10 @@ class Retrieval(_common.BaseModel):
3558
3500
 
3559
3501
 
3560
3502
  class RetrievalDict(TypedDict, total=False):
3561
- """Defines a retrieval tool that model can call to access external knowledge."""
3503
+ """Defines a retrieval tool that model can call to access external knowledge.
3504
+
3505
+ This data type is not supported in Gemini API.
3506
+ """
3562
3507
 
3563
3508
  disable_attribution: Optional[bool]
3564
3509
  """Optional. Deprecated. This option is no longer supported."""
@@ -3580,7 +3525,7 @@ class ToolCodeExecution(_common.BaseModel):
3580
3525
  """Tool that executes code generated by the model, and automatically returns the result to the model.
3581
3526
 
3582
3527
  See also [ExecutableCode]and [CodeExecutionResult] which are input and output
3583
- to this tool.
3528
+ to this tool. This data type is not supported in Gemini API.
3584
3529
  """
3585
3530
 
3586
3531
  pass
@@ -3590,7 +3535,7 @@ class ToolCodeExecutionDict(TypedDict, total=False):
3590
3535
  """Tool that executes code generated by the model, and automatically returns the result to the model.
3591
3536
 
3592
3537
  See also [ExecutableCode]and [CodeExecutionResult] which are input and output
3593
- to this tool.
3538
+ to this tool. This data type is not supported in Gemini API.
3594
3539
  """
3595
3540
 
3596
3541
  pass
@@ -3599,6 +3544,114 @@ class ToolCodeExecutionDict(TypedDict, total=False):
3599
3544
  ToolCodeExecutionOrDict = Union[ToolCodeExecution, ToolCodeExecutionDict]
3600
3545
 
3601
3546
 
3547
+ class EnterpriseWebSearch(_common.BaseModel):
3548
+ """Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.
3549
+
3550
+ This data type is not supported in Gemini API.
3551
+ """
3552
+
3553
+ exclude_domains: Optional[list[str]] = Field(
3554
+ default=None,
3555
+ description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.""",
3556
+ )
3557
+
3558
+
3559
+ class EnterpriseWebSearchDict(TypedDict, total=False):
3560
+ """Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.
3561
+
3562
+ This data type is not supported in Gemini API.
3563
+ """
3564
+
3565
+ exclude_domains: Optional[list[str]]
3566
+ """Optional. List of domains to be excluded from the search results. The default limit is 2000 domains."""
3567
+
3568
+
3569
+ EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
3570
+
3571
+
3572
+ class Interval(_common.BaseModel):
3573
+ """Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
3574
+
3575
+ The start must be less than or equal to the end. When the start equals the
3576
+ end, the interval is empty (matches no time). When both start and end are
3577
+ unspecified, the interval matches any time.
3578
+ """
3579
+
3580
+ end_time: Optional[datetime.datetime] = Field(
3581
+ default=None,
3582
+ description="""Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.""",
3583
+ )
3584
+ start_time: Optional[datetime.datetime] = Field(
3585
+ default=None,
3586
+ description="""Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.""",
3587
+ )
3588
+
3589
+
3590
+ class IntervalDict(TypedDict, total=False):
3591
+ """Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
3592
+
3593
+ The start must be less than or equal to the end. When the start equals the
3594
+ end, the interval is empty (matches no time). When both start and end are
3595
+ unspecified, the interval matches any time.
3596
+ """
3597
+
3598
+ end_time: Optional[datetime.datetime]
3599
+ """Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end."""
3600
+
3601
+ start_time: Optional[datetime.datetime]
3602
+ """Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start."""
3603
+
3604
+
3605
+ IntervalOrDict = Union[Interval, IntervalDict]
3606
+
3607
+
3608
+ class GoogleSearch(_common.BaseModel):
3609
+ """GoogleSearch tool type.
3610
+
3611
+ Tool to support Google Search in Model. Powered by Google.
3612
+ """
3613
+
3614
+ exclude_domains: Optional[list[str]] = Field(
3615
+ default=None,
3616
+ description="""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.""",
3617
+ )
3618
+ time_range_filter: Optional[Interval] = Field(
3619
+ default=None,
3620
+ description="""Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI.""",
3621
+ )
3622
+
3623
+
3624
+ class GoogleSearchDict(TypedDict, total=False):
3625
+ """GoogleSearch tool type.
3626
+
3627
+ Tool to support Google Search in Model. Powered by Google.
3628
+ """
3629
+
3630
+ exclude_domains: Optional[list[str]]
3631
+ """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."""
3632
+
3633
+ time_range_filter: Optional[IntervalDict]
3634
+ """Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI."""
3635
+
3636
+
3637
+ GoogleSearchOrDict = Union[GoogleSearch, GoogleSearchDict]
3638
+
3639
+
3640
+ class UrlContext(_common.BaseModel):
3641
+ """Tool to support URL context."""
3642
+
3643
+ pass
3644
+
3645
+
3646
+ class UrlContextDict(TypedDict, total=False):
3647
+ """Tool to support URL context."""
3648
+
3649
+ pass
3650
+
3651
+
3652
+ UrlContextOrDict = Union[UrlContext, UrlContextDict]
3653
+
3654
+
3602
3655
  class Tool(_common.BaseModel):
3603
3656
  """Tool details of a tool that the model may use to generate a response."""
3604
3657
 
@@ -3608,31 +3661,17 @@ class Tool(_common.BaseModel):
3608
3661
  )
3609
3662
  retrieval: Optional[Retrieval] = Field(
3610
3663
  default=None,
3611
- description="""Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.""",
3612
- )
3613
- google_search: Optional[GoogleSearch] = Field(
3614
- default=None,
3615
- description="""Optional. Google Search tool type. Specialized retrieval tool
3616
- that is powered by Google Search.""",
3664
+ description="""Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API.""",
3617
3665
  )
3618
3666
  google_search_retrieval: Optional[GoogleSearchRetrieval] = Field(
3619
3667
  default=None,
3620
3668
  description="""Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.""",
3621
3669
  )
3622
- enterprise_web_search: Optional[EnterpriseWebSearch] = Field(
3623
- default=None,
3624
- description="""Optional. Enterprise web search tool type. Specialized retrieval
3625
- tool that is powered by Vertex AI Search and Sec4 compliance.""",
3626
- )
3627
3670
  google_maps: Optional[GoogleMaps] = Field(
3628
3671
  default=None,
3629
3672
  description="""Optional. Google Maps tool type. Specialized retrieval tool
3630
3673
  that is powered by Google Maps.""",
3631
3674
  )
3632
- url_context: Optional[UrlContext] = Field(
3633
- default=None,
3634
- description="""Optional. Tool to support URL context retrieval.""",
3635
- )
3636
3675
  computer_use: Optional[ComputerUse] = Field(
3637
3676
  default=None,
3638
3677
  description="""Optional. Tool to support the model interacting directly with the
@@ -3643,6 +3682,18 @@ class Tool(_common.BaseModel):
3643
3682
  default=None,
3644
3683
  description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
3645
3684
  )
3685
+ enterprise_web_search: Optional[EnterpriseWebSearch] = Field(
3686
+ default=None,
3687
+ description="""Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API.""",
3688
+ )
3689
+ google_search: Optional[GoogleSearch] = Field(
3690
+ default=None,
3691
+ description="""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.""",
3692
+ )
3693
+ url_context: Optional[UrlContext] = Field(
3694
+ default=None,
3695
+ description="""Optional. Tool to support URL context retrieval.""",
3696
+ )
3646
3697
 
3647
3698
 
3648
3699
  class ToolDict(TypedDict, total=False):
@@ -3652,26 +3703,15 @@ class ToolDict(TypedDict, total=False):
3652
3703
  """List of function declarations that the tool supports."""
3653
3704
 
3654
3705
  retrieval: Optional[RetrievalDict]
3655
- """Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation."""
3656
-
3657
- google_search: Optional[GoogleSearchDict]
3658
- """Optional. Google Search tool type. Specialized retrieval tool
3659
- that is powered by Google Search."""
3706
+ """Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API."""
3660
3707
 
3661
3708
  google_search_retrieval: Optional[GoogleSearchRetrievalDict]
3662
3709
  """Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."""
3663
3710
 
3664
- enterprise_web_search: Optional[EnterpriseWebSearchDict]
3665
- """Optional. Enterprise web search tool type. Specialized retrieval
3666
- tool that is powered by Vertex AI Search and Sec4 compliance."""
3667
-
3668
3711
  google_maps: Optional[GoogleMapsDict]
3669
3712
  """Optional. Google Maps tool type. Specialized retrieval tool
3670
3713
  that is powered by Google Maps."""
3671
3714
 
3672
- url_context: Optional[UrlContextDict]
3673
- """Optional. Tool to support URL context retrieval."""
3674
-
3675
3715
  computer_use: Optional[ComputerUseDict]
3676
3716
  """Optional. Tool to support the model interacting directly with the
3677
3717
  computer. If enabled, it automatically populates computer-use specific
@@ -3680,6 +3720,15 @@ class ToolDict(TypedDict, total=False):
3680
3720
  code_execution: Optional[ToolCodeExecutionDict]
3681
3721
  """Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
3682
3722
 
3723
+ enterprise_web_search: Optional[EnterpriseWebSearchDict]
3724
+ """Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API."""
3725
+
3726
+ google_search: Optional[GoogleSearchDict]
3727
+ """Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."""
3728
+
3729
+ url_context: Optional[UrlContextDict]
3730
+ """Optional. Tool to support URL context retrieval."""
3731
+
3683
3732
 
3684
3733
  ToolOrDict = Union[Tool, ToolDict]
3685
3734
  if _is_mcp_imported:
@@ -3819,135 +3868,6 @@ class ToolConfigDict(TypedDict, total=False):
3819
3868
  ToolConfigOrDict = Union[ToolConfig, ToolConfigDict]
3820
3869
 
3821
3870
 
3822
- class PrebuiltVoiceConfig(_common.BaseModel):
3823
- """The configuration for the prebuilt speaker to use."""
3824
-
3825
- voice_name: Optional[str] = Field(
3826
- default=None, description="""The name of the prebuilt voice to use."""
3827
- )
3828
-
3829
-
3830
- class PrebuiltVoiceConfigDict(TypedDict, total=False):
3831
- """The configuration for the prebuilt speaker to use."""
3832
-
3833
- voice_name: Optional[str]
3834
- """The name of the prebuilt voice to use."""
3835
-
3836
-
3837
- PrebuiltVoiceConfigOrDict = Union[PrebuiltVoiceConfig, PrebuiltVoiceConfigDict]
3838
-
3839
-
3840
- class VoiceConfig(_common.BaseModel):
3841
- """The configuration for the voice to use."""
3842
-
3843
- prebuilt_voice_config: Optional[PrebuiltVoiceConfig] = Field(
3844
- default=None,
3845
- description="""The configuration for the speaker to use.
3846
- """,
3847
- )
3848
-
3849
-
3850
- class VoiceConfigDict(TypedDict, total=False):
3851
- """The configuration for the voice to use."""
3852
-
3853
- prebuilt_voice_config: Optional[PrebuiltVoiceConfigDict]
3854
- """The configuration for the speaker to use.
3855
- """
3856
-
3857
-
3858
- VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
3859
-
3860
-
3861
- class SpeakerVoiceConfig(_common.BaseModel):
3862
- """The configuration for the speaker to use."""
3863
-
3864
- speaker: Optional[str] = Field(
3865
- default=None,
3866
- description="""The name of the speaker to use. Should be the same as in the
3867
- prompt.""",
3868
- )
3869
- voice_config: Optional[VoiceConfig] = Field(
3870
- default=None, description="""The configuration for the voice to use."""
3871
- )
3872
-
3873
-
3874
- class SpeakerVoiceConfigDict(TypedDict, total=False):
3875
- """The configuration for the speaker to use."""
3876
-
3877
- speaker: Optional[str]
3878
- """The name of the speaker to use. Should be the same as in the
3879
- prompt."""
3880
-
3881
- voice_config: Optional[VoiceConfigDict]
3882
- """The configuration for the voice to use."""
3883
-
3884
-
3885
- SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
3886
-
3887
-
3888
- class MultiSpeakerVoiceConfig(_common.BaseModel):
3889
- """The configuration for the multi-speaker setup."""
3890
-
3891
- speaker_voice_configs: Optional[list[SpeakerVoiceConfig]] = Field(
3892
- default=None, description="""The configuration for the speaker to use."""
3893
- )
3894
-
3895
-
3896
- class MultiSpeakerVoiceConfigDict(TypedDict, total=False):
3897
- """The configuration for the multi-speaker setup."""
3898
-
3899
- speaker_voice_configs: Optional[list[SpeakerVoiceConfigDict]]
3900
- """The configuration for the speaker to use."""
3901
-
3902
-
3903
- MultiSpeakerVoiceConfigOrDict = Union[
3904
- MultiSpeakerVoiceConfig, MultiSpeakerVoiceConfigDict
3905
- ]
3906
-
3907
-
3908
- class SpeechConfig(_common.BaseModel):
3909
- """The speech generation configuration."""
3910
-
3911
- voice_config: Optional[VoiceConfig] = Field(
3912
- default=None,
3913
- description="""The configuration for the speaker to use.
3914
- """,
3915
- )
3916
- multi_speaker_voice_config: Optional[MultiSpeakerVoiceConfig] = Field(
3917
- default=None,
3918
- description="""The configuration for the multi-speaker setup.
3919
- It is mutually exclusive with the voice_config field.
3920
- """,
3921
- )
3922
- language_code: Optional[str] = Field(
3923
- default=None,
3924
- description="""Language code (ISO 639. e.g. en-US) for the speech synthesization.
3925
- Only available for Live API.
3926
- """,
3927
- )
3928
-
3929
-
3930
- class SpeechConfigDict(TypedDict, total=False):
3931
- """The speech generation configuration."""
3932
-
3933
- voice_config: Optional[VoiceConfigDict]
3934
- """The configuration for the speaker to use.
3935
- """
3936
-
3937
- multi_speaker_voice_config: Optional[MultiSpeakerVoiceConfigDict]
3938
- """The configuration for the multi-speaker setup.
3939
- It is mutually exclusive with the voice_config field.
3940
- """
3941
-
3942
- language_code: Optional[str]
3943
- """Language code (ISO 639. e.g. en-US) for the speech synthesization.
3944
- Only available for Live API.
3945
- """
3946
-
3947
-
3948
- SpeechConfigOrDict = Union[SpeechConfig, SpeechConfigDict]
3949
-
3950
-
3951
3871
  class AutomaticFunctionCallingConfig(_common.BaseModel):
3952
3872
  """The configuration for automatic function calling."""
3953
3873
 
@@ -4215,7 +4135,10 @@ ContentUnionDict = Union[
4215
4135
 
4216
4136
 
4217
4137
  class GenerationConfigRoutingConfigAutoRoutingMode(_common.BaseModel):
4218
- """When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference."""
4138
+ """When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
4139
+
4140
+ This data type is not supported in Gemini API.
4141
+ """
4219
4142
 
4220
4143
  model_routing_preference: Optional[
4221
4144
  Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']
@@ -4223,7 +4146,10 @@ class GenerationConfigRoutingConfigAutoRoutingMode(_common.BaseModel):
4223
4146
 
4224
4147
 
4225
4148
  class GenerationConfigRoutingConfigAutoRoutingModeDict(TypedDict, total=False):
4226
- """When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference."""
4149
+ """When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
4150
+
4151
+ This data type is not supported in Gemini API.
4152
+ """
4227
4153
 
4228
4154
  model_routing_preference: Optional[
4229
4155
  Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']
@@ -4238,53 +4164,128 @@ GenerationConfigRoutingConfigAutoRoutingModeOrDict = Union[
4238
4164
 
4239
4165
 
4240
4166
  class GenerationConfigRoutingConfigManualRoutingMode(_common.BaseModel):
4241
- """When manual routing is set, the specified model will be used directly."""
4167
+ """When manual routing is set, the specified model will be used directly.
4168
+
4169
+ This data type is not supported in Gemini API.
4170
+ """
4242
4171
 
4243
4172
  model_name: Optional[str] = Field(
4244
4173
  default=None,
4245
- description="""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).""",
4174
+ description="""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).""",
4175
+ )
4176
+
4177
+
4178
+ class GenerationConfigRoutingConfigManualRoutingModeDict(
4179
+ TypedDict, total=False
4180
+ ):
4181
+ """When manual routing is set, the specified model will be used directly.
4182
+
4183
+ This data type is not supported in Gemini API.
4184
+ """
4185
+
4186
+ model_name: Optional[str]
4187
+ """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)."""
4188
+
4189
+
4190
+ GenerationConfigRoutingConfigManualRoutingModeOrDict = Union[
4191
+ GenerationConfigRoutingConfigManualRoutingMode,
4192
+ GenerationConfigRoutingConfigManualRoutingModeDict,
4193
+ ]
4194
+
4195
+
4196
+ class GenerationConfigRoutingConfig(_common.BaseModel):
4197
+ """The configuration for routing the request to a specific model.
4198
+
4199
+ This data type is not supported in Gemini API.
4200
+ """
4201
+
4202
+ auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingMode] = Field(
4203
+ default=None, description="""Automated routing."""
4204
+ )
4205
+ manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingMode] = Field(
4206
+ default=None, description="""Manual routing."""
4207
+ )
4208
+
4209
+
4210
+ class GenerationConfigRoutingConfigDict(TypedDict, total=False):
4211
+ """The configuration for routing the request to a specific model.
4212
+
4213
+ This data type is not supported in Gemini API.
4214
+ """
4215
+
4216
+ auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingModeDict]
4217
+ """Automated routing."""
4218
+
4219
+ manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingModeDict]
4220
+ """Manual routing."""
4221
+
4222
+
4223
+ GenerationConfigRoutingConfigOrDict = Union[
4224
+ GenerationConfigRoutingConfig, GenerationConfigRoutingConfigDict
4225
+ ]
4226
+
4227
+
4228
+ class SafetySetting(_common.BaseModel):
4229
+ """Safety settings."""
4230
+
4231
+ category: Optional[HarmCategory] = Field(
4232
+ default=None, description="""Required. Harm category."""
4233
+ )
4234
+ method: Optional[HarmBlockMethod] = Field(
4235
+ default=None,
4236
+ description="""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.""",
4237
+ )
4238
+ threshold: Optional[HarmBlockThreshold] = Field(
4239
+ default=None, description="""Required. The harm block threshold."""
4246
4240
  )
4247
4241
 
4248
4242
 
4249
- class GenerationConfigRoutingConfigManualRoutingModeDict(
4250
- TypedDict, total=False
4251
- ):
4252
- """When manual routing is set, the specified model will be used directly."""
4243
+ class SafetySettingDict(TypedDict, total=False):
4244
+ """Safety settings."""
4253
4245
 
4254
- model_name: Optional[str]
4255
- """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)."""
4246
+ category: Optional[HarmCategory]
4247
+ """Required. Harm category."""
4248
+
4249
+ method: Optional[HarmBlockMethod]
4250
+ """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."""
4256
4251
 
4252
+ threshold: Optional[HarmBlockThreshold]
4253
+ """Required. The harm block threshold."""
4257
4254
 
4258
- GenerationConfigRoutingConfigManualRoutingModeOrDict = Union[
4259
- GenerationConfigRoutingConfigManualRoutingMode,
4260
- GenerationConfigRoutingConfigManualRoutingModeDict,
4261
- ]
4255
+
4256
+ SafetySettingOrDict = Union[SafetySetting, SafetySettingDict]
4262
4257
 
4263
4258
 
4264
- class GenerationConfigRoutingConfig(_common.BaseModel):
4265
- """The configuration for routing the request to a specific model."""
4259
+ class SpeechConfig(_common.BaseModel):
4260
+ """The speech generation config."""
4266
4261
 
4267
- auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingMode] = Field(
4268
- default=None, description="""Automated routing."""
4262
+ language_code: Optional[str] = Field(
4263
+ default=None,
4264
+ description="""Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization.""",
4269
4265
  )
4270
- manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingMode] = Field(
4271
- default=None, description="""Manual routing."""
4266
+ voice_config: Optional['VoiceConfig'] = Field(
4267
+ default=None, description="""The configuration for the speaker to use."""
4268
+ )
4269
+ multi_speaker_voice_config: Optional['MultiSpeakerVoiceConfig'] = Field(
4270
+ default=None,
4271
+ description="""Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field. This field is not supported in Vertex AI.""",
4272
4272
  )
4273
4273
 
4274
4274
 
4275
- class GenerationConfigRoutingConfigDict(TypedDict, total=False):
4276
- """The configuration for routing the request to a specific model."""
4275
+ class SpeechConfigDict(TypedDict, total=False):
4276
+ """The speech generation config."""
4277
4277
 
4278
- auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingModeDict]
4279
- """Automated routing."""
4278
+ language_code: Optional[str]
4279
+ """Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization."""
4280
4280
 
4281
- manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingModeDict]
4282
- """Manual routing."""
4281
+ voice_config: Optional['VoiceConfigDict']
4282
+ """The configuration for the speaker to use."""
4283
4283
 
4284
+ multi_speaker_voice_config: Optional['MultiSpeakerVoiceConfigDict']
4285
+ """Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field. This field is not supported in Vertex AI."""
4284
4286
 
4285
- GenerationConfigRoutingConfigOrDict = Union[
4286
- GenerationConfigRoutingConfig, GenerationConfigRoutingConfigDict
4287
- ]
4287
+
4288
+ SpeechConfigOrDict = Union[SpeechConfig, SpeechConfigDict]
4288
4289
 
4289
4290
 
4290
4291
  SpeechConfigUnion = Union[str, SpeechConfig]
@@ -4790,7 +4791,8 @@ class GoogleTypeDate(_common.BaseModel):
4790
4791
  day values. * A month and day, with a zero year (for example, an anniversary).
4791
4792
  * A year on its own, with a zero month and a zero day. * A year and month,
4792
4793
  with a zero day (for example, a credit card expiration date). Related types: *
4793
- google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
4794
+ google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This
4795
+ data type is not supported in Gemini API.
4794
4796
  """
4795
4797
 
4796
4798
  day: Optional[int] = Field(
@@ -4816,7 +4818,8 @@ class GoogleTypeDateDict(TypedDict, total=False):
4816
4818
  day values. * A month and day, with a zero year (for example, an anniversary).
4817
4819
  * A year on its own, with a zero month and a zero day. * A year and month,
4818
4820
  with a zero day (for example, a credit card expiration date). Related types: *
4819
- google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
4821
+ google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This
4822
+ data type is not supported in Gemini API.
4820
4823
  """
4821
4824
 
4822
4825
  day: Optional[int]
@@ -4833,7 +4836,10 @@ GoogleTypeDateOrDict = Union[GoogleTypeDate, GoogleTypeDateDict]
4833
4836
 
4834
4837
 
4835
4838
  class Citation(_common.BaseModel):
4836
- """Source attributions for content."""
4839
+ """Source attributions for content.
4840
+
4841
+ This data type is not supported in Gemini API.
4842
+ """
4837
4843
 
4838
4844
  end_index: Optional[int] = Field(
4839
4845
  default=None, description="""Output only. End index into the content."""
@@ -4858,7 +4864,10 @@ class Citation(_common.BaseModel):
4858
4864
 
4859
4865
 
4860
4866
  class CitationDict(TypedDict, total=False):
4861
- """Source attributions for content."""
4867
+ """Source attributions for content.
4868
+
4869
+ This data type is not supported in Gemini API.
4870
+ """
4862
4871
 
4863
4872
  end_index: Optional[int]
4864
4873
  """Output only. End index into the content."""
@@ -4907,50 +4916,11 @@ class CitationMetadataDict(TypedDict, total=False):
4907
4916
  CitationMetadataOrDict = Union[CitationMetadata, CitationMetadataDict]
4908
4917
 
4909
4918
 
4910
- class UrlMetadata(_common.BaseModel):
4911
- """Context for a single url retrieval."""
4912
-
4913
- retrieved_url: Optional[str] = Field(
4914
- default=None, description="""The URL retrieved by the tool."""
4915
- )
4916
- url_retrieval_status: Optional[UrlRetrievalStatus] = Field(
4917
- default=None, description="""Status of the url retrieval."""
4918
- )
4919
-
4920
-
4921
- class UrlMetadataDict(TypedDict, total=False):
4922
- """Context for a single url retrieval."""
4923
-
4924
- retrieved_url: Optional[str]
4925
- """The URL retrieved by the tool."""
4926
-
4927
- url_retrieval_status: Optional[UrlRetrievalStatus]
4928
- """Status of the url retrieval."""
4929
-
4930
-
4931
- UrlMetadataOrDict = Union[UrlMetadata, UrlMetadataDict]
4932
-
4933
-
4934
- class UrlContextMetadata(_common.BaseModel):
4935
- """Metadata related to url context retrieval tool."""
4936
-
4937
- url_metadata: Optional[list[UrlMetadata]] = Field(
4938
- default=None, description="""List of url context."""
4939
- )
4940
-
4941
-
4942
- class UrlContextMetadataDict(TypedDict, total=False):
4943
- """Metadata related to url context retrieval tool."""
4944
-
4945
- url_metadata: Optional[list[UrlMetadataDict]]
4946
- """List of url context."""
4947
-
4948
-
4949
- UrlContextMetadataOrDict = Union[UrlContextMetadata, UrlContextMetadataDict]
4950
-
4951
-
4952
4919
  class GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution(_common.BaseModel):
4953
- """Author attribution for a photo or review."""
4920
+ """Author attribution for a photo or review.
4921
+
4922
+ This data type is not supported in Gemini API.
4923
+ """
4954
4924
 
4955
4925
  display_name: Optional[str] = Field(
4956
4926
  default=None, description="""Name of the author of the Photo or Review."""
@@ -4967,7 +4937,10 @@ class GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution(_common.BaseModel):
4967
4937
  class GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionDict(
4968
4938
  TypedDict, total=False
4969
4939
  ):
4970
- """Author attribution for a photo or review."""
4940
+ """Author attribution for a photo or review.
4941
+
4942
+ This data type is not supported in Gemini API.
4943
+ """
4971
4944
 
4972
4945
  display_name: Optional[str]
4973
4946
  """Name of the author of the Photo or Review."""
@@ -4986,7 +4959,10 @@ GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionOrDict = Union[
4986
4959
 
4987
4960
 
4988
4961
  class GroundingChunkMapsPlaceAnswerSourcesReviewSnippet(_common.BaseModel):
4989
- """Encapsulates a review snippet."""
4962
+ """Encapsulates a review snippet.
4963
+
4964
+ This data type is not supported in Gemini API.
4965
+ """
4990
4966
 
4991
4967
  author_attribution: Optional[
4992
4968
  GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution
@@ -5017,7 +4993,10 @@ class GroundingChunkMapsPlaceAnswerSourcesReviewSnippet(_common.BaseModel):
5017
4993
  class GroundingChunkMapsPlaceAnswerSourcesReviewSnippetDict(
5018
4994
  TypedDict, total=False
5019
4995
  ):
5020
- """Encapsulates a review snippet."""
4996
+ """Encapsulates a review snippet.
4997
+
4998
+ This data type is not supported in Gemini API.
4999
+ """
5021
5000
 
5022
5001
  author_attribution: Optional[
5023
5002
  GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionDict
@@ -5050,7 +5029,10 @@ GroundingChunkMapsPlaceAnswerSourcesReviewSnippetOrDict = Union[
5050
5029
 
5051
5030
 
5052
5031
  class GroundingChunkMapsPlaceAnswerSources(_common.BaseModel):
5053
- """Sources used to generate the place answer."""
5032
+ """Sources used to generate the place answer.
5033
+
5034
+ This data type is not supported in Gemini API.
5035
+ """
5054
5036
 
5055
5037
  flag_content_uri: Optional[str] = Field(
5056
5038
  default=None,
@@ -5065,7 +5047,10 @@ class GroundingChunkMapsPlaceAnswerSources(_common.BaseModel):
5065
5047
 
5066
5048
 
5067
5049
  class GroundingChunkMapsPlaceAnswerSourcesDict(TypedDict, total=False):
5068
- """Sources used to generate the place answer."""
5050
+ """Sources used to generate the place answer.
5051
+
5052
+ This data type is not supported in Gemini API.
5053
+ """
5069
5054
 
5070
5055
  flag_content_uri: Optional[str]
5071
5056
  """A link where users can flag a problem with the generated answer."""
@@ -5083,7 +5068,7 @@ GroundingChunkMapsPlaceAnswerSourcesOrDict = Union[
5083
5068
 
5084
5069
 
5085
5070
  class GroundingChunkMaps(_common.BaseModel):
5086
- """Chunk from Google Maps."""
5071
+ """Chunk from Google Maps. This data type is not supported in Gemini API."""
5087
5072
 
5088
5073
  place_answer_sources: Optional[GroundingChunkMapsPlaceAnswerSources] = Field(
5089
5074
  default=None,
@@ -5105,7 +5090,7 @@ class GroundingChunkMaps(_common.BaseModel):
5105
5090
 
5106
5091
 
5107
5092
  class GroundingChunkMapsDict(TypedDict, total=False):
5108
- """Chunk from Google Maps."""
5093
+ """Chunk from Google Maps. This data type is not supported in Gemini API."""
5109
5094
 
5110
5095
  place_answer_sources: Optional[GroundingChunkMapsPlaceAnswerSourcesDict]
5111
5096
  """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."""
@@ -5127,7 +5112,10 @@ GroundingChunkMapsOrDict = Union[GroundingChunkMaps, GroundingChunkMapsDict]
5127
5112
 
5128
5113
 
5129
5114
  class RagChunkPageSpan(_common.BaseModel):
5130
- """Represents where the chunk starts and ends in the document."""
5115
+ """Represents where the chunk starts and ends in the document.
5116
+
5117
+ This data type is not supported in Gemini API.
5118
+ """
5131
5119
 
5132
5120
  first_page: Optional[int] = Field(
5133
5121
  default=None,
@@ -5140,7 +5128,10 @@ class RagChunkPageSpan(_common.BaseModel):
5140
5128
 
5141
5129
 
5142
5130
  class RagChunkPageSpanDict(TypedDict, total=False):
5143
- """Represents where the chunk starts and ends in the document."""
5131
+ """Represents where the chunk starts and ends in the document.
5132
+
5133
+ This data type is not supported in Gemini API.
5134
+ """
5144
5135
 
5145
5136
  first_page: Optional[int]
5146
5137
  """Page where chunk starts in the document. Inclusive. 1-indexed."""
@@ -5153,7 +5144,10 @@ RagChunkPageSpanOrDict = Union[RagChunkPageSpan, RagChunkPageSpanDict]
5153
5144
 
5154
5145
 
5155
5146
  class RagChunk(_common.BaseModel):
5156
- """A RagChunk includes the content of a chunk of a RagFile, and associated metadata."""
5147
+ """A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
5148
+
5149
+ This data type is not supported in Gemini API.
5150
+ """
5157
5151
 
5158
5152
  page_span: Optional[RagChunkPageSpan] = Field(
5159
5153
  default=None,
@@ -5165,7 +5159,10 @@ class RagChunk(_common.BaseModel):
5165
5159
 
5166
5160
 
5167
5161
  class RagChunkDict(TypedDict, total=False):
5168
- """A RagChunk includes the content of a chunk of a RagFile, and associated metadata."""
5162
+ """A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
5163
+
5164
+ This data type is not supported in Gemini API.
5165
+ """
5169
5166
 
5170
5167
  page_span: Optional[RagChunkPageSpanDict]
5171
5168
  """If populated, represents where the chunk starts and ends in the document."""
@@ -5178,7 +5175,10 @@ RagChunkOrDict = Union[RagChunk, RagChunkDict]
5178
5175
 
5179
5176
 
5180
5177
  class GroundingChunkRetrievedContext(_common.BaseModel):
5181
- """Chunk from context retrieved by the retrieval tools."""
5178
+ """Chunk from context retrieved by the retrieval tools.
5179
+
5180
+ This data type is not supported in Gemini API.
5181
+ """
5182
5182
 
5183
5183
  document_name: Optional[str] = Field(
5184
5184
  default=None,
@@ -5200,7 +5200,10 @@ class GroundingChunkRetrievedContext(_common.BaseModel):
5200
5200
 
5201
5201
 
5202
5202
  class GroundingChunkRetrievedContextDict(TypedDict, total=False):
5203
- """Chunk from context retrieved by the retrieval tools."""
5203
+ """Chunk from context retrieved by the retrieval tools.
5204
+
5205
+ This data type is not supported in Gemini API.
5206
+ """
5204
5207
 
5205
5208
  document_name: Optional[str]
5206
5209
  """Output only. The full document name for the referenced Vertex AI Search document."""
@@ -5227,7 +5230,8 @@ class GroundingChunkWeb(_common.BaseModel):
5227
5230
  """Chunk from the web."""
5228
5231
 
5229
5232
  domain: Optional[str] = Field(
5230
- default=None, description="""Domain of the (original) URI."""
5233
+ default=None,
5234
+ description="""Domain of the (original) URI. This field is not supported in Gemini API.""",
5231
5235
  )
5232
5236
  title: Optional[str] = Field(
5233
5237
  default=None, description="""Title of the chunk."""
@@ -5241,7 +5245,7 @@ class GroundingChunkWebDict(TypedDict, total=False):
5241
5245
  """Chunk from the web."""
5242
5246
 
5243
5247
  domain: Optional[str]
5244
- """Domain of the (original) URI."""
5248
+ """Domain of the (original) URI. This field is not supported in Gemini API."""
5245
5249
 
5246
5250
  title: Optional[str]
5247
5251
  """Title of the chunk."""
@@ -5257,11 +5261,12 @@ class GroundingChunk(_common.BaseModel):
5257
5261
  """Grounding chunk."""
5258
5262
 
5259
5263
  maps: Optional[GroundingChunkMaps] = Field(
5260
- default=None, description="""Grounding chunk from Google Maps."""
5264
+ default=None,
5265
+ description="""Grounding chunk from Google Maps. This field is not supported in Gemini API.""",
5261
5266
  )
5262
5267
  retrieved_context: Optional[GroundingChunkRetrievedContext] = Field(
5263
5268
  default=None,
5264
- description="""Grounding chunk from context retrieved by the retrieval tools.""",
5269
+ description="""Grounding chunk from context retrieved by the retrieval tools. This field is not supported in Gemini API.""",
5265
5270
  )
5266
5271
  web: Optional[GroundingChunkWeb] = Field(
5267
5272
  default=None, description="""Grounding chunk from the web."""
@@ -5272,10 +5277,10 @@ class GroundingChunkDict(TypedDict, total=False):
5272
5277
  """Grounding chunk."""
5273
5278
 
5274
5279
  maps: Optional[GroundingChunkMapsDict]
5275
- """Grounding chunk from Google Maps."""
5280
+ """Grounding chunk from Google Maps. This field is not supported in Gemini API."""
5276
5281
 
5277
5282
  retrieved_context: Optional[GroundingChunkRetrievedContextDict]
5278
- """Grounding chunk from context retrieved by the retrieval tools."""
5283
+ """Grounding chunk from context retrieved by the retrieval tools. This field is not supported in Gemini API."""
5279
5284
 
5280
5285
  web: Optional[GroundingChunkWebDict]
5281
5286
  """Grounding chunk from the web."""
@@ -5405,7 +5410,8 @@ SearchEntryPointOrDict = Union[SearchEntryPoint, SearchEntryPointDict]
5405
5410
  class GroundingMetadataSourceFlaggingUri(_common.BaseModel):
5406
5411
  """Source content flagging uri for a place or review.
5407
5412
 
5408
- This is currently populated only for Google Maps grounding.
5413
+ This is currently populated only for Google Maps grounding. This data type is
5414
+ not supported in Gemini API.
5409
5415
  """
5410
5416
 
5411
5417
  flag_content_uri: Optional[str] = Field(
@@ -5420,7 +5426,8 @@ class GroundingMetadataSourceFlaggingUri(_common.BaseModel):
5420
5426
  class GroundingMetadataSourceFlaggingUriDict(TypedDict, total=False):
5421
5427
  """Source content flagging uri for a place or review.
5422
5428
 
5423
- This is currently populated only for Google Maps grounding.
5429
+ This is currently populated only for Google Maps grounding. This data type is
5430
+ not supported in Gemini API.
5424
5431
  """
5425
5432
 
5426
5433
  flag_content_uri: Optional[str]
@@ -5440,7 +5447,7 @@ class GroundingMetadata(_common.BaseModel):
5440
5447
 
5441
5448
  google_maps_widget_context_token: Optional[str] = Field(
5442
5449
  default=None,
5443
- description="""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.""",
5450
+ description="""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.""",
5444
5451
  )
5445
5452
  grounding_chunks: Optional[list[GroundingChunk]] = Field(
5446
5453
  default=None,
@@ -5454,7 +5461,7 @@ class GroundingMetadata(_common.BaseModel):
5454
5461
  )
5455
5462
  retrieval_queries: Optional[list[str]] = Field(
5456
5463
  default=None,
5457
- description="""Optional. Queries executed by the retrieval tools.""",
5464
+ description="""Optional. Queries executed by the retrieval tools. This field is not supported in Gemini API.""",
5458
5465
  )
5459
5466
  search_entry_point: Optional[SearchEntryPoint] = Field(
5460
5467
  default=None,
@@ -5463,7 +5470,7 @@ class GroundingMetadata(_common.BaseModel):
5463
5470
  source_flagging_uris: Optional[list[GroundingMetadataSourceFlaggingUri]] = (
5464
5471
  Field(
5465
5472
  default=None,
5466
- description="""Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding.""",
5473
+ description="""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.""",
5467
5474
  )
5468
5475
  )
5469
5476
  web_search_queries: Optional[list[str]] = Field(
@@ -5476,7 +5483,7 @@ class GroundingMetadataDict(TypedDict, total=False):
5476
5483
  """Metadata returned to client when grounding is enabled."""
5477
5484
 
5478
5485
  google_maps_widget_context_token: Optional[str]
5479
- """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."""
5486
+ """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."""
5480
5487
 
5481
5488
  grounding_chunks: Optional[list[GroundingChunkDict]]
5482
5489
  """List of supporting references retrieved from specified grounding source."""
@@ -5488,13 +5495,13 @@ class GroundingMetadataDict(TypedDict, total=False):
5488
5495
  """Optional. Output only. Retrieval metadata."""
5489
5496
 
5490
5497
  retrieval_queries: Optional[list[str]]
5491
- """Optional. Queries executed by the retrieval tools."""
5498
+ """Optional. Queries executed by the retrieval tools. This field is not supported in Gemini API."""
5492
5499
 
5493
5500
  search_entry_point: Optional[SearchEntryPointDict]
5494
5501
  """Optional. Google search entry for the following-up web searches."""
5495
5502
 
5496
5503
  source_flagging_uris: Optional[list[GroundingMetadataSourceFlaggingUriDict]]
5497
- """Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding."""
5504
+ """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."""
5498
5505
 
5499
5506
  web_search_queries: Optional[list[str]]
5500
5507
  """Optional. Web search queries for the following-up web search."""
@@ -5593,21 +5600,23 @@ class SafetyRating(_common.BaseModel):
5593
5600
  )
5594
5601
  overwritten_threshold: Optional[HarmBlockThreshold] = Field(
5595
5602
  default=None,
5596
- description="""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.""",
5603
+ description="""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API.""",
5597
5604
  )
5598
5605
  probability: Optional[HarmProbability] = Field(
5599
5606
  default=None,
5600
5607
  description="""Output only. Harm probability levels in the content.""",
5601
5608
  )
5602
5609
  probability_score: Optional[float] = Field(
5603
- default=None, description="""Output only. Harm probability score."""
5610
+ default=None,
5611
+ description="""Output only. Harm probability score. This field is not supported in Gemini API.""",
5604
5612
  )
5605
5613
  severity: Optional[HarmSeverity] = Field(
5606
5614
  default=None,
5607
- description="""Output only. Harm severity levels in the content.""",
5615
+ description="""Output only. Harm severity levels in the content. This field is not supported in Gemini API.""",
5608
5616
  )
5609
5617
  severity_score: Optional[float] = Field(
5610
- default=None, description="""Output only. Harm severity score."""
5618
+ default=None,
5619
+ description="""Output only. Harm severity score. This field is not supported in Gemini API.""",
5611
5620
  )
5612
5621
 
5613
5622
 
@@ -5621,24 +5630,66 @@ class SafetyRatingDict(TypedDict, total=False):
5621
5630
  """Output only. Harm category."""
5622
5631
 
5623
5632
  overwritten_threshold: Optional[HarmBlockThreshold]
5624
- """Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold."""
5633
+ """Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API."""
5625
5634
 
5626
5635
  probability: Optional[HarmProbability]
5627
5636
  """Output only. Harm probability levels in the content."""
5628
5637
 
5629
5638
  probability_score: Optional[float]
5630
- """Output only. Harm probability score."""
5639
+ """Output only. Harm probability score. This field is not supported in Gemini API."""
5631
5640
 
5632
5641
  severity: Optional[HarmSeverity]
5633
- """Output only. Harm severity levels in the content."""
5642
+ """Output only. Harm severity levels in the content. This field is not supported in Gemini API."""
5634
5643
 
5635
5644
  severity_score: Optional[float]
5636
- """Output only. Harm severity score."""
5645
+ """Output only. Harm severity score. This field is not supported in Gemini API."""
5637
5646
 
5638
5647
 
5639
5648
  SafetyRatingOrDict = Union[SafetyRating, SafetyRatingDict]
5640
5649
 
5641
5650
 
5651
+ class UrlMetadata(_common.BaseModel):
5652
+ """Context of the a single url retrieval."""
5653
+
5654
+ retrieved_url: Optional[str] = Field(
5655
+ default=None, description="""Retrieved url by the tool."""
5656
+ )
5657
+ url_retrieval_status: Optional[UrlRetrievalStatus] = Field(
5658
+ default=None, description="""Status of the url retrieval."""
5659
+ )
5660
+
5661
+
5662
+ class UrlMetadataDict(TypedDict, total=False):
5663
+ """Context of the a single url retrieval."""
5664
+
5665
+ retrieved_url: Optional[str]
5666
+ """Retrieved url by the tool."""
5667
+
5668
+ url_retrieval_status: Optional[UrlRetrievalStatus]
5669
+ """Status of the url retrieval."""
5670
+
5671
+
5672
+ UrlMetadataOrDict = Union[UrlMetadata, UrlMetadataDict]
5673
+
5674
+
5675
+ class UrlContextMetadata(_common.BaseModel):
5676
+ """Metadata related to url context retrieval tool."""
5677
+
5678
+ url_metadata: Optional[list[UrlMetadata]] = Field(
5679
+ default=None, description="""Output only. List of url context."""
5680
+ )
5681
+
5682
+
5683
+ class UrlContextMetadataDict(TypedDict, total=False):
5684
+ """Metadata related to url context retrieval tool."""
5685
+
5686
+ url_metadata: Optional[list[UrlMetadataDict]]
5687
+ """Output only. List of url context."""
5688
+
5689
+
5690
+ UrlContextMetadataOrDict = Union[UrlContextMetadata, UrlContextMetadataDict]
5691
+
5692
+
5642
5693
  class Candidate(_common.BaseModel):
5643
5694
  """A response candidate generated from the model."""
5644
5695
 
@@ -5668,10 +5719,6 @@ class Candidate(_common.BaseModel):
5668
5719
  If empty, the model has not stopped generating the tokens.
5669
5720
  """,
5670
5721
  )
5671
- url_context_metadata: Optional[UrlContextMetadata] = Field(
5672
- default=None,
5673
- description="""Metadata related to url context retrieval tool.""",
5674
- )
5675
5722
  avg_logprobs: Optional[float] = Field(
5676
5723
  default=None,
5677
5724
  description="""Output only. Average log probability score of the candidate.""",
@@ -5691,6 +5738,10 @@ class Candidate(_common.BaseModel):
5691
5738
  default=None,
5692
5739
  description="""Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.""",
5693
5740
  )
5741
+ url_context_metadata: Optional[UrlContextMetadata] = Field(
5742
+ default=None,
5743
+ description="""Output only. Metadata related to url context retrieval tool.""",
5744
+ )
5694
5745
 
5695
5746
 
5696
5747
  class CandidateDict(TypedDict, total=False):
@@ -5717,9 +5768,6 @@ class CandidateDict(TypedDict, total=False):
5717
5768
  If empty, the model has not stopped generating the tokens.
5718
5769
  """
5719
5770
 
5720
- url_context_metadata: Optional[UrlContextMetadataDict]
5721
- """Metadata related to url context retrieval tool."""
5722
-
5723
5771
  avg_logprobs: Optional[float]
5724
5772
  """Output only. Average log probability score of the candidate."""
5725
5773
 
@@ -5735,6 +5783,9 @@ class CandidateDict(TypedDict, total=False):
5735
5783
  safety_ratings: Optional[list[SafetyRatingDict]]
5736
5784
  """Output only. List of ratings for the safety of a response candidate. There is at most one rating per category."""
5737
5785
 
5786
+ url_context_metadata: Optional[UrlContextMetadataDict]
5787
+ """Output only. Metadata related to url context retrieval tool."""
5788
+
5738
5789
 
5739
5790
  CandidateOrDict = Union[Candidate, CandidateDict]
5740
5791
 
@@ -5752,7 +5803,7 @@ class GenerateContentResponsePromptFeedback(_common.BaseModel):
5752
5803
  )
5753
5804
  block_reason_message: Optional[str] = Field(
5754
5805
  default=None,
5755
- description="""Output only. A readable message that explains the reason why the prompt was blocked.""",
5806
+ description="""Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API.""",
5756
5807
  )
5757
5808
  safety_ratings: Optional[list[SafetyRating]] = Field(
5758
5809
  default=None,
@@ -5771,7 +5822,7 @@ class GenerateContentResponsePromptFeedbackDict(TypedDict, total=False):
5771
5822
  """Output only. The reason why the prompt was blocked."""
5772
5823
 
5773
5824
  block_reason_message: Optional[str]
5774
- """Output only. A readable message that explains the reason why the prompt was blocked."""
5825
+ """Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API."""
5775
5826
 
5776
5827
  safety_ratings: Optional[list[SafetyRatingDict]]
5777
5828
  """Output only. A list of safety ratings for the prompt. There is one rating per category."""
@@ -5809,7 +5860,10 @@ ModalityTokenCountOrDict = Union[ModalityTokenCount, ModalityTokenCountDict]
5809
5860
 
5810
5861
 
5811
5862
  class GenerateContentResponseUsageMetadata(_common.BaseModel):
5812
- """Usage metadata about response(s)."""
5863
+ """Usage metadata about response(s).
5864
+
5865
+ This data type is not supported in Gemini API.
5866
+ """
5813
5867
 
5814
5868
  cache_tokens_details: Optional[list[ModalityTokenCount]] = Field(
5815
5869
  default=None,
@@ -5857,7 +5911,10 @@ class GenerateContentResponseUsageMetadata(_common.BaseModel):
5857
5911
 
5858
5912
 
5859
5913
  class GenerateContentResponseUsageMetadataDict(TypedDict, total=False):
5860
- """Usage metadata about response(s)."""
5914
+ """Usage metadata about response(s).
5915
+
5916
+ This data type is not supported in Gemini API.
5917
+ """
5861
5918
 
5862
5919
  cache_tokens_details: Optional[list[ModalityTokenCountDict]]
5863
5920
  """Output only. List of modalities of the cached content in the request input."""
@@ -7329,6 +7386,12 @@ class _UpscaleImageAPIConfig(_common.BaseModel):
7329
7386
  default=None,
7330
7387
  description="""Cloud Storage URI used to store the generated images.""",
7331
7388
  )
7389
+ safety_filter_level: Optional[SafetyFilterLevel] = Field(
7390
+ default=None, description="""Filter level for safety filtering."""
7391
+ )
7392
+ person_generation: Optional[PersonGeneration] = Field(
7393
+ default=None, description="""Allows generation of people by the model."""
7394
+ )
7332
7395
  include_rai_reason: Optional[bool] = Field(
7333
7396
  default=None,
7334
7397
  description="""Whether to include a reason for filtered-out images in the
@@ -7377,6 +7440,12 @@ class _UpscaleImageAPIConfigDict(TypedDict, total=False):
7377
7440
  output_gcs_uri: Optional[str]
7378
7441
  """Cloud Storage URI used to store the generated images."""
7379
7442
 
7443
+ safety_filter_level: Optional[SafetyFilterLevel]
7444
+ """Filter level for safety filtering."""
7445
+
7446
+ person_generation: Optional[PersonGeneration]
7447
+ """Allows generation of people by the model."""
7448
+
7380
7449
  include_rai_reason: Optional[bool]
7381
7450
  """Whether to include a reason for filtered-out images in the
7382
7451
  response."""
@@ -8290,62 +8359,157 @@ _UpdateModelParametersOrDict = Union[
8290
8359
  ]
8291
8360
 
8292
8361
 
8293
- class DeleteModelConfig(_common.BaseModel):
8294
- """Configuration for deleting a tuned model."""
8362
+ class DeleteModelConfig(_common.BaseModel):
8363
+ """Configuration for deleting a tuned model."""
8364
+
8365
+ http_options: Optional[HttpOptions] = Field(
8366
+ default=None, description="""Used to override HTTP request options."""
8367
+ )
8368
+
8369
+
8370
+ class DeleteModelConfigDict(TypedDict, total=False):
8371
+ """Configuration for deleting a tuned model."""
8372
+
8373
+ http_options: Optional[HttpOptionsDict]
8374
+ """Used to override HTTP request options."""
8375
+
8376
+
8377
+ DeleteModelConfigOrDict = Union[DeleteModelConfig, DeleteModelConfigDict]
8378
+
8379
+
8380
+ class _DeleteModelParameters(_common.BaseModel):
8381
+ """Parameters for deleting a tuned model."""
8382
+
8383
+ model: Optional[str] = Field(default=None, description="""""")
8384
+ config: Optional[DeleteModelConfig] = Field(
8385
+ default=None, description="""Optional parameters for the request."""
8386
+ )
8387
+
8388
+
8389
+ class _DeleteModelParametersDict(TypedDict, total=False):
8390
+ """Parameters for deleting a tuned model."""
8391
+
8392
+ model: Optional[str]
8393
+ """"""
8394
+
8395
+ config: Optional[DeleteModelConfigDict]
8396
+ """Optional parameters for the request."""
8397
+
8398
+
8399
+ _DeleteModelParametersOrDict = Union[
8400
+ _DeleteModelParameters, _DeleteModelParametersDict
8401
+ ]
8402
+
8403
+
8404
+ class DeleteModelResponse(_common.BaseModel):
8405
+
8406
+ sdk_http_response: Optional[HttpResponse] = Field(
8407
+ default=None, description="""Used to retain the full HTTP response."""
8408
+ )
8409
+
8410
+
8411
+ class DeleteModelResponseDict(TypedDict, total=False):
8412
+
8413
+ sdk_http_response: Optional[HttpResponseDict]
8414
+ """Used to retain the full HTTP response."""
8415
+
8416
+
8417
+ DeleteModelResponseOrDict = Union[DeleteModelResponse, DeleteModelResponseDict]
8418
+
8419
+
8420
+ class PrebuiltVoiceConfig(_common.BaseModel):
8421
+ """The configuration for the prebuilt speaker to use."""
8422
+
8423
+ voice_name: Optional[str] = Field(
8424
+ default=None, description="""The name of the preset voice to use."""
8425
+ )
8426
+
8427
+
8428
+ class PrebuiltVoiceConfigDict(TypedDict, total=False):
8429
+ """The configuration for the prebuilt speaker to use."""
8430
+
8431
+ voice_name: Optional[str]
8432
+ """The name of the preset voice to use."""
8433
+
8434
+
8435
+ PrebuiltVoiceConfigOrDict = Union[PrebuiltVoiceConfig, PrebuiltVoiceConfigDict]
8436
+
8437
+
8438
+ class VoiceConfig(_common.BaseModel):
8439
+ """The configuration for the voice to use."""
8295
8440
 
8296
- http_options: Optional[HttpOptions] = Field(
8297
- default=None, description="""Used to override HTTP request options."""
8441
+ prebuilt_voice_config: Optional[PrebuiltVoiceConfig] = Field(
8442
+ default=None,
8443
+ description="""The configuration for the prebuilt voice to use.""",
8298
8444
  )
8299
8445
 
8300
8446
 
8301
- class DeleteModelConfigDict(TypedDict, total=False):
8302
- """Configuration for deleting a tuned model."""
8447
+ class VoiceConfigDict(TypedDict, total=False):
8448
+ """The configuration for the voice to use."""
8303
8449
 
8304
- http_options: Optional[HttpOptionsDict]
8305
- """Used to override HTTP request options."""
8450
+ prebuilt_voice_config: Optional[PrebuiltVoiceConfigDict]
8451
+ """The configuration for the prebuilt voice to use."""
8306
8452
 
8307
8453
 
8308
- DeleteModelConfigOrDict = Union[DeleteModelConfig, DeleteModelConfigDict]
8454
+ VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
8309
8455
 
8310
8456
 
8311
- class _DeleteModelParameters(_common.BaseModel):
8312
- """Parameters for deleting a tuned model."""
8457
+ class SpeakerVoiceConfig(_common.BaseModel):
8458
+ """The configuration for a single speaker in a multi speaker setup.
8313
8459
 
8314
- model: Optional[str] = Field(default=None, description="""""")
8315
- config: Optional[DeleteModelConfig] = Field(
8316
- default=None, description="""Optional parameters for the request."""
8460
+ This data type is not supported in Vertex AI.
8461
+ """
8462
+
8463
+ speaker: Optional[str] = Field(
8464
+ default=None,
8465
+ description="""Required. The name of the speaker to use. Should be the same as in the prompt.""",
8466
+ )
8467
+ voice_config: Optional[VoiceConfig] = Field(
8468
+ default=None,
8469
+ description="""Required. The configuration for the voice to use.""",
8317
8470
  )
8318
8471
 
8319
8472
 
8320
- class _DeleteModelParametersDict(TypedDict, total=False):
8321
- """Parameters for deleting a tuned model."""
8473
+ class SpeakerVoiceConfigDict(TypedDict, total=False):
8474
+ """The configuration for a single speaker in a multi speaker setup.
8322
8475
 
8323
- model: Optional[str]
8324
- """"""
8476
+ This data type is not supported in Vertex AI.
8477
+ """
8325
8478
 
8326
- config: Optional[DeleteModelConfigDict]
8327
- """Optional parameters for the request."""
8479
+ speaker: Optional[str]
8480
+ """Required. The name of the speaker to use. Should be the same as in the prompt."""
8328
8481
 
8482
+ voice_config: Optional[VoiceConfigDict]
8483
+ """Required. The configuration for the voice to use."""
8329
8484
 
8330
- _DeleteModelParametersOrDict = Union[
8331
- _DeleteModelParameters, _DeleteModelParametersDict
8332
- ]
8333
8485
 
8486
+ SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
8334
8487
 
8335
- class DeleteModelResponse(_common.BaseModel):
8336
8488
 
8337
- sdk_http_response: Optional[HttpResponse] = Field(
8338
- default=None, description="""Used to retain the full HTTP response."""
8489
+ class MultiSpeakerVoiceConfig(_common.BaseModel):
8490
+ """The configuration for the multi-speaker setup.
8491
+
8492
+ This data type is not supported in Vertex AI.
8493
+ """
8494
+
8495
+ speaker_voice_configs: Optional[list[SpeakerVoiceConfig]] = Field(
8496
+ default=None, description="""Required. All the enabled speaker voices."""
8339
8497
  )
8340
8498
 
8341
8499
 
8342
- class DeleteModelResponseDict(TypedDict, total=False):
8500
+ class MultiSpeakerVoiceConfigDict(TypedDict, total=False):
8501
+ """The configuration for the multi-speaker setup.
8343
8502
 
8344
- sdk_http_response: Optional[HttpResponseDict]
8345
- """Used to retain the full HTTP response."""
8503
+ This data type is not supported in Vertex AI.
8504
+ """
8346
8505
 
8506
+ speaker_voice_configs: Optional[list[SpeakerVoiceConfigDict]]
8507
+ """Required. All the enabled speaker voices."""
8347
8508
 
8348
- DeleteModelResponseOrDict = Union[DeleteModelResponse, DeleteModelResponseDict]
8509
+
8510
+ MultiSpeakerVoiceConfigOrDict = Union[
8511
+ MultiSpeakerVoiceConfig, MultiSpeakerVoiceConfigDict
8512
+ ]
8349
8513
 
8350
8514
 
8351
8515
  class GenerationConfig(_common.BaseModel):
@@ -8356,7 +8520,7 @@ class GenerationConfig(_common.BaseModel):
8356
8520
  )
8357
8521
  audio_timestamp: Optional[bool] = Field(
8358
8522
  default=None,
8359
- description="""Optional. If enabled, audio timestamp will be included in the request to the model.""",
8523
+ description="""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API.""",
8360
8524
  )
8361
8525
  candidate_count: Optional[int] = Field(
8362
8526
  default=None,
@@ -8364,7 +8528,7 @@ class GenerationConfig(_common.BaseModel):
8364
8528
  )
8365
8529
  enable_affective_dialog: Optional[bool] = Field(
8366
8530
  default=None,
8367
- description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly.""",
8531
+ description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly. This field is not supported in Gemini API.""",
8368
8532
  )
8369
8533
  frequency_penalty: Optional[float] = Field(
8370
8534
  default=None, description="""Optional. Frequency penalties."""
@@ -8403,7 +8567,8 @@ class GenerationConfig(_common.BaseModel):
8403
8567
  description="""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.""",
8404
8568
  )
8405
8569
  routing_config: Optional[GenerationConfigRoutingConfig] = Field(
8406
- default=None, description="""Optional. Routing configuration."""
8570
+ default=None,
8571
+ description="""Optional. Routing configuration. This field is not supported in Gemini API.""",
8407
8572
  )
8408
8573
  seed: Optional[int] = Field(default=None, description="""Optional. Seed.""")
8409
8574
  speech_config: Optional[SpeechConfig] = Field(
@@ -8430,7 +8595,7 @@ class GenerationConfig(_common.BaseModel):
8430
8595
  )
8431
8596
  enable_enhanced_civic_answers: Optional[bool] = Field(
8432
8597
  default=None,
8433
- description="""Optional. Enables enhanced civic answers. It may not be available for all models.""",
8598
+ description="""Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI.""",
8434
8599
  )
8435
8600
 
8436
8601
 
@@ -8441,13 +8606,13 @@ class GenerationConfigDict(TypedDict, total=False):
8441
8606
  """Optional. Config for model selection."""
8442
8607
 
8443
8608
  audio_timestamp: Optional[bool]
8444
- """Optional. If enabled, audio timestamp will be included in the request to the model."""
8609
+ """Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API."""
8445
8610
 
8446
8611
  candidate_count: Optional[int]
8447
8612
  """Optional. Number of candidates to generate."""
8448
8613
 
8449
8614
  enable_affective_dialog: Optional[bool]
8450
- """Optional. If enabled, the model will detect emotions and adapt its responses accordingly."""
8615
+ """Optional. If enabled, the model will detect emotions and adapt its responses accordingly. This field is not supported in Gemini API."""
8451
8616
 
8452
8617
  frequency_penalty: Optional[float]
8453
8618
  """Optional. Frequency penalties."""
@@ -8480,7 +8645,7 @@ class GenerationConfigDict(TypedDict, total=False):
8480
8645
  """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."""
8481
8646
 
8482
8647
  routing_config: Optional[GenerationConfigRoutingConfigDict]
8483
- """Optional. Routing configuration."""
8648
+ """Optional. Routing configuration. This field is not supported in Gemini API."""
8484
8649
 
8485
8650
  seed: Optional[int]
8486
8651
  """Optional. Seed."""
@@ -8504,7 +8669,7 @@ class GenerationConfigDict(TypedDict, total=False):
8504
8669
  """Optional. If specified, nucleus sampling will be used."""
8505
8670
 
8506
8671
  enable_enhanced_civic_answers: Optional[bool]
8507
- """Optional. Enables enhanced civic answers. It may not be available for all models."""
8672
+ """Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI."""
8508
8673
 
8509
8674
 
8510
8675
  GenerationConfigOrDict = Union[GenerationConfig, GenerationConfigDict]
@@ -9320,92 +9485,271 @@ class TunedModelCheckpoint(_common.BaseModel):
9320
9485
  )
9321
9486
  step: Optional[int] = Field(
9322
9487
  default=None,
9323
- description="""The step of the checkpoint.
9324
- """,
9488
+ description="""The step of the checkpoint.
9489
+ """,
9490
+ )
9491
+ endpoint: Optional[str] = Field(
9492
+ default=None,
9493
+ description="""The Endpoint resource name that the checkpoint is deployed to.
9494
+ Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9495
+ """,
9496
+ )
9497
+
9498
+
9499
+ class TunedModelCheckpointDict(TypedDict, total=False):
9500
+ """TunedModelCheckpoint for the Tuned Model of a Tuning Job."""
9501
+
9502
+ checkpoint_id: Optional[str]
9503
+ """The ID of the checkpoint.
9504
+ """
9505
+
9506
+ epoch: Optional[int]
9507
+ """The epoch of the checkpoint.
9508
+ """
9509
+
9510
+ step: Optional[int]
9511
+ """The step of the checkpoint.
9512
+ """
9513
+
9514
+ endpoint: Optional[str]
9515
+ """The Endpoint resource name that the checkpoint is deployed to.
9516
+ Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9517
+ """
9518
+
9519
+
9520
+ TunedModelCheckpointOrDict = Union[
9521
+ TunedModelCheckpoint, TunedModelCheckpointDict
9522
+ ]
9523
+
9524
+
9525
+ class TunedModel(_common.BaseModel):
9526
+ """TunedModel for the Tuned Model of a Tuning Job."""
9527
+
9528
+ model: Optional[str] = Field(
9529
+ default=None,
9530
+ description="""Output only. The resource name of the TunedModel.
9531
+ Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
9532
+ When tuning from a base model, the version_id will be 1.
9533
+ For continuous tuning, the version id will be incremented by 1 from the
9534
+ last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
9535
+ """,
9536
+ )
9537
+ endpoint: Optional[str] = Field(
9538
+ default=None,
9539
+ description="""Output only. A resource name of an Endpoint.
9540
+ Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9541
+ """,
9542
+ )
9543
+ checkpoints: Optional[list[TunedModelCheckpoint]] = Field(
9544
+ default=None,
9545
+ description="""The checkpoints associated with this TunedModel.
9546
+ This field is only populated for tuning jobs that enable intermediate
9547
+ checkpoints.""",
9548
+ )
9549
+
9550
+
9551
+ class TunedModelDict(TypedDict, total=False):
9552
+ """TunedModel for the Tuned Model of a Tuning Job."""
9553
+
9554
+ model: Optional[str]
9555
+ """Output only. The resource name of the TunedModel.
9556
+ Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
9557
+ When tuning from a base model, the version_id will be 1.
9558
+ For continuous tuning, the version id will be incremented by 1 from the
9559
+ last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
9560
+ """
9561
+
9562
+ endpoint: Optional[str]
9563
+ """Output only. A resource name of an Endpoint.
9564
+ Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9565
+ """
9566
+
9567
+ checkpoints: Optional[list[TunedModelCheckpointDict]]
9568
+ """The checkpoints associated with this TunedModel.
9569
+ This field is only populated for tuning jobs that enable intermediate
9570
+ checkpoints."""
9571
+
9572
+
9573
+ TunedModelOrDict = Union[TunedModel, TunedModelDict]
9574
+
9575
+
9576
+ class SupervisedHyperParameters(_common.BaseModel):
9577
+ """Hyperparameters for SFT. This data type is not supported in Gemini API."""
9578
+
9579
+ adapter_size: Optional[AdapterSize] = Field(
9580
+ default=None, description="""Optional. Adapter size for tuning."""
9581
+ )
9582
+ batch_size: Optional[int] = Field(
9583
+ default=None,
9584
+ description="""Optional. Batch size for tuning. This feature is only available for open source models.""",
9585
+ )
9586
+ epoch_count: Optional[int] = Field(
9587
+ default=None,
9588
+ description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
9589
+ )
9590
+ learning_rate: Optional[float] = Field(
9591
+ default=None,
9592
+ description="""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models.""",
9593
+ )
9594
+ learning_rate_multiplier: Optional[float] = Field(
9595
+ default=None,
9596
+ description="""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models.""",
9597
+ )
9598
+
9599
+
9600
+ class SupervisedHyperParametersDict(TypedDict, total=False):
9601
+ """Hyperparameters for SFT. This data type is not supported in Gemini API."""
9602
+
9603
+ adapter_size: Optional[AdapterSize]
9604
+ """Optional. Adapter size for tuning."""
9605
+
9606
+ batch_size: Optional[int]
9607
+ """Optional. Batch size for tuning. This feature is only available for open source models."""
9608
+
9609
+ epoch_count: Optional[int]
9610
+ """Optional. Number of complete passes the model makes over the entire training dataset during training."""
9611
+
9612
+ learning_rate: Optional[float]
9613
+ """Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models."""
9614
+
9615
+ learning_rate_multiplier: Optional[float]
9616
+ """Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models."""
9617
+
9618
+
9619
+ SupervisedHyperParametersOrDict = Union[
9620
+ SupervisedHyperParameters, SupervisedHyperParametersDict
9621
+ ]
9622
+
9623
+
9624
+ class SupervisedTuningSpec(_common.BaseModel):
9625
+ """Supervised tuning spec for tuning."""
9626
+
9627
+ export_last_checkpoint_only: Optional[bool] = Field(
9628
+ default=None,
9629
+ description="""Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false.""",
9630
+ )
9631
+ hyper_parameters: Optional[SupervisedHyperParameters] = Field(
9632
+ default=None, description="""Optional. Hyperparameters for SFT."""
9633
+ )
9634
+ training_dataset_uri: Optional[str] = Field(
9635
+ default=None,
9636
+ description="""Required. 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.""",
9637
+ )
9638
+ tuning_mode: Optional[TuningMode] = Field(
9639
+ default=None, description="""Tuning mode."""
9640
+ )
9641
+ validation_dataset_uri: Optional[str] = Field(
9642
+ default=None,
9643
+ description="""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.""",
9644
+ )
9645
+
9646
+
9647
+ class SupervisedTuningSpecDict(TypedDict, total=False):
9648
+ """Supervised tuning spec for tuning."""
9649
+
9650
+ export_last_checkpoint_only: Optional[bool]
9651
+ """Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false."""
9652
+
9653
+ hyper_parameters: Optional[SupervisedHyperParametersDict]
9654
+ """Optional. Hyperparameters for SFT."""
9655
+
9656
+ training_dataset_uri: Optional[str]
9657
+ """Required. 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."""
9658
+
9659
+ tuning_mode: Optional[TuningMode]
9660
+ """Tuning mode."""
9661
+
9662
+ validation_dataset_uri: Optional[str]
9663
+ """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."""
9664
+
9665
+
9666
+ SupervisedTuningSpecOrDict = Union[
9667
+ SupervisedTuningSpec, SupervisedTuningSpecDict
9668
+ ]
9669
+
9670
+
9671
+ class PreferenceOptimizationHyperParameters(_common.BaseModel):
9672
+ """Hyperparameters for Preference Optimization.
9673
+
9674
+ This data type is not supported in Gemini API.
9675
+ """
9676
+
9677
+ adapter_size: Optional[AdapterSize] = Field(
9678
+ default=None,
9679
+ description="""Optional. Adapter size for preference optimization.""",
9680
+ )
9681
+ beta: Optional[float] = Field(
9682
+ default=None,
9683
+ description="""Optional. Weight for KL Divergence regularization.""",
9684
+ )
9685
+ epoch_count: Optional[int] = Field(
9686
+ default=None,
9687
+ description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
9325
9688
  )
9326
- endpoint: Optional[str] = Field(
9689
+ learning_rate_multiplier: Optional[float] = Field(
9327
9690
  default=None,
9328
- description="""The Endpoint resource name that the checkpoint is deployed to.
9329
- Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9330
- """,
9691
+ description="""Optional. Multiplier for adjusting the default learning rate.""",
9331
9692
  )
9332
9693
 
9333
9694
 
9334
- class TunedModelCheckpointDict(TypedDict, total=False):
9335
- """TunedModelCheckpoint for the Tuned Model of a Tuning Job."""
9695
+ class PreferenceOptimizationHyperParametersDict(TypedDict, total=False):
9696
+ """Hyperparameters for Preference Optimization.
9336
9697
 
9337
- checkpoint_id: Optional[str]
9338
- """The ID of the checkpoint.
9339
- """
9698
+ This data type is not supported in Gemini API.
9699
+ """
9340
9700
 
9341
- epoch: Optional[int]
9342
- """The epoch of the checkpoint.
9343
- """
9701
+ adapter_size: Optional[AdapterSize]
9702
+ """Optional. Adapter size for preference optimization."""
9344
9703
 
9345
- step: Optional[int]
9346
- """The step of the checkpoint.
9347
- """
9704
+ beta: Optional[float]
9705
+ """Optional. Weight for KL Divergence regularization."""
9348
9706
 
9349
- endpoint: Optional[str]
9350
- """The Endpoint resource name that the checkpoint is deployed to.
9351
- Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9352
- """
9707
+ epoch_count: Optional[int]
9708
+ """Optional. Number of complete passes the model makes over the entire training dataset during training."""
9353
9709
 
9710
+ learning_rate_multiplier: Optional[float]
9711
+ """Optional. Multiplier for adjusting the default learning rate."""
9354
9712
 
9355
- TunedModelCheckpointOrDict = Union[
9356
- TunedModelCheckpoint, TunedModelCheckpointDict
9713
+
9714
+ PreferenceOptimizationHyperParametersOrDict = Union[
9715
+ PreferenceOptimizationHyperParameters,
9716
+ PreferenceOptimizationHyperParametersDict,
9357
9717
  ]
9358
9718
 
9359
9719
 
9360
- class TunedModel(_common.BaseModel):
9361
- """TunedModel for the Tuned Model of a Tuning Job."""
9720
+ class PreferenceOptimizationSpec(_common.BaseModel):
9721
+ """Preference optimization tuning spec for tuning."""
9362
9722
 
9363
- model: Optional[str] = Field(
9723
+ hyper_parameters: Optional[PreferenceOptimizationHyperParameters] = Field(
9364
9724
  default=None,
9365
- description="""Output only. The resource name of the TunedModel.
9366
- Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
9367
- When tuning from a base model, the version_id will be 1.
9368
- For continuous tuning, the version id will be incremented by 1 from the
9369
- last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
9370
- """,
9725
+ description="""Optional. Hyperparameters for Preference Optimization.""",
9371
9726
  )
9372
- endpoint: Optional[str] = Field(
9727
+ training_dataset_uri: Optional[str] = Field(
9373
9728
  default=None,
9374
- description="""Output only. A resource name of an Endpoint.
9375
- Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9376
- """,
9729
+ description="""Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file.""",
9377
9730
  )
9378
- checkpoints: Optional[list[TunedModelCheckpoint]] = Field(
9731
+ validation_dataset_uri: Optional[str] = Field(
9379
9732
  default=None,
9380
- description="""The checkpoints associated with this TunedModel.
9381
- This field is only populated for tuning jobs that enable intermediate
9382
- checkpoints.""",
9733
+ description="""Optional. Cloud Storage path to file containing validation dataset for preference optimization tuning. The dataset must be formatted as a JSONL file.""",
9383
9734
  )
9384
9735
 
9385
9736
 
9386
- class TunedModelDict(TypedDict, total=False):
9387
- """TunedModel for the Tuned Model of a Tuning Job."""
9737
+ class PreferenceOptimizationSpecDict(TypedDict, total=False):
9738
+ """Preference optimization tuning spec for tuning."""
9388
9739
 
9389
- model: Optional[str]
9390
- """Output only. The resource name of the TunedModel.
9391
- Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
9392
- When tuning from a base model, the version_id will be 1.
9393
- For continuous tuning, the version id will be incremented by 1 from the
9394
- last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
9395
- """
9740
+ hyper_parameters: Optional[PreferenceOptimizationHyperParametersDict]
9741
+ """Optional. Hyperparameters for Preference Optimization."""
9396
9742
 
9397
- endpoint: Optional[str]
9398
- """Output only. A resource name of an Endpoint.
9399
- Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
9400
- """
9743
+ training_dataset_uri: Optional[str]
9744
+ """Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file."""
9401
9745
 
9402
- checkpoints: Optional[list[TunedModelCheckpointDict]]
9403
- """The checkpoints associated with this TunedModel.
9404
- This field is only populated for tuning jobs that enable intermediate
9405
- checkpoints."""
9746
+ validation_dataset_uri: Optional[str]
9747
+ """Optional. Cloud Storage path to file containing validation dataset for preference optimization tuning. The dataset must be formatted as a JSONL file."""
9406
9748
 
9407
9749
 
9408
- TunedModelOrDict = Union[TunedModel, TunedModelDict]
9750
+ PreferenceOptimizationSpecOrDict = Union[
9751
+ PreferenceOptimizationSpec, PreferenceOptimizationSpecDict
9752
+ ]
9409
9753
 
9410
9754
 
9411
9755
  class GcsDestination(_common.BaseModel):
@@ -9682,7 +10026,8 @@ class GoogleRpcStatus(_common.BaseModel):
9682
10026
  It is used by [gRPC](https://github.com/grpc). Each `Status` message contains
9683
10027
  three pieces of data: error code, error message, and error details. You can
9684
10028
  find out more about this error model and how to work with it in the [API
9685
- Design Guide](https://cloud.google.com/apis/design/errors).
10029
+ Design Guide](https://cloud.google.com/apis/design/errors). This data type is
10030
+ not supported in Gemini API.
9686
10031
  """
9687
10032
 
9688
10033
  code: Optional[int] = Field(
@@ -9705,7 +10050,8 @@ class GoogleRpcStatusDict(TypedDict, total=False):
9705
10050
  It is used by [gRPC](https://github.com/grpc). Each `Status` message contains
9706
10051
  three pieces of data: error code, error message, and error details. You can
9707
10052
  find out more about this error model and how to work with it in the [API
9708
- Design Guide](https://cloud.google.com/apis/design/errors).
10053
+ Design Guide](https://cloud.google.com/apis/design/errors). This data type is
10054
+ not supported in Gemini API.
9709
10055
  """
9710
10056
 
9711
10057
  code: Optional[int]
@@ -9722,7 +10068,10 @@ GoogleRpcStatusOrDict = Union[GoogleRpcStatus, GoogleRpcStatusDict]
9722
10068
 
9723
10069
 
9724
10070
  class PreTunedModel(_common.BaseModel):
9725
- """A pre-tuned model for continuous tuning."""
10071
+ """A pre-tuned model for continuous tuning.
10072
+
10073
+ This data type is not supported in Gemini API.
10074
+ """
9726
10075
 
9727
10076
  base_model: Optional[str] = Field(
9728
10077
  default=None,
@@ -9739,7 +10088,10 @@ class PreTunedModel(_common.BaseModel):
9739
10088
 
9740
10089
 
9741
10090
  class PreTunedModelDict(TypedDict, total=False):
9742
- """A pre-tuned model for continuous tuning."""
10091
+ """A pre-tuned model for continuous tuning.
10092
+
10093
+ This data type is not supported in Gemini API.
10094
+ """
9743
10095
 
9744
10096
  base_model: Optional[str]
9745
10097
  """Output only. The name of the base model this PreTunedModel was tuned from."""
@@ -9754,103 +10106,11 @@ class PreTunedModelDict(TypedDict, total=False):
9754
10106
  PreTunedModelOrDict = Union[PreTunedModel, PreTunedModelDict]
9755
10107
 
9756
10108
 
9757
- class SupervisedHyperParameters(_common.BaseModel):
9758
- """Hyperparameters for SFT."""
9759
-
9760
- adapter_size: Optional[AdapterSize] = Field(
9761
- default=None, description="""Optional. Adapter size for tuning."""
9762
- )
9763
- batch_size: Optional[int] = Field(
9764
- default=None,
9765
- description="""Optional. Batch size for tuning. This feature is only available for open source models.""",
9766
- )
9767
- epoch_count: Optional[int] = Field(
9768
- default=None,
9769
- description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
9770
- )
9771
- learning_rate: Optional[float] = Field(
9772
- default=None,
9773
- description="""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models.""",
9774
- )
9775
- learning_rate_multiplier: Optional[float] = Field(
9776
- default=None,
9777
- description="""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models.""",
9778
- )
9779
-
9780
-
9781
- class SupervisedHyperParametersDict(TypedDict, total=False):
9782
- """Hyperparameters for SFT."""
9783
-
9784
- adapter_size: Optional[AdapterSize]
9785
- """Optional. Adapter size for tuning."""
9786
-
9787
- batch_size: Optional[int]
9788
- """Optional. Batch size for tuning. This feature is only available for open source models."""
9789
-
9790
- epoch_count: Optional[int]
9791
- """Optional. Number of complete passes the model makes over the entire training dataset during training."""
9792
-
9793
- learning_rate: Optional[float]
9794
- """Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models."""
9795
-
9796
- learning_rate_multiplier: Optional[float]
9797
- """Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models."""
9798
-
9799
-
9800
- SupervisedHyperParametersOrDict = Union[
9801
- SupervisedHyperParameters, SupervisedHyperParametersDict
9802
- ]
9803
-
9804
-
9805
- class SupervisedTuningSpec(_common.BaseModel):
9806
- """Tuning Spec for Supervised Tuning for first party models."""
9807
-
9808
- export_last_checkpoint_only: Optional[bool] = Field(
9809
- default=None,
9810
- description="""Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false.""",
9811
- )
9812
- hyper_parameters: Optional[SupervisedHyperParameters] = Field(
9813
- default=None, description="""Optional. Hyperparameters for SFT."""
9814
- )
9815
- training_dataset_uri: Optional[str] = Field(
9816
- default=None,
9817
- description="""Required. 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.""",
9818
- )
9819
- tuning_mode: Optional[TuningMode] = Field(
9820
- default=None, description="""Tuning mode."""
9821
- )
9822
- validation_dataset_uri: Optional[str] = Field(
9823
- default=None,
9824
- description="""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.""",
9825
- )
9826
-
9827
-
9828
- class SupervisedTuningSpecDict(TypedDict, total=False):
9829
- """Tuning Spec for Supervised Tuning for first party models."""
9830
-
9831
- export_last_checkpoint_only: Optional[bool]
9832
- """Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false."""
9833
-
9834
- hyper_parameters: Optional[SupervisedHyperParametersDict]
9835
- """Optional. Hyperparameters for SFT."""
9836
-
9837
- training_dataset_uri: Optional[str]
9838
- """Required. 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."""
9839
-
9840
- tuning_mode: Optional[TuningMode]
9841
- """Tuning mode."""
9842
-
9843
- validation_dataset_uri: Optional[str]
9844
- """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."""
9845
-
9846
-
9847
- SupervisedTuningSpecOrDict = Union[
9848
- SupervisedTuningSpec, SupervisedTuningSpecDict
9849
- ]
9850
-
9851
-
9852
10109
  class DatasetDistributionDistributionBucket(_common.BaseModel):
9853
- """Dataset bucket used to create a histogram for the distribution given a population of values."""
10110
+ """Dataset bucket used to create a histogram for the distribution given a population of values.
10111
+
10112
+ This data type is not supported in Gemini API.
10113
+ """
9854
10114
 
9855
10115
  count: Optional[int] = Field(
9856
10116
  default=None,
@@ -9865,7 +10125,10 @@ class DatasetDistributionDistributionBucket(_common.BaseModel):
9865
10125
 
9866
10126
 
9867
10127
  class DatasetDistributionDistributionBucketDict(TypedDict, total=False):
9868
- """Dataset bucket used to create a histogram for the distribution given a population of values."""
10128
+ """Dataset bucket used to create a histogram for the distribution given a population of values.
10129
+
10130
+ This data type is not supported in Gemini API.
10131
+ """
9869
10132
 
9870
10133
  count: Optional[int]
9871
10134
  """Output only. Number of values in the bucket."""
@@ -9884,7 +10147,10 @@ DatasetDistributionDistributionBucketOrDict = Union[
9884
10147
 
9885
10148
 
9886
10149
  class DatasetDistribution(_common.BaseModel):
9887
- """Distribution computed over a tuning dataset."""
10150
+ """Distribution computed over a tuning dataset.
10151
+
10152
+ This data type is not supported in Gemini API.
10153
+ """
9888
10154
 
9889
10155
  buckets: Optional[list[DatasetDistributionDistributionBucket]] = Field(
9890
10156
  default=None, description="""Output only. Defines the histogram bucket."""
@@ -9920,7 +10186,10 @@ class DatasetDistribution(_common.BaseModel):
9920
10186
 
9921
10187
 
9922
10188
  class DatasetDistributionDict(TypedDict, total=False):
9923
- """Distribution computed over a tuning dataset."""
10189
+ """Distribution computed over a tuning dataset.
10190
+
10191
+ This data type is not supported in Gemini API.
10192
+ """
9924
10193
 
9925
10194
  buckets: Optional[list[DatasetDistributionDistributionBucketDict]]
9926
10195
  """Output only. Defines the histogram bucket."""
@@ -9951,7 +10220,10 @@ DatasetDistributionOrDict = Union[DatasetDistribution, DatasetDistributionDict]
9951
10220
 
9952
10221
 
9953
10222
  class DatasetStats(_common.BaseModel):
9954
- """Statistics computed over a tuning dataset."""
10223
+ """Statistics computed over a tuning dataset.
10224
+
10225
+ This data type is not supported in Gemini API.
10226
+ """
9955
10227
 
9956
10228
  total_billable_character_count: Optional[int] = Field(
9957
10229
  default=None,
@@ -9988,7 +10260,10 @@ class DatasetStats(_common.BaseModel):
9988
10260
 
9989
10261
 
9990
10262
  class DatasetStatsDict(TypedDict, total=False):
9991
- """Statistics computed over a tuning dataset."""
10263
+ """Statistics computed over a tuning dataset.
10264
+
10265
+ This data type is not supported in Gemini API.
10266
+ """
9992
10267
 
9993
10268
  total_billable_character_count: Optional[int]
9994
10269
  """Output only. Number of billable characters in the tuning dataset."""
@@ -10019,7 +10294,10 @@ DatasetStatsOrDict = Union[DatasetStats, DatasetStatsDict]
10019
10294
 
10020
10295
 
10021
10296
  class DistillationDataStats(_common.BaseModel):
10022
- """Statistics computed for datasets used for distillation."""
10297
+ """Statistics computed for datasets used for distillation.
10298
+
10299
+ This data type is not supported in Gemini API.
10300
+ """
10023
10301
 
10024
10302
  training_dataset_stats: Optional[DatasetStats] = Field(
10025
10303
  default=None,
@@ -10028,7 +10306,10 @@ class DistillationDataStats(_common.BaseModel):
10028
10306
 
10029
10307
 
10030
10308
  class DistillationDataStatsDict(TypedDict, total=False):
10031
- """Statistics computed for datasets used for distillation."""
10309
+ """Statistics computed for datasets used for distillation.
10310
+
10311
+ This data type is not supported in Gemini API.
10312
+ """
10032
10313
 
10033
10314
  training_dataset_stats: Optional[DatasetStatsDict]
10034
10315
  """Output only. Statistics computed for the training dataset."""
@@ -10040,7 +10321,10 @@ DistillationDataStatsOrDict = Union[
10040
10321
 
10041
10322
 
10042
10323
  class GeminiPreferenceExampleCompletion(_common.BaseModel):
10043
- """Completion and its preference score."""
10324
+ """Completion and its preference score.
10325
+
10326
+ This data type is not supported in Gemini API.
10327
+ """
10044
10328
 
10045
10329
  completion: Optional[Content] = Field(
10046
10330
  default=None,
@@ -10052,7 +10336,10 @@ class GeminiPreferenceExampleCompletion(_common.BaseModel):
10052
10336
 
10053
10337
 
10054
10338
  class GeminiPreferenceExampleCompletionDict(TypedDict, total=False):
10055
- """Completion and its preference score."""
10339
+ """Completion and its preference score.
10340
+
10341
+ This data type is not supported in Gemini API.
10342
+ """
10056
10343
 
10057
10344
  completion: Optional[ContentDict]
10058
10345
  """Single turn completion for the given prompt."""
@@ -10067,7 +10354,10 @@ GeminiPreferenceExampleCompletionOrDict = Union[
10067
10354
 
10068
10355
 
10069
10356
  class GeminiPreferenceExample(_common.BaseModel):
10070
- """Input example for preference optimization."""
10357
+ """Input example for preference optimization.
10358
+
10359
+ This data type is not supported in Gemini API.
10360
+ """
10071
10361
 
10072
10362
  completions: Optional[list[GeminiPreferenceExampleCompletion]] = Field(
10073
10363
  default=None, description="""List of completions for a given prompt."""
@@ -10079,7 +10369,10 @@ class GeminiPreferenceExample(_common.BaseModel):
10079
10369
 
10080
10370
 
10081
10371
  class GeminiPreferenceExampleDict(TypedDict, total=False):
10082
- """Input example for preference optimization."""
10372
+ """Input example for preference optimization.
10373
+
10374
+ This data type is not supported in Gemini API.
10375
+ """
10083
10376
 
10084
10377
  completions: Optional[list[GeminiPreferenceExampleCompletionDict]]
10085
10378
  """List of completions for a given prompt."""
@@ -10094,7 +10387,10 @@ GeminiPreferenceExampleOrDict = Union[
10094
10387
 
10095
10388
 
10096
10389
  class PreferenceOptimizationDataStats(_common.BaseModel):
10097
- """Statistics computed for datasets used for preference optimization."""
10390
+ """Statistics computed for datasets used for preference optimization.
10391
+
10392
+ This data type is not supported in Gemini API.
10393
+ """
10098
10394
 
10099
10395
  score_variance_per_example_distribution: Optional[DatasetDistribution] = (
10100
10396
  Field(
@@ -10133,7 +10429,10 @@ class PreferenceOptimizationDataStats(_common.BaseModel):
10133
10429
 
10134
10430
 
10135
10431
  class PreferenceOptimizationDataStatsDict(TypedDict, total=False):
10136
- """Statistics computed for datasets used for preference optimization."""
10432
+ """Statistics computed for datasets used for preference optimization.
10433
+
10434
+ This data type is not supported in Gemini API.
10435
+ """
10137
10436
 
10138
10437
  score_variance_per_example_distribution: Optional[DatasetDistributionDict]
10139
10438
  """Output only. Dataset distributions for scores variance per example."""
@@ -10166,7 +10465,10 @@ PreferenceOptimizationDataStatsOrDict = Union[
10166
10465
 
10167
10466
 
10168
10467
  class SupervisedTuningDatasetDistributionDatasetBucket(_common.BaseModel):
10169
- """Dataset bucket used to create a histogram for the distribution given a population of values."""
10468
+ """Dataset bucket used to create a histogram for the distribution given a population of values.
10469
+
10470
+ This data type is not supported in Gemini API.
10471
+ """
10170
10472
 
10171
10473
  count: Optional[float] = Field(
10172
10474
  default=None,
@@ -10183,7 +10485,10 @@ class SupervisedTuningDatasetDistributionDatasetBucket(_common.BaseModel):
10183
10485
  class SupervisedTuningDatasetDistributionDatasetBucketDict(
10184
10486
  TypedDict, total=False
10185
10487
  ):
10186
- """Dataset bucket used to create a histogram for the distribution given a population of values."""
10488
+ """Dataset bucket used to create a histogram for the distribution given a population of values.
10489
+
10490
+ This data type is not supported in Gemini API.
10491
+ """
10187
10492
 
10188
10493
  count: Optional[float]
10189
10494
  """Output only. Number of values in the bucket."""
@@ -10202,7 +10507,10 @@ SupervisedTuningDatasetDistributionDatasetBucketOrDict = Union[
10202
10507
 
10203
10508
 
10204
10509
  class SupervisedTuningDatasetDistribution(_common.BaseModel):
10205
- """Dataset distribution for Supervised Tuning."""
10510
+ """Dataset distribution for Supervised Tuning.
10511
+
10512
+ This data type is not supported in Gemini API.
10513
+ """
10206
10514
 
10207
10515
  billable_sum: Optional[int] = Field(
10208
10516
  default=None,
@@ -10245,7 +10553,10 @@ class SupervisedTuningDatasetDistribution(_common.BaseModel):
10245
10553
 
10246
10554
 
10247
10555
  class SupervisedTuningDatasetDistributionDict(TypedDict, total=False):
10248
- """Dataset distribution for Supervised Tuning."""
10556
+ """Dataset distribution for Supervised Tuning.
10557
+
10558
+ This data type is not supported in Gemini API.
10559
+ """
10249
10560
 
10250
10561
  billable_sum: Optional[int]
10251
10562
  """Output only. Sum of a given population of values that are billable."""
@@ -10281,7 +10592,10 @@ SupervisedTuningDatasetDistributionOrDict = Union[
10281
10592
 
10282
10593
 
10283
10594
  class SupervisedTuningDataStats(_common.BaseModel):
10284
- """Tuning data statistics for Supervised Tuning."""
10595
+ """Tuning data statistics for Supervised Tuning.
10596
+
10597
+ This data type is not supported in Gemini API.
10598
+ """
10285
10599
 
10286
10600
  dropped_example_reasons: Optional[list[str]] = Field(
10287
10601
  default=None,
@@ -10340,7 +10654,10 @@ class SupervisedTuningDataStats(_common.BaseModel):
10340
10654
 
10341
10655
 
10342
10656
  class SupervisedTuningDataStatsDict(TypedDict, total=False):
10343
- """Tuning data statistics for Supervised Tuning."""
10657
+ """Tuning data statistics for Supervised Tuning.
10658
+
10659
+ This data type is not supported in Gemini API.
10660
+ """
10344
10661
 
10345
10662
  dropped_example_reasons: Optional[list[str]]
10346
10663
  """Output only. For each index in `truncated_example_indices`, the user-facing reason why the example was dropped."""
@@ -10391,7 +10708,10 @@ SupervisedTuningDataStatsOrDict = Union[
10391
10708
 
10392
10709
 
10393
10710
  class TuningDataStats(_common.BaseModel):
10394
- """The tuning data statistic values for TuningJob."""
10711
+ """The tuning data statistic values for TuningJob.
10712
+
10713
+ This data type is not supported in Gemini API.
10714
+ """
10395
10715
 
10396
10716
  distillation_data_stats: Optional[DistillationDataStats] = Field(
10397
10717
  default=None, description="""Output only. Statistics for distillation."""
@@ -10408,7 +10728,10 @@ class TuningDataStats(_common.BaseModel):
10408
10728
 
10409
10729
 
10410
10730
  class TuningDataStatsDict(TypedDict, total=False):
10411
- """The tuning data statistic values for TuningJob."""
10731
+ """The tuning data statistic values for TuningJob.
10732
+
10733
+ This data type is not supported in Gemini API.
10734
+ """
10412
10735
 
10413
10736
  distillation_data_stats: Optional[DistillationDataStatsDict]
10414
10737
  """Output only. Statistics for distillation."""
@@ -10426,7 +10749,10 @@ TuningDataStatsOrDict = Union[TuningDataStats, TuningDataStatsDict]
10426
10749
 
10427
10750
 
10428
10751
  class EncryptionSpec(_common.BaseModel):
10429
- """Represents a customer-managed encryption key spec that can be applied to a top-level resource."""
10752
+ """Represents a customer-managed encryption key spec that can be applied to a top-level resource.
10753
+
10754
+ This data type is not supported in Gemini API.
10755
+ """
10430
10756
 
10431
10757
  kms_key_name: Optional[str] = Field(
10432
10758
  default=None,
@@ -10435,7 +10761,10 @@ class EncryptionSpec(_common.BaseModel):
10435
10761
 
10436
10762
 
10437
10763
  class EncryptionSpecDict(TypedDict, total=False):
10438
- """Represents a customer-managed encryption key spec that can be applied to a top-level resource."""
10764
+ """Represents a customer-managed encryption key spec that can be applied to a top-level resource.
10765
+
10766
+ This data type is not supported in Gemini API.
10767
+ """
10439
10768
 
10440
10769
  kms_key_name: Optional[str]
10441
10770
  """Required. 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."""
@@ -10445,7 +10774,10 @@ EncryptionSpecOrDict = Union[EncryptionSpec, EncryptionSpecDict]
10445
10774
 
10446
10775
 
10447
10776
  class PartnerModelTuningSpec(_common.BaseModel):
10448
- """Tuning spec for Partner models."""
10777
+ """Tuning spec for Partner models.
10778
+
10779
+ This data type is not supported in Gemini API.
10780
+ """
10449
10781
 
10450
10782
  hyper_parameters: Optional[dict[str, Any]] = Field(
10451
10783
  default=None,
@@ -10462,7 +10794,10 @@ class PartnerModelTuningSpec(_common.BaseModel):
10462
10794
 
10463
10795
 
10464
10796
  class PartnerModelTuningSpecDict(TypedDict, total=False):
10465
- """Tuning spec for Partner models."""
10797
+ """Tuning spec for Partner models.
10798
+
10799
+ This data type is not supported in Gemini API.
10800
+ """
10466
10801
 
10467
10802
  hyper_parameters: Optional[dict[str, Any]]
10468
10803
  """Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model."""
@@ -10480,7 +10815,7 @@ PartnerModelTuningSpecOrDict = Union[
10480
10815
 
10481
10816
 
10482
10817
  class VeoHyperParameters(_common.BaseModel):
10483
- """Hyperparameters for Veo."""
10818
+ """Hyperparameters for Veo. This data type is not supported in Gemini API."""
10484
10819
 
10485
10820
  epoch_count: Optional[int] = Field(
10486
10821
  default=None,
@@ -10497,7 +10832,7 @@ class VeoHyperParameters(_common.BaseModel):
10497
10832
 
10498
10833
 
10499
10834
  class VeoHyperParametersDict(TypedDict, total=False):
10500
- """Hyperparameters for Veo."""
10835
+ """Hyperparameters for Veo. This data type is not supported in Gemini API."""
10501
10836
 
10502
10837
  epoch_count: Optional[int]
10503
10838
  """Optional. Number of complete passes the model makes over the entire training dataset during training."""
@@ -10513,7 +10848,10 @@ VeoHyperParametersOrDict = Union[VeoHyperParameters, VeoHyperParametersDict]
10513
10848
 
10514
10849
 
10515
10850
  class VeoTuningSpec(_common.BaseModel):
10516
- """Tuning Spec for Veo Model Tuning."""
10851
+ """Tuning Spec for Veo Model Tuning.
10852
+
10853
+ This data type is not supported in Gemini API.
10854
+ """
10517
10855
 
10518
10856
  hyper_parameters: Optional[VeoHyperParameters] = Field(
10519
10857
  default=None, description="""Optional. Hyperparameters for Veo."""
@@ -10529,7 +10867,10 @@ class VeoTuningSpec(_common.BaseModel):
10529
10867
 
10530
10868
 
10531
10869
  class VeoTuningSpecDict(TypedDict, total=False):
10532
- """Tuning Spec for Veo Model Tuning."""
10870
+ """Tuning Spec for Veo Model Tuning.
10871
+
10872
+ This data type is not supported in Gemini API.
10873
+ """
10533
10874
 
10534
10875
  hyper_parameters: Optional[VeoHyperParametersDict]
10535
10876
  """Optional. Hyperparameters for Veo."""
@@ -10596,6 +10937,9 @@ class TuningJob(_common.BaseModel):
10596
10937
  supervised_tuning_spec: Optional[SupervisedTuningSpec] = Field(
10597
10938
  default=None, description="""Tuning Spec for Supervised Fine Tuning."""
10598
10939
  )
10940
+ preference_optimization_spec: Optional[PreferenceOptimizationSpec] = Field(
10941
+ default=None, description="""Tuning Spec for Preference Optimization."""
10942
+ )
10599
10943
  tuning_data_stats: Optional[TuningDataStats] = Field(
10600
10944
  default=None,
10601
10945
  description="""Output only. The tuning data statistics associated with this TuningJob.""",
@@ -10696,6 +11040,9 @@ class TuningJobDict(TypedDict, total=False):
10696
11040
  supervised_tuning_spec: Optional[SupervisedTuningSpecDict]
10697
11041
  """Tuning Spec for Supervised Fine Tuning."""
10698
11042
 
11043
+ preference_optimization_spec: Optional[PreferenceOptimizationSpecDict]
11044
+ """Tuning Spec for Preference Optimization."""
11045
+
10699
11046
  tuning_data_stats: Optional[TuningDataStatsDict]
10700
11047
  """Output only. The tuning data statistics associated with this TuningJob."""
10701
11048
 
@@ -10868,7 +11215,10 @@ _CancelTuningJobParametersOrDict = Union[
10868
11215
 
10869
11216
 
10870
11217
  class TuningExample(_common.BaseModel):
10871
- """A single example for tuning."""
11218
+ """A single example for tuning.
11219
+
11220
+ This data type is not supported in Vertex AI.
11221
+ """
10872
11222
 
10873
11223
  output: Optional[str] = Field(
10874
11224
  default=None, description="""Required. The expected model output."""
@@ -10879,7 +11229,10 @@ class TuningExample(_common.BaseModel):
10879
11229
 
10880
11230
 
10881
11231
  class TuningExampleDict(TypedDict, total=False):
10882
- """A single example for tuning."""
11232
+ """A single example for tuning.
11233
+
11234
+ This data type is not supported in Vertex AI.
11235
+ """
10883
11236
 
10884
11237
  output: Optional[str]
10885
11238
  """Required. The expected model output."""
@@ -10932,7 +11285,7 @@ class TuningValidationDataset(_common.BaseModel):
10932
11285
  )
10933
11286
  vertex_dataset_resource: Optional[str] = Field(
10934
11287
  default=None,
10935
- description="""The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'.""",
11288
+ description="""The resource name of the Vertex Multimodal Dataset that is used as validation dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'.""",
10936
11289
  )
10937
11290
 
10938
11291
 
@@ -10942,7 +11295,7 @@ class TuningValidationDatasetDict(TypedDict, total=False):
10942
11295
  """GCS URI of the file containing validation dataset in JSONL format."""
10943
11296
 
10944
11297
  vertex_dataset_resource: Optional[str]
10945
- """The resource name of the Vertex Multimodal Dataset that is used as training dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'."""
11298
+ """The resource name of the Vertex Multimodal Dataset that is used as validation dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'."""
10946
11299
 
10947
11300
 
10948
11301
  TuningValidationDatasetOrDict = Union[
@@ -10951,14 +11304,18 @@ TuningValidationDatasetOrDict = Union[
10951
11304
 
10952
11305
 
10953
11306
  class CreateTuningJobConfig(_common.BaseModel):
10954
- """Supervised fine-tuning job creation request - optional fields."""
11307
+ """Fine-tuning job creation request - optional fields."""
10955
11308
 
10956
11309
  http_options: Optional[HttpOptions] = Field(
10957
11310
  default=None, description="""Used to override HTTP request options."""
10958
11311
  )
11312
+ method: Optional[TuningMethod] = Field(
11313
+ default=None,
11314
+ description="""The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING). If not set, the default method (SFT) will be used.""",
11315
+ )
10959
11316
  validation_dataset: Optional[TuningValidationDataset] = Field(
10960
11317
  default=None,
10961
- description="""Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file.""",
11318
+ description="""Validation dataset for tuning. The dataset must be formatted as a JSONL file.""",
10962
11319
  )
10963
11320
  tuned_model_display_name: Optional[str] = Field(
10964
11321
  default=None,
@@ -10977,7 +11334,7 @@ class CreateTuningJobConfig(_common.BaseModel):
10977
11334
  )
10978
11335
  export_last_checkpoint_only: Optional[bool] = Field(
10979
11336
  default=None,
10980
- description="""If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT.""",
11337
+ description="""If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints.""",
10981
11338
  )
10982
11339
  pre_tuned_model_checkpoint_id: Optional[str] = Field(
10983
11340
  default=None,
@@ -11001,16 +11358,23 @@ class CreateTuningJobConfig(_common.BaseModel):
11001
11358
  default=None,
11002
11359
  description="""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 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""",
11003
11360
  )
11361
+ beta: Optional[float] = Field(
11362
+ default=None,
11363
+ description="""Weight for KL Divergence regularization, Preference Optimization tuning only.""",
11364
+ )
11004
11365
 
11005
11366
 
11006
11367
  class CreateTuningJobConfigDict(TypedDict, total=False):
11007
- """Supervised fine-tuning job creation request - optional fields."""
11368
+ """Fine-tuning job creation request - optional fields."""
11008
11369
 
11009
11370
  http_options: Optional[HttpOptionsDict]
11010
11371
  """Used to override HTTP request options."""
11011
11372
 
11373
+ method: Optional[TuningMethod]
11374
+ """The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING). If not set, the default method (SFT) will be used."""
11375
+
11012
11376
  validation_dataset: Optional[TuningValidationDatasetDict]
11013
- """Cloud Storage path to file containing training dataset for tuning. The dataset must be formatted as a JSONL file."""
11377
+ """Validation dataset for tuning. The dataset must be formatted as a JSONL file."""
11014
11378
 
11015
11379
  tuned_model_display_name: Optional[str]
11016
11380
  """The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters."""
@@ -11025,7 +11389,7 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
11025
11389
  """Multiplier for adjusting the default learning rate."""
11026
11390
 
11027
11391
  export_last_checkpoint_only: Optional[bool]
11028
- """If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT."""
11392
+ """If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints."""
11029
11393
 
11030
11394
  pre_tuned_model_checkpoint_id: Optional[str]
11031
11395
  """The optional checkpoint id of the pre-tuned model to use for tuning, if applicable."""
@@ -11045,6 +11409,9 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
11045
11409
  labels: Optional[dict[str, str]]
11046
11410
  """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 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels."""
11047
11411
 
11412
+ beta: Optional[float]
11413
+ """Weight for KL Divergence regularization, Preference Optimization tuning only."""
11414
+
11048
11415
 
11049
11416
  CreateTuningJobConfigOrDict = Union[
11050
11417
  CreateTuningJobConfig, CreateTuningJobConfigDict
@@ -11052,7 +11419,7 @@ CreateTuningJobConfigOrDict = Union[
11052
11419
 
11053
11420
 
11054
11421
  class _CreateTuningJobParametersPrivate(_common.BaseModel):
11055
- """Supervised fine-tuning job creation parameters - optional fields."""
11422
+ """Fine-tuning job creation parameters - optional fields."""
11056
11423
 
11057
11424
  base_model: Optional[str] = Field(
11058
11425
  default=None,
@@ -11071,7 +11438,7 @@ class _CreateTuningJobParametersPrivate(_common.BaseModel):
11071
11438
 
11072
11439
 
11073
11440
  class _CreateTuningJobParametersPrivateDict(TypedDict, total=False):
11074
- """Supervised fine-tuning job creation parameters - optional fields."""
11441
+ """Fine-tuning job creation parameters - optional fields."""
11075
11442
 
11076
11443
  base_model: Optional[str]
11077
11444
  """The base model that is being tuned, e.g., "gemini-2.5-flash"."""
@@ -11273,20 +11640,24 @@ class CachedContentUsageMetadata(_common.BaseModel):
11273
11640
  """Metadata on the usage of the cached content."""
11274
11641
 
11275
11642
  audio_duration_seconds: Optional[int] = Field(
11276
- default=None, description="""Duration of audio in seconds."""
11643
+ default=None,
11644
+ description="""Duration of audio in seconds. This field is not supported in Gemini API.""",
11277
11645
  )
11278
11646
  image_count: Optional[int] = Field(
11279
- default=None, description="""Number of images."""
11647
+ default=None,
11648
+ description="""Number of images. This field is not supported in Gemini API.""",
11280
11649
  )
11281
11650
  text_count: Optional[int] = Field(
11282
- default=None, description="""Number of text characters."""
11651
+ default=None,
11652
+ description="""Number of text characters. This field is not supported in Gemini API.""",
11283
11653
  )
11284
11654
  total_token_count: Optional[int] = Field(
11285
11655
  default=None,
11286
11656
  description="""Total number of tokens that the cached content consumes.""",
11287
11657
  )
11288
11658
  video_duration_seconds: Optional[int] = Field(
11289
- default=None, description="""Duration of video in seconds."""
11659
+ default=None,
11660
+ description="""Duration of video in seconds. This field is not supported in Gemini API.""",
11290
11661
  )
11291
11662
 
11292
11663
 
@@ -11294,19 +11665,19 @@ class CachedContentUsageMetadataDict(TypedDict, total=False):
11294
11665
  """Metadata on the usage of the cached content."""
11295
11666
 
11296
11667
  audio_duration_seconds: Optional[int]
11297
- """Duration of audio in seconds."""
11668
+ """Duration of audio in seconds. This field is not supported in Gemini API."""
11298
11669
 
11299
11670
  image_count: Optional[int]
11300
- """Number of images."""
11671
+ """Number of images. This field is not supported in Gemini API."""
11301
11672
 
11302
11673
  text_count: Optional[int]
11303
- """Number of text characters."""
11674
+ """Number of text characters. This field is not supported in Gemini API."""
11304
11675
 
11305
11676
  total_token_count: Optional[int]
11306
11677
  """Total number of tokens that the cached content consumes."""
11307
11678
 
11308
11679
  video_duration_seconds: Optional[int]
11309
- """Duration of video in seconds."""
11680
+ """Duration of video in seconds. This field is not supported in Gemini API."""
11310
11681
 
11311
11682
 
11312
11683
  CachedContentUsageMetadataOrDict = Union[
@@ -13293,6 +13664,12 @@ class UpscaleImageConfig(_common.BaseModel):
13293
13664
  default=None,
13294
13665
  description="""Cloud Storage URI used to store the generated images.""",
13295
13666
  )
13667
+ safety_filter_level: Optional[SafetyFilterLevel] = Field(
13668
+ default=None, description="""Filter level for safety filtering."""
13669
+ )
13670
+ person_generation: Optional[PersonGeneration] = Field(
13671
+ default=None, description="""Allows generation of people by the model."""
13672
+ )
13296
13673
  include_rai_reason: Optional[bool] = Field(
13297
13674
  default=None,
13298
13675
  description="""Whether to include a reason for filtered-out images in the
@@ -13340,6 +13717,12 @@ class UpscaleImageConfigDict(TypedDict, total=False):
13340
13717
  output_gcs_uri: Optional[str]
13341
13718
  """Cloud Storage URI used to store the generated images."""
13342
13719
 
13720
+ safety_filter_level: Optional[SafetyFilterLevel]
13721
+ """Filter level for safety filtering."""
13722
+
13723
+ person_generation: Optional[PersonGeneration]
13724
+ """Allows generation of people by the model."""
13725
+
13343
13726
  include_rai_reason: Optional[bool]
13344
13727
  """Whether to include a reason for filtered-out images in the
13345
13728
  response."""
@@ -15878,7 +16261,7 @@ ComputeTokensResultOrDict = Union[ComputeTokensResult, ComputeTokensResultDict]
15878
16261
 
15879
16262
 
15880
16263
  class CreateTuningJobParameters(_common.BaseModel):
15881
- """Supervised fine-tuning job creation parameters - optional fields."""
16264
+ """Fine-tuning job creation parameters - optional fields."""
15882
16265
 
15883
16266
  base_model: Optional[str] = Field(
15884
16267
  default=None,
@@ -15894,7 +16277,7 @@ class CreateTuningJobParameters(_common.BaseModel):
15894
16277
 
15895
16278
 
15896
16279
  class CreateTuningJobParametersDict(TypedDict, total=False):
15897
- """Supervised fine-tuning job creation parameters - optional fields."""
16280
+ """Fine-tuning job creation parameters - optional fields."""
15898
16281
 
15899
16282
  base_model: Optional[str]
15900
16283
  """The base model that is being tuned, e.g., "gemini-2.5-flash"."""