google-genai 1.46.0__py3-none-any.whl → 1.48.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/_api_client.py +38 -15
- google/genai/_extra_utils.py +40 -3
- google/genai/_live_converters.py +66 -61
- google/genai/_tokens_converters.py +52 -47
- google/genai/_transformers.py +10 -1
- google/genai/batches.py +62 -57
- google/genai/caches.py +63 -58
- google/genai/client.py +4 -1
- google/genai/live.py +28 -18
- google/genai/models.py +205 -77
- google/genai/tunings.py +269 -94
- google/genai/types.py +1441 -1012
- google/genai/version.py +1 -1
- {google_genai-1.46.0.dist-info → google_genai-1.48.0.dist-info}/METADATA +152 -163
- {google_genai-1.46.0.dist-info → google_genai-1.48.0.dist-info}/RECORD +18 -18
- {google_genai-1.46.0.dist-info → google_genai-1.48.0.dist-info}/WHEEL +0 -0
- {google_genai-1.46.0.dist-info → google_genai-1.48.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.46.0.dist-info → google_genai-1.48.0.dist-info}/top_level.txt +0 -0
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
|
-
"""
|
|
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
|
-
"""
|
|
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
|
-
"""
|
|
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,71 @@ 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
|
+
|
|
217
|
+
class PhishBlockThreshold(_common.CaseInSensitiveEnum):
|
|
218
|
+
"""Sites with confidence level chosen & above this value will be blocked from the search results.
|
|
219
|
+
|
|
220
|
+
This enum is not supported in Gemini API.
|
|
221
|
+
"""
|
|
222
|
+
|
|
223
|
+
PHISH_BLOCK_THRESHOLD_UNSPECIFIED = 'PHISH_BLOCK_THRESHOLD_UNSPECIFIED'
|
|
224
|
+
"""Defaults to unspecified."""
|
|
225
|
+
BLOCK_LOW_AND_ABOVE = 'BLOCK_LOW_AND_ABOVE'
|
|
226
|
+
"""Blocks Low and above confidence URL that is risky."""
|
|
227
|
+
BLOCK_MEDIUM_AND_ABOVE = 'BLOCK_MEDIUM_AND_ABOVE'
|
|
228
|
+
"""Blocks Medium and above confidence URL that is risky."""
|
|
229
|
+
BLOCK_HIGH_AND_ABOVE = 'BLOCK_HIGH_AND_ABOVE'
|
|
230
|
+
"""Blocks High and above confidence URL that is risky."""
|
|
231
|
+
BLOCK_HIGHER_AND_ABOVE = 'BLOCK_HIGHER_AND_ABOVE'
|
|
232
|
+
"""Blocks Higher and above confidence URL that is risky."""
|
|
233
|
+
BLOCK_VERY_HIGH_AND_ABOVE = 'BLOCK_VERY_HIGH_AND_ABOVE'
|
|
234
|
+
"""Blocks Very high and above confidence URL that is risky."""
|
|
235
|
+
BLOCK_ONLY_EXTREMELY_HIGH = 'BLOCK_ONLY_EXTREMELY_HIGH'
|
|
236
|
+
"""Blocks Extremely high confidence URL that is risky."""
|
|
237
|
+
|
|
238
|
+
|
|
176
239
|
class HarmCategory(_common.CaseInSensitiveEnum):
|
|
177
|
-
"""
|
|
240
|
+
"""Harm category."""
|
|
178
241
|
|
|
179
242
|
HARM_CATEGORY_UNSPECIFIED = 'HARM_CATEGORY_UNSPECIFIED'
|
|
180
243
|
"""The harm category is unspecified."""
|
|
@@ -189,26 +252,26 @@ class HarmCategory(_common.CaseInSensitiveEnum):
|
|
|
189
252
|
HARM_CATEGORY_CIVIC_INTEGRITY = 'HARM_CATEGORY_CIVIC_INTEGRITY'
|
|
190
253
|
"""Deprecated: Election filter is not longer supported. The harm category is civic integrity."""
|
|
191
254
|
HARM_CATEGORY_IMAGE_HATE = 'HARM_CATEGORY_IMAGE_HATE'
|
|
192
|
-
"""The harm category is image hate."""
|
|
255
|
+
"""The harm category is image hate. This enum value is not supported in Gemini API."""
|
|
193
256
|
HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT = (
|
|
194
257
|
'HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT'
|
|
195
258
|
)
|
|
196
|
-
"""The harm category is image dangerous content."""
|
|
259
|
+
"""The harm category is image dangerous content. This enum value is not supported in Gemini API."""
|
|
197
260
|
HARM_CATEGORY_IMAGE_HARASSMENT = 'HARM_CATEGORY_IMAGE_HARASSMENT'
|
|
198
|
-
"""The harm category is image harassment."""
|
|
261
|
+
"""The harm category is image harassment. This enum value is not supported in Gemini API."""
|
|
199
262
|
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = (
|
|
200
263
|
'HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT'
|
|
201
264
|
)
|
|
202
|
-
"""The harm category is image sexually explicit content."""
|
|
265
|
+
"""The harm category is image sexually explicit content. This enum value is not supported in Gemini API."""
|
|
203
266
|
HARM_CATEGORY_JAILBREAK = 'HARM_CATEGORY_JAILBREAK'
|
|
204
|
-
"""The harm category is for jailbreak prompts."""
|
|
267
|
+
"""The harm category is for jailbreak prompts. This enum value is not supported in Gemini API."""
|
|
205
268
|
|
|
206
269
|
|
|
207
270
|
class HarmBlockMethod(_common.CaseInSensitiveEnum):
|
|
208
|
-
"""
|
|
271
|
+
"""Specify if the threshold is used for probability or severity score.
|
|
209
272
|
|
|
210
|
-
|
|
211
|
-
|
|
273
|
+
If not specified, the threshold is used for probability score. This enum is
|
|
274
|
+
not supported in Gemini API.
|
|
212
275
|
"""
|
|
213
276
|
|
|
214
277
|
HARM_BLOCK_METHOD_UNSPECIFIED = 'HARM_BLOCK_METHOD_UNSPECIFIED'
|
|
@@ -220,7 +283,7 @@ class HarmBlockMethod(_common.CaseInSensitiveEnum):
|
|
|
220
283
|
|
|
221
284
|
|
|
222
285
|
class HarmBlockThreshold(_common.CaseInSensitiveEnum):
|
|
223
|
-
"""
|
|
286
|
+
"""The harm block threshold."""
|
|
224
287
|
|
|
225
288
|
HARM_BLOCK_THRESHOLD_UNSPECIFIED = 'HARM_BLOCK_THRESHOLD_UNSPECIFIED'
|
|
226
289
|
"""Unspecified harm block threshold."""
|
|
@@ -236,59 +299,6 @@ class HarmBlockThreshold(_common.CaseInSensitiveEnum):
|
|
|
236
299
|
"""Turn off the safety filter."""
|
|
237
300
|
|
|
238
301
|
|
|
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
302
|
class FinishReason(_common.CaseInSensitiveEnum):
|
|
293
303
|
"""Output only. The reason why the model stopped generating tokens.
|
|
294
304
|
|
|
@@ -343,7 +353,10 @@ class HarmProbability(_common.CaseInSensitiveEnum):
|
|
|
343
353
|
|
|
344
354
|
|
|
345
355
|
class HarmSeverity(_common.CaseInSensitiveEnum):
|
|
346
|
-
"""Output only.
|
|
356
|
+
"""Output only.
|
|
357
|
+
|
|
358
|
+
Harm severity levels in the content. This enum is not supported in Gemini API.
|
|
359
|
+
"""
|
|
347
360
|
|
|
348
361
|
HARM_SEVERITY_UNSPECIFIED = 'HARM_SEVERITY_UNSPECIFIED'
|
|
349
362
|
"""Harm severity unspecified."""
|
|
@@ -357,6 +370,21 @@ class HarmSeverity(_common.CaseInSensitiveEnum):
|
|
|
357
370
|
"""High level of harm severity."""
|
|
358
371
|
|
|
359
372
|
|
|
373
|
+
class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
|
|
374
|
+
"""Status of the url retrieval."""
|
|
375
|
+
|
|
376
|
+
URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
|
|
377
|
+
"""Default value. This value is unused."""
|
|
378
|
+
URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
|
|
379
|
+
"""Url retrieval is successful."""
|
|
380
|
+
URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
|
|
381
|
+
"""Url retrieval is failed due to error."""
|
|
382
|
+
URL_RETRIEVAL_STATUS_PAYWALL = 'URL_RETRIEVAL_STATUS_PAYWALL'
|
|
383
|
+
"""Url retrieval is failed because the content is behind paywall. This enum value is not supported in Vertex AI."""
|
|
384
|
+
URL_RETRIEVAL_STATUS_UNSAFE = 'URL_RETRIEVAL_STATUS_UNSAFE'
|
|
385
|
+
"""Url retrieval is failed because the content is unsafe. This enum value is not supported in Vertex AI."""
|
|
386
|
+
|
|
387
|
+
|
|
360
388
|
class BlockedReason(_common.CaseInSensitiveEnum):
|
|
361
389
|
"""Output only. The reason why the prompt was blocked."""
|
|
362
390
|
|
|
@@ -373,16 +401,16 @@ class BlockedReason(_common.CaseInSensitiveEnum):
|
|
|
373
401
|
IMAGE_SAFETY = 'IMAGE_SAFETY'
|
|
374
402
|
"""The prompt was blocked because it contains content that is unsafe for image generation."""
|
|
375
403
|
MODEL_ARMOR = 'MODEL_ARMOR'
|
|
376
|
-
"""The prompt was blocked by Model Armor."""
|
|
404
|
+
"""The prompt was blocked by Model Armor. This enum value is not supported in Gemini API."""
|
|
377
405
|
JAILBREAK = 'JAILBREAK'
|
|
378
|
-
"""The prompt was blocked as a jailbreak attempt."""
|
|
406
|
+
"""The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API."""
|
|
379
407
|
|
|
380
408
|
|
|
381
409
|
class TrafficType(_common.CaseInSensitiveEnum):
|
|
382
410
|
"""Output only.
|
|
383
411
|
|
|
384
412
|
Traffic type. This shows whether a request consumes Pay-As-You-Go or
|
|
385
|
-
Provisioned Throughput quota.
|
|
413
|
+
Provisioned Throughput quota. This enum is not supported in Gemini API.
|
|
386
414
|
"""
|
|
387
415
|
|
|
388
416
|
TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'
|
|
@@ -419,6 +447,36 @@ class MediaResolution(_common.CaseInSensitiveEnum):
|
|
|
419
447
|
"""Media resolution set to high (zoomed reframing with 256 tokens)."""
|
|
420
448
|
|
|
421
449
|
|
|
450
|
+
class TuningMode(_common.CaseInSensitiveEnum):
|
|
451
|
+
"""Tuning mode. This enum is not supported in Gemini API."""
|
|
452
|
+
|
|
453
|
+
TUNING_MODE_UNSPECIFIED = 'TUNING_MODE_UNSPECIFIED'
|
|
454
|
+
"""Tuning mode is unspecified."""
|
|
455
|
+
TUNING_MODE_FULL = 'TUNING_MODE_FULL'
|
|
456
|
+
"""Full fine-tuning mode."""
|
|
457
|
+
TUNING_MODE_PEFT_ADAPTER = 'TUNING_MODE_PEFT_ADAPTER'
|
|
458
|
+
"""PEFT adapter tuning mode."""
|
|
459
|
+
|
|
460
|
+
|
|
461
|
+
class AdapterSize(_common.CaseInSensitiveEnum):
|
|
462
|
+
"""Adapter size for tuning. This enum is not supported in Gemini API."""
|
|
463
|
+
|
|
464
|
+
ADAPTER_SIZE_UNSPECIFIED = 'ADAPTER_SIZE_UNSPECIFIED'
|
|
465
|
+
"""Adapter size is unspecified."""
|
|
466
|
+
ADAPTER_SIZE_ONE = 'ADAPTER_SIZE_ONE'
|
|
467
|
+
"""Adapter size 1."""
|
|
468
|
+
ADAPTER_SIZE_TWO = 'ADAPTER_SIZE_TWO'
|
|
469
|
+
"""Adapter size 2."""
|
|
470
|
+
ADAPTER_SIZE_FOUR = 'ADAPTER_SIZE_FOUR'
|
|
471
|
+
"""Adapter size 4."""
|
|
472
|
+
ADAPTER_SIZE_EIGHT = 'ADAPTER_SIZE_EIGHT'
|
|
473
|
+
"""Adapter size 8."""
|
|
474
|
+
ADAPTER_SIZE_SIXTEEN = 'ADAPTER_SIZE_SIXTEEN'
|
|
475
|
+
"""Adapter size 16."""
|
|
476
|
+
ADAPTER_SIZE_THIRTY_TWO = 'ADAPTER_SIZE_THIRTY_TWO'
|
|
477
|
+
"""Adapter size 32."""
|
|
478
|
+
|
|
479
|
+
|
|
422
480
|
class JobState(_common.CaseInSensitiveEnum):
|
|
423
481
|
"""Job state."""
|
|
424
482
|
|
|
@@ -448,38 +506,11 @@ class JobState(_common.CaseInSensitiveEnum):
|
|
|
448
506
|
"""The job is partially succeeded, some results may be missing due to errors."""
|
|
449
507
|
|
|
450
508
|
|
|
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
509
|
class TuningTask(_common.CaseInSensitiveEnum):
|
|
482
|
-
"""
|
|
510
|
+
"""The tuning task.
|
|
511
|
+
|
|
512
|
+
Either I2V or T2V. This enum is not supported in Gemini API.
|
|
513
|
+
"""
|
|
483
514
|
|
|
484
515
|
TUNING_TASK_UNSPECIFIED = 'TUNING_TASK_UNSPECIFIED'
|
|
485
516
|
"""Default value. This value is unused."""
|
|
@@ -695,6 +726,15 @@ class VideoCompressionQuality(_common.CaseInSensitiveEnum):
|
|
|
695
726
|
with a larger file size."""
|
|
696
727
|
|
|
697
728
|
|
|
729
|
+
class TuningMethod(_common.CaseInSensitiveEnum):
|
|
730
|
+
"""Enum representing the tuning method."""
|
|
731
|
+
|
|
732
|
+
SUPERVISED_FINE_TUNING = 'SUPERVISED_FINE_TUNING'
|
|
733
|
+
"""Supervised fine tuning."""
|
|
734
|
+
PREFERENCE_TUNING = 'PREFERENCE_TUNING'
|
|
735
|
+
"""Preference optimization tuning."""
|
|
736
|
+
|
|
737
|
+
|
|
698
738
|
class FileState(_common.CaseInSensitiveEnum):
|
|
699
739
|
"""State for the lifecycle of a File."""
|
|
700
740
|
|
|
@@ -850,176 +890,66 @@ class LiveMusicPlaybackControl(_common.CaseInSensitiveEnum):
|
|
|
850
890
|
Retains the current prompts and config."""
|
|
851
891
|
|
|
852
892
|
|
|
853
|
-
class
|
|
854
|
-
"""
|
|
893
|
+
class FunctionCall(_common.BaseModel):
|
|
894
|
+
"""A function call."""
|
|
855
895
|
|
|
856
|
-
|
|
896
|
+
id: Optional[str] = Field(
|
|
857
897
|
default=None,
|
|
858
|
-
description="""The
|
|
859
|
-
|
|
898
|
+
description="""The unique id of the function call. If populated, the client to execute the
|
|
899
|
+
`function_call` and return the response with the matching `id`.""",
|
|
860
900
|
)
|
|
861
|
-
|
|
862
|
-
default=None,
|
|
901
|
+
args: Optional[dict[str, Any]] = Field(
|
|
902
|
+
default=None,
|
|
903
|
+
description="""Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.""",
|
|
863
904
|
)
|
|
864
|
-
|
|
865
|
-
default=None,
|
|
905
|
+
name: Optional[str] = Field(
|
|
906
|
+
default=None,
|
|
907
|
+
description="""Required. The name of the function to call. Matches [FunctionDeclaration.name].""",
|
|
866
908
|
)
|
|
867
909
|
|
|
868
910
|
|
|
869
|
-
class
|
|
870
|
-
"""
|
|
911
|
+
class FunctionCallDict(TypedDict, total=False):
|
|
912
|
+
"""A function call."""
|
|
871
913
|
|
|
872
|
-
|
|
873
|
-
"""The
|
|
874
|
-
|
|
914
|
+
id: Optional[str]
|
|
915
|
+
"""The unique id of the function call. If populated, the client to execute the
|
|
916
|
+
`function_call` and return the response with the matching `id`."""
|
|
875
917
|
|
|
876
|
-
|
|
877
|
-
"""Optional. The
|
|
918
|
+
args: Optional[dict[str, Any]]
|
|
919
|
+
"""Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details."""
|
|
878
920
|
|
|
879
|
-
|
|
880
|
-
"""
|
|
921
|
+
name: Optional[str]
|
|
922
|
+
"""Required. The name of the function to call. Matches [FunctionDeclaration.name]."""
|
|
881
923
|
|
|
882
924
|
|
|
883
|
-
|
|
925
|
+
FunctionCallOrDict = Union[FunctionCall, FunctionCallDict]
|
|
884
926
|
|
|
885
927
|
|
|
886
|
-
class
|
|
887
|
-
"""
|
|
928
|
+
class CodeExecutionResult(_common.BaseModel):
|
|
929
|
+
"""Result of executing the [ExecutableCode].
|
|
888
930
|
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
default=None, description="""Required.
|
|
931
|
+
Only generated when using the [CodeExecution] tool, and always follows a
|
|
932
|
+
`part` containing the [ExecutableCode].
|
|
933
|
+
"""
|
|
934
|
+
|
|
935
|
+
outcome: Optional[Outcome] = Field(
|
|
936
|
+
default=None, description="""Required. Outcome of the code execution."""
|
|
895
937
|
)
|
|
896
|
-
|
|
938
|
+
output: Optional[str] = Field(
|
|
897
939
|
default=None,
|
|
898
|
-
description="""
|
|
940
|
+
description="""Optional. Contains stdout when code execution is successful, stderr or other description otherwise.""",
|
|
899
941
|
)
|
|
900
942
|
|
|
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
943
|
|
|
944
|
+
class CodeExecutionResultDict(TypedDict, total=False):
|
|
945
|
+
"""Result of executing the [ExecutableCode].
|
|
914
946
|
|
|
915
|
-
|
|
916
|
-
|
|
947
|
+
Only generated when using the [CodeExecution] tool, and always follows a
|
|
948
|
+
`part` containing the [ExecutableCode].
|
|
949
|
+
"""
|
|
917
950
|
|
|
918
|
-
|
|
919
|
-
"""
|
|
920
|
-
|
|
921
|
-
data: Optional[bytes]
|
|
922
|
-
"""Required. Raw bytes."""
|
|
923
|
-
|
|
924
|
-
mime_type: Optional[str]
|
|
925
|
-
"""Required. The IANA standard MIME type of the source data."""
|
|
926
|
-
|
|
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."""
|
|
951
|
+
outcome: Optional[Outcome]
|
|
952
|
+
"""Required. Outcome of the code execution."""
|
|
1023
953
|
|
|
1024
954
|
output: Optional[str]
|
|
1025
955
|
"""Optional. Contains stdout when code execution is successful, stderr or other description otherwise."""
|
|
@@ -1063,6 +993,38 @@ class ExecutableCodeDict(TypedDict, total=False):
|
|
|
1063
993
|
ExecutableCodeOrDict = Union[ExecutableCode, ExecutableCodeDict]
|
|
1064
994
|
|
|
1065
995
|
|
|
996
|
+
class FileData(_common.BaseModel):
|
|
997
|
+
"""URI based data."""
|
|
998
|
+
|
|
999
|
+
display_name: Optional[str] = Field(
|
|
1000
|
+
default=None,
|
|
1001
|
+
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.""",
|
|
1002
|
+
)
|
|
1003
|
+
file_uri: Optional[str] = Field(
|
|
1004
|
+
default=None, description="""Required. URI."""
|
|
1005
|
+
)
|
|
1006
|
+
mime_type: Optional[str] = Field(
|
|
1007
|
+
default=None,
|
|
1008
|
+
description="""Required. The IANA standard MIME type of the source data.""",
|
|
1009
|
+
)
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
class FileDataDict(TypedDict, total=False):
|
|
1013
|
+
"""URI based data."""
|
|
1014
|
+
|
|
1015
|
+
display_name: Optional[str]
|
|
1016
|
+
"""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."""
|
|
1017
|
+
|
|
1018
|
+
file_uri: Optional[str]
|
|
1019
|
+
"""Required. URI."""
|
|
1020
|
+
|
|
1021
|
+
mime_type: Optional[str]
|
|
1022
|
+
"""Required. The IANA standard MIME type of the source data."""
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
FileDataOrDict = Union[FileData, FileDataDict]
|
|
1026
|
+
|
|
1027
|
+
|
|
1066
1028
|
class FunctionResponseBlob(_common.BaseModel):
|
|
1067
1029
|
"""Raw media bytes for function response.
|
|
1068
1030
|
|
|
@@ -1274,31 +1236,90 @@ class FunctionResponseDict(TypedDict, total=False):
|
|
|
1274
1236
|
FunctionResponseOrDict = Union[FunctionResponse, FunctionResponseDict]
|
|
1275
1237
|
|
|
1276
1238
|
|
|
1277
|
-
class
|
|
1278
|
-
"""
|
|
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
|
-
"""
|
|
1239
|
+
class Blob(_common.BaseModel):
|
|
1240
|
+
"""Content blob."""
|
|
1284
1241
|
|
|
1285
|
-
|
|
1286
|
-
default=None, description="""
|
|
1242
|
+
data: Optional[bytes] = Field(
|
|
1243
|
+
default=None, description="""Required. Raw bytes."""
|
|
1287
1244
|
)
|
|
1288
|
-
|
|
1245
|
+
display_name: Optional[str] = Field(
|
|
1289
1246
|
default=None,
|
|
1290
|
-
description="""
|
|
1247
|
+
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
1248
|
)
|
|
1292
|
-
|
|
1293
|
-
default=None,
|
|
1249
|
+
mime_type: Optional[str] = Field(
|
|
1250
|
+
default=None,
|
|
1251
|
+
description="""Required. The IANA standard MIME type of the source data.""",
|
|
1294
1252
|
)
|
|
1295
|
-
|
|
1296
|
-
|
|
1253
|
+
|
|
1254
|
+
def as_image(self) -> Optional['Image']:
|
|
1255
|
+
"""Returns the Blob as a Image, or None if the Blob is not an image."""
|
|
1256
|
+
if (
|
|
1257
|
+
not self.data
|
|
1258
|
+
or not self.mime_type
|
|
1259
|
+
or not self.mime_type.startswith('image/')
|
|
1260
|
+
):
|
|
1261
|
+
return None
|
|
1262
|
+
return Image(
|
|
1263
|
+
image_bytes=self.data,
|
|
1264
|
+
mime_type=self.mime_type,
|
|
1265
|
+
)
|
|
1266
|
+
|
|
1267
|
+
|
|
1268
|
+
class BlobDict(TypedDict, total=False):
|
|
1269
|
+
"""Content blob."""
|
|
1270
|
+
|
|
1271
|
+
data: Optional[bytes]
|
|
1272
|
+
"""Required. Raw bytes."""
|
|
1273
|
+
|
|
1274
|
+
display_name: Optional[str]
|
|
1275
|
+
"""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."""
|
|
1276
|
+
|
|
1277
|
+
mime_type: Optional[str]
|
|
1278
|
+
"""Required. The IANA standard MIME type of the source data."""
|
|
1279
|
+
|
|
1280
|
+
|
|
1281
|
+
BlobOrDict = Union[Blob, BlobDict]
|
|
1282
|
+
|
|
1283
|
+
|
|
1284
|
+
class VideoMetadata(_common.BaseModel):
|
|
1285
|
+
"""Metadata describes the input video content."""
|
|
1286
|
+
|
|
1287
|
+
end_offset: Optional[str] = Field(
|
|
1288
|
+
default=None, description="""Optional. The end offset of the video."""
|
|
1297
1289
|
)
|
|
1298
|
-
|
|
1290
|
+
fps: Optional[float] = Field(
|
|
1299
1291
|
default=None,
|
|
1300
|
-
description="""
|
|
1292
|
+
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].""",
|
|
1293
|
+
)
|
|
1294
|
+
start_offset: Optional[str] = Field(
|
|
1295
|
+
default=None, description="""Optional. The start offset of the video."""
|
|
1301
1296
|
)
|
|
1297
|
+
|
|
1298
|
+
|
|
1299
|
+
class VideoMetadataDict(TypedDict, total=False):
|
|
1300
|
+
"""Metadata describes the input video content."""
|
|
1301
|
+
|
|
1302
|
+
end_offset: Optional[str]
|
|
1303
|
+
"""Optional. The end offset of the video."""
|
|
1304
|
+
|
|
1305
|
+
fps: Optional[float]
|
|
1306
|
+
"""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]."""
|
|
1307
|
+
|
|
1308
|
+
start_offset: Optional[str]
|
|
1309
|
+
"""Optional. The start offset of the video."""
|
|
1310
|
+
|
|
1311
|
+
|
|
1312
|
+
VideoMetadataOrDict = Union[VideoMetadata, VideoMetadataDict]
|
|
1313
|
+
|
|
1314
|
+
|
|
1315
|
+
class Part(_common.BaseModel):
|
|
1316
|
+
"""A datatype containing media content.
|
|
1317
|
+
|
|
1318
|
+
Exactly one field within a Part should be set, representing the specific type
|
|
1319
|
+
of content being conveyed. Using multiple fields within the same `Part`
|
|
1320
|
+
instance is considered invalid.
|
|
1321
|
+
"""
|
|
1322
|
+
|
|
1302
1323
|
function_call: Optional[FunctionCall] = Field(
|
|
1303
1324
|
default=None,
|
|
1304
1325
|
description="""A predicted [FunctionCall] returned from the model that contains a string
|
|
@@ -1313,13 +1334,31 @@ class Part(_common.BaseModel):
|
|
|
1313
1334
|
default=None,
|
|
1314
1335
|
description="""Optional. Code generated by the model that is meant to be executed.""",
|
|
1315
1336
|
)
|
|
1337
|
+
file_data: Optional[FileData] = Field(
|
|
1338
|
+
default=None, description="""Optional. URI based data."""
|
|
1339
|
+
)
|
|
1316
1340
|
function_response: Optional[FunctionResponse] = Field(
|
|
1317
1341
|
default=None,
|
|
1318
1342
|
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
1343
|
)
|
|
1344
|
+
inline_data: Optional[Blob] = Field(
|
|
1345
|
+
default=None, description="""Optional. Inlined bytes data."""
|
|
1346
|
+
)
|
|
1320
1347
|
text: Optional[str] = Field(
|
|
1321
1348
|
default=None, description="""Optional. Text part (can be code)."""
|
|
1322
1349
|
)
|
|
1350
|
+
thought: Optional[bool] = Field(
|
|
1351
|
+
default=None,
|
|
1352
|
+
description="""Optional. Indicates if the part is thought from the model.""",
|
|
1353
|
+
)
|
|
1354
|
+
thought_signature: Optional[bytes] = Field(
|
|
1355
|
+
default=None,
|
|
1356
|
+
description="""Optional. An opaque signature for the thought so it can be reused in subsequent requests.""",
|
|
1357
|
+
)
|
|
1358
|
+
video_metadata: Optional[VideoMetadata] = Field(
|
|
1359
|
+
default=None,
|
|
1360
|
+
description="""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.""",
|
|
1361
|
+
)
|
|
1323
1362
|
|
|
1324
1363
|
def as_image(self) -> Optional['Image']:
|
|
1325
1364
|
"""Returns the part as a PIL Image, or None if the part is not an image."""
|
|
@@ -1398,21 +1437,6 @@ class PartDict(TypedDict, total=False):
|
|
|
1398
1437
|
instance is considered invalid.
|
|
1399
1438
|
"""
|
|
1400
1439
|
|
|
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
1440
|
function_call: Optional[FunctionCallDict]
|
|
1417
1441
|
"""A predicted [FunctionCall] returned from the model that contains a string
|
|
1418
1442
|
representing the [FunctionDeclaration.name] and a structured JSON object
|
|
@@ -1424,12 +1448,27 @@ class PartDict(TypedDict, total=False):
|
|
|
1424
1448
|
executable_code: Optional[ExecutableCodeDict]
|
|
1425
1449
|
"""Optional. Code generated by the model that is meant to be executed."""
|
|
1426
1450
|
|
|
1451
|
+
file_data: Optional[FileDataDict]
|
|
1452
|
+
"""Optional. URI based data."""
|
|
1453
|
+
|
|
1427
1454
|
function_response: Optional[FunctionResponseDict]
|
|
1428
1455
|
"""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
1456
|
|
|
1457
|
+
inline_data: Optional[BlobDict]
|
|
1458
|
+
"""Optional. Inlined bytes data."""
|
|
1459
|
+
|
|
1430
1460
|
text: Optional[str]
|
|
1431
1461
|
"""Optional. Text part (can be code)."""
|
|
1432
1462
|
|
|
1463
|
+
thought: Optional[bool]
|
|
1464
|
+
"""Optional. Indicates if the part is thought from the model."""
|
|
1465
|
+
|
|
1466
|
+
thought_signature: Optional[bytes]
|
|
1467
|
+
"""Optional. An opaque signature for the thought so it can be reused in subsequent requests."""
|
|
1468
|
+
|
|
1469
|
+
video_metadata: Optional[VideoMetadataDict]
|
|
1470
|
+
"""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."""
|
|
1471
|
+
|
|
1433
1472
|
|
|
1434
1473
|
PartOrDict = Union[Part, PartDict]
|
|
1435
1474
|
|
|
@@ -1444,9 +1483,7 @@ class Content(_common.BaseModel):
|
|
|
1444
1483
|
)
|
|
1445
1484
|
role: Optional[str] = Field(
|
|
1446
1485
|
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.""",
|
|
1486
|
+
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
1487
|
)
|
|
1451
1488
|
|
|
1452
1489
|
|
|
@@ -1458,9 +1495,7 @@ class ContentDict(TypedDict, total=False):
|
|
|
1458
1495
|
a different IANA MIME type."""
|
|
1459
1496
|
|
|
1460
1497
|
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."""
|
|
1498
|
+
"""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
1499
|
|
|
1465
1500
|
|
|
1466
1501
|
ContentOrDict = Union[Content, ContentDict]
|
|
@@ -1472,27 +1507,28 @@ class HttpRetryOptions(_common.BaseModel):
|
|
|
1472
1507
|
attempts: Optional[int] = Field(
|
|
1473
1508
|
default=None,
|
|
1474
1509
|
description="""Maximum number of attempts, including the original request.
|
|
1475
|
-
If 0 or 1, it means no retries.""",
|
|
1510
|
+
If 0 or 1, it means no retries. If not specified, default to 5.""",
|
|
1476
1511
|
)
|
|
1477
1512
|
initial_delay: Optional[float] = Field(
|
|
1478
1513
|
default=None,
|
|
1479
|
-
description="""Initial delay before the first retry, in fractions of a second.""",
|
|
1514
|
+
description="""Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.""",
|
|
1480
1515
|
)
|
|
1481
1516
|
max_delay: Optional[float] = Field(
|
|
1482
1517
|
default=None,
|
|
1483
|
-
description="""Maximum delay between retries, in fractions of a second.""",
|
|
1518
|
+
description="""Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.""",
|
|
1484
1519
|
)
|
|
1485
1520
|
exp_base: Optional[float] = Field(
|
|
1486
1521
|
default=None,
|
|
1487
|
-
description="""Multiplier by which the delay increases after each attempt.""",
|
|
1522
|
+
description="""Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.""",
|
|
1488
1523
|
)
|
|
1489
1524
|
jitter: Optional[float] = Field(
|
|
1490
|
-
default=None,
|
|
1525
|
+
default=None,
|
|
1526
|
+
description="""Randomness factor for the delay. If not specified, default to 1.0.""",
|
|
1491
1527
|
)
|
|
1492
1528
|
http_status_codes: Optional[list[int]] = Field(
|
|
1493
1529
|
default=None,
|
|
1494
1530
|
description="""List of HTTP status codes that should trigger a retry.
|
|
1495
|
-
If not specified, a default set of retryable codes may be used.""",
|
|
1531
|
+
If not specified, a default set of retryable codes (408, 429, and 5xx) may be used.""",
|
|
1496
1532
|
)
|
|
1497
1533
|
|
|
1498
1534
|
|
|
@@ -1501,23 +1537,23 @@ class HttpRetryOptionsDict(TypedDict, total=False):
|
|
|
1501
1537
|
|
|
1502
1538
|
attempts: Optional[int]
|
|
1503
1539
|
"""Maximum number of attempts, including the original request.
|
|
1504
|
-
If 0 or 1, it means no retries."""
|
|
1540
|
+
If 0 or 1, it means no retries. If not specified, default to 5."""
|
|
1505
1541
|
|
|
1506
1542
|
initial_delay: Optional[float]
|
|
1507
|
-
"""Initial delay before the first retry, in fractions of a second."""
|
|
1543
|
+
"""Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second."""
|
|
1508
1544
|
|
|
1509
1545
|
max_delay: Optional[float]
|
|
1510
|
-
"""Maximum delay between retries, in fractions of a second."""
|
|
1546
|
+
"""Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds."""
|
|
1511
1547
|
|
|
1512
1548
|
exp_base: Optional[float]
|
|
1513
|
-
"""Multiplier by which the delay increases after each attempt."""
|
|
1549
|
+
"""Multiplier by which the delay increases after each attempt. If not specified, default to 2.0."""
|
|
1514
1550
|
|
|
1515
1551
|
jitter: Optional[float]
|
|
1516
|
-
"""Randomness factor for the delay."""
|
|
1552
|
+
"""Randomness factor for the delay. If not specified, default to 1.0."""
|
|
1517
1553
|
|
|
1518
1554
|
http_status_codes: Optional[list[int]]
|
|
1519
1555
|
"""List of HTTP status codes that should trigger a retry.
|
|
1520
|
-
If not specified, a default set of retryable codes may be used."""
|
|
1556
|
+
If not specified, a default set of retryable codes (408, 429, and 5xx) may be used."""
|
|
1521
1557
|
|
|
1522
1558
|
|
|
1523
1559
|
HttpRetryOptionsOrDict = Union[HttpRetryOptions, HttpRetryOptionsDict]
|
|
@@ -2196,7 +2232,7 @@ class Schema(_common.BaseModel):
|
|
|
2196
2232
|
for this_field_value in field_value
|
|
2197
2233
|
]
|
|
2198
2234
|
setattr(schema, field_name, list_schema_field_value)
|
|
2199
|
-
if not schema.type and not is_union_like_type:
|
|
2235
|
+
if not schema.type and not is_union_like_type and not schema.any_of:
|
|
2200
2236
|
schema.type = Type('OBJECT')
|
|
2201
2237
|
elif field_name in dict_schema_field_names:
|
|
2202
2238
|
dict_schema_field_value: dict[str, 'Schema'] = {
|
|
@@ -2368,39 +2404,6 @@ ModelSelectionConfigOrDict = Union[
|
|
|
2368
2404
|
]
|
|
2369
2405
|
|
|
2370
2406
|
|
|
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
2407
|
class FunctionDeclaration(_common.BaseModel):
|
|
2405
2408
|
"""Defines a function that the model can generate JSON inputs for.
|
|
2406
2409
|
|
|
@@ -2661,72 +2664,6 @@ class FunctionDeclarationDict(TypedDict, total=False):
|
|
|
2661
2664
|
FunctionDeclarationOrDict = Union[FunctionDeclaration, FunctionDeclarationDict]
|
|
2662
2665
|
|
|
2663
2666
|
|
|
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
2667
|
class DynamicRetrievalConfig(_common.BaseModel):
|
|
2731
2668
|
"""Describes the options to customize dynamic retrieval."""
|
|
2732
2669
|
|
|
@@ -2776,25 +2713,6 @@ GoogleSearchRetrievalOrDict = Union[
|
|
|
2776
2713
|
]
|
|
2777
2714
|
|
|
2778
2715
|
|
|
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
2716
|
class ApiKeyConfig(_common.BaseModel):
|
|
2799
2717
|
"""Config for authentication with API key."""
|
|
2800
2718
|
|
|
@@ -2815,7 +2733,10 @@ ApiKeyConfigOrDict = Union[ApiKeyConfig, ApiKeyConfigDict]
|
|
|
2815
2733
|
|
|
2816
2734
|
|
|
2817
2735
|
class AuthConfigGoogleServiceAccountConfig(_common.BaseModel):
|
|
2818
|
-
"""Config for Google Service Account Authentication.
|
|
2736
|
+
"""Config for Google Service Account Authentication.
|
|
2737
|
+
|
|
2738
|
+
This data type is not supported in Gemini API.
|
|
2739
|
+
"""
|
|
2819
2740
|
|
|
2820
2741
|
service_account: Optional[str] = Field(
|
|
2821
2742
|
default=None,
|
|
@@ -2824,7 +2745,10 @@ class AuthConfigGoogleServiceAccountConfig(_common.BaseModel):
|
|
|
2824
2745
|
|
|
2825
2746
|
|
|
2826
2747
|
class AuthConfigGoogleServiceAccountConfigDict(TypedDict, total=False):
|
|
2827
|
-
"""Config for Google Service Account Authentication.
|
|
2748
|
+
"""Config for Google Service Account Authentication.
|
|
2749
|
+
|
|
2750
|
+
This data type is not supported in Gemini API.
|
|
2751
|
+
"""
|
|
2828
2752
|
|
|
2829
2753
|
service_account: Optional[str]
|
|
2830
2754
|
"""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 +2761,10 @@ AuthConfigGoogleServiceAccountConfigOrDict = Union[
|
|
|
2837
2761
|
|
|
2838
2762
|
|
|
2839
2763
|
class AuthConfigHttpBasicAuthConfig(_common.BaseModel):
|
|
2840
|
-
"""Config for HTTP Basic Authentication.
|
|
2764
|
+
"""Config for HTTP Basic Authentication.
|
|
2765
|
+
|
|
2766
|
+
This data type is not supported in Gemini API.
|
|
2767
|
+
"""
|
|
2841
2768
|
|
|
2842
2769
|
credential_secret: Optional[str] = Field(
|
|
2843
2770
|
default=None,
|
|
@@ -2846,7 +2773,10 @@ class AuthConfigHttpBasicAuthConfig(_common.BaseModel):
|
|
|
2846
2773
|
|
|
2847
2774
|
|
|
2848
2775
|
class AuthConfigHttpBasicAuthConfigDict(TypedDict, total=False):
|
|
2849
|
-
"""Config for HTTP Basic Authentication.
|
|
2776
|
+
"""Config for HTTP Basic Authentication.
|
|
2777
|
+
|
|
2778
|
+
This data type is not supported in Gemini API.
|
|
2779
|
+
"""
|
|
2850
2780
|
|
|
2851
2781
|
credential_secret: Optional[str]
|
|
2852
2782
|
"""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 +2788,7 @@ AuthConfigHttpBasicAuthConfigOrDict = Union[
|
|
|
2858
2788
|
|
|
2859
2789
|
|
|
2860
2790
|
class AuthConfigOauthConfig(_common.BaseModel):
|
|
2861
|
-
"""Config for user oauth."""
|
|
2791
|
+
"""Config for user oauth. This data type is not supported in Gemini API."""
|
|
2862
2792
|
|
|
2863
2793
|
access_token: Optional[str] = Field(
|
|
2864
2794
|
default=None,
|
|
@@ -2871,7 +2801,7 @@ class AuthConfigOauthConfig(_common.BaseModel):
|
|
|
2871
2801
|
|
|
2872
2802
|
|
|
2873
2803
|
class AuthConfigOauthConfigDict(TypedDict, total=False):
|
|
2874
|
-
"""Config for user oauth."""
|
|
2804
|
+
"""Config for user oauth. This data type is not supported in Gemini API."""
|
|
2875
2805
|
|
|
2876
2806
|
access_token: Optional[str]
|
|
2877
2807
|
"""Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time."""
|
|
@@ -2886,7 +2816,10 @@ AuthConfigOauthConfigOrDict = Union[
|
|
|
2886
2816
|
|
|
2887
2817
|
|
|
2888
2818
|
class AuthConfigOidcConfig(_common.BaseModel):
|
|
2889
|
-
"""Config for user OIDC auth.
|
|
2819
|
+
"""Config for user OIDC auth.
|
|
2820
|
+
|
|
2821
|
+
This data type is not supported in Gemini API.
|
|
2822
|
+
"""
|
|
2890
2823
|
|
|
2891
2824
|
id_token: Optional[str] = Field(
|
|
2892
2825
|
default=None,
|
|
@@ -2899,7 +2832,10 @@ class AuthConfigOidcConfig(_common.BaseModel):
|
|
|
2899
2832
|
|
|
2900
2833
|
|
|
2901
2834
|
class AuthConfigOidcConfigDict(TypedDict, total=False):
|
|
2902
|
-
"""Config for user OIDC auth.
|
|
2835
|
+
"""Config for user OIDC auth.
|
|
2836
|
+
|
|
2837
|
+
This data type is not supported in Gemini API.
|
|
2838
|
+
"""
|
|
2903
2839
|
|
|
2904
2840
|
id_token: Optional[str]
|
|
2905
2841
|
"""OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time."""
|
|
@@ -2991,21 +2927,6 @@ class GoogleMapsDict(TypedDict, total=False):
|
|
|
2991
2927
|
GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
|
|
2992
2928
|
|
|
2993
2929
|
|
|
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
2930
|
class ComputerUse(_common.BaseModel):
|
|
3010
2931
|
"""Tool to support computer use."""
|
|
3011
2932
|
|
|
@@ -3040,7 +2961,7 @@ ComputerUseOrDict = Union[ComputerUse, ComputerUseDict]
|
|
|
3040
2961
|
|
|
3041
2962
|
|
|
3042
2963
|
class ApiAuthApiKeyConfig(_common.BaseModel):
|
|
3043
|
-
"""The API secret."""
|
|
2964
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
3044
2965
|
|
|
3045
2966
|
api_key_secret_version: Optional[str] = Field(
|
|
3046
2967
|
default=None,
|
|
@@ -3053,7 +2974,7 @@ class ApiAuthApiKeyConfig(_common.BaseModel):
|
|
|
3053
2974
|
|
|
3054
2975
|
|
|
3055
2976
|
class ApiAuthApiKeyConfigDict(TypedDict, total=False):
|
|
3056
|
-
"""The API secret."""
|
|
2977
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
3057
2978
|
|
|
3058
2979
|
api_key_secret_version: Optional[str]
|
|
3059
2980
|
"""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
|
|
@@ -3069,7 +2990,7 @@ class ApiAuth(_common.BaseModel):
|
|
|
3069
2990
|
"""The generic reusable api auth config.
|
|
3070
2991
|
|
|
3071
2992
|
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
3072
|
-
instead.
|
|
2993
|
+
instead. This data type is not supported in Gemini API.
|
|
3073
2994
|
"""
|
|
3074
2995
|
|
|
3075
2996
|
api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
|
|
@@ -3081,7 +3002,7 @@ class ApiAuthDict(TypedDict, total=False):
|
|
|
3081
3002
|
"""The generic reusable api auth config.
|
|
3082
3003
|
|
|
3083
3004
|
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
3084
|
-
instead.
|
|
3005
|
+
instead. This data type is not supported in Gemini API.
|
|
3085
3006
|
"""
|
|
3086
3007
|
|
|
3087
3008
|
api_key_config: Optional[ApiAuthApiKeyConfigDict]
|
|
@@ -3092,7 +3013,10 @@ ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
|
|
|
3092
3013
|
|
|
3093
3014
|
|
|
3094
3015
|
class ExternalApiElasticSearchParams(_common.BaseModel):
|
|
3095
|
-
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
3016
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
3017
|
+
|
|
3018
|
+
This data type is not supported in Gemini API.
|
|
3019
|
+
"""
|
|
3096
3020
|
|
|
3097
3021
|
index: Optional[str] = Field(
|
|
3098
3022
|
default=None, description="""The ElasticSearch index to use."""
|
|
@@ -3107,7 +3031,10 @@ class ExternalApiElasticSearchParams(_common.BaseModel):
|
|
|
3107
3031
|
|
|
3108
3032
|
|
|
3109
3033
|
class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
|
|
3110
|
-
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
3034
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
3035
|
+
|
|
3036
|
+
This data type is not supported in Gemini API.
|
|
3037
|
+
"""
|
|
3111
3038
|
|
|
3112
3039
|
index: Optional[str]
|
|
3113
3040
|
"""The ElasticSearch index to use."""
|
|
@@ -3125,13 +3052,19 @@ ExternalApiElasticSearchParamsOrDict = Union[
|
|
|
3125
3052
|
|
|
3126
3053
|
|
|
3127
3054
|
class ExternalApiSimpleSearchParams(_common.BaseModel):
|
|
3128
|
-
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3055
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3056
|
+
|
|
3057
|
+
This data type is not supported in Gemini API.
|
|
3058
|
+
"""
|
|
3129
3059
|
|
|
3130
3060
|
pass
|
|
3131
3061
|
|
|
3132
3062
|
|
|
3133
3063
|
class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
|
|
3134
|
-
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3064
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3065
|
+
|
|
3066
|
+
This data type is not supported in Gemini API.
|
|
3067
|
+
"""
|
|
3135
3068
|
|
|
3136
3069
|
pass
|
|
3137
3070
|
|
|
@@ -3145,7 +3078,7 @@ class ExternalApi(_common.BaseModel):
|
|
|
3145
3078
|
"""Retrieve from data source powered by external API for grounding.
|
|
3146
3079
|
|
|
3147
3080
|
The external API is not owned by Google, but need to follow the pre-defined
|
|
3148
|
-
API spec.
|
|
3081
|
+
API spec. This data type is not supported in Gemini API.
|
|
3149
3082
|
"""
|
|
3150
3083
|
|
|
3151
3084
|
api_auth: Optional[ApiAuth] = Field(
|
|
@@ -3176,7 +3109,7 @@ class ExternalApiDict(TypedDict, total=False):
|
|
|
3176
3109
|
"""Retrieve from data source powered by external API for grounding.
|
|
3177
3110
|
|
|
3178
3111
|
The external API is not owned by Google, but need to follow the pre-defined
|
|
3179
|
-
API spec.
|
|
3112
|
+
API spec. This data type is not supported in Gemini API.
|
|
3180
3113
|
"""
|
|
3181
3114
|
|
|
3182
3115
|
api_auth: Optional[ApiAuthDict]
|
|
@@ -3205,7 +3138,8 @@ class VertexAISearchDataStoreSpec(_common.BaseModel):
|
|
|
3205
3138
|
"""Define data stores within engine to filter on in a search call and configurations for those data stores.
|
|
3206
3139
|
|
|
3207
3140
|
For more information, see
|
|
3208
|
-
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
|
|
3141
|
+
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec.
|
|
3142
|
+
This data type is not supported in Gemini API.
|
|
3209
3143
|
"""
|
|
3210
3144
|
|
|
3211
3145
|
data_store: Optional[str] = Field(
|
|
@@ -3222,7 +3156,8 @@ class VertexAISearchDataStoreSpecDict(TypedDict, total=False):
|
|
|
3222
3156
|
"""Define data stores within engine to filter on in a search call and configurations for those data stores.
|
|
3223
3157
|
|
|
3224
3158
|
For more information, see
|
|
3225
|
-
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
|
|
3159
|
+
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec.
|
|
3160
|
+
This data type is not supported in Gemini API.
|
|
3226
3161
|
"""
|
|
3227
3162
|
|
|
3228
3163
|
data_store: Optional[str]
|
|
@@ -3241,7 +3176,8 @@ class VertexAISearch(_common.BaseModel):
|
|
|
3241
3176
|
"""Retrieve from Vertex AI Search datastore or engine for grounding.
|
|
3242
3177
|
|
|
3243
3178
|
datastore and engine are mutually exclusive. See
|
|
3244
|
-
https://cloud.google.com/products/agent-builder
|
|
3179
|
+
https://cloud.google.com/products/agent-builder. This data type is not
|
|
3180
|
+
supported in Gemini API.
|
|
3245
3181
|
"""
|
|
3246
3182
|
|
|
3247
3183
|
data_store_specs: Optional[list[VertexAISearchDataStoreSpec]] = Field(
|
|
@@ -3270,7 +3206,8 @@ class VertexAISearchDict(TypedDict, total=False):
|
|
|
3270
3206
|
"""Retrieve from Vertex AI Search datastore or engine for grounding.
|
|
3271
3207
|
|
|
3272
3208
|
datastore and engine are mutually exclusive. See
|
|
3273
|
-
https://cloud.google.com/products/agent-builder
|
|
3209
|
+
https://cloud.google.com/products/agent-builder. This data type is not
|
|
3210
|
+
supported in Gemini API.
|
|
3274
3211
|
"""
|
|
3275
3212
|
|
|
3276
3213
|
data_store_specs: Optional[list[VertexAISearchDataStoreSpecDict]]
|
|
@@ -3293,7 +3230,10 @@ VertexAISearchOrDict = Union[VertexAISearch, VertexAISearchDict]
|
|
|
3293
3230
|
|
|
3294
3231
|
|
|
3295
3232
|
class VertexRagStoreRagResource(_common.BaseModel):
|
|
3296
|
-
"""The definition of the Rag resource.
|
|
3233
|
+
"""The definition of the Rag resource.
|
|
3234
|
+
|
|
3235
|
+
This data type is not supported in Gemini API.
|
|
3236
|
+
"""
|
|
3297
3237
|
|
|
3298
3238
|
rag_corpus: Optional[str] = Field(
|
|
3299
3239
|
default=None,
|
|
@@ -3306,7 +3246,10 @@ class VertexRagStoreRagResource(_common.BaseModel):
|
|
|
3306
3246
|
|
|
3307
3247
|
|
|
3308
3248
|
class VertexRagStoreRagResourceDict(TypedDict, total=False):
|
|
3309
|
-
"""The definition of the Rag resource.
|
|
3249
|
+
"""The definition of the Rag resource.
|
|
3250
|
+
|
|
3251
|
+
This data type is not supported in Gemini API.
|
|
3252
|
+
"""
|
|
3310
3253
|
|
|
3311
3254
|
rag_corpus: Optional[str]
|
|
3312
3255
|
"""Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`"""
|
|
@@ -3321,7 +3264,7 @@ VertexRagStoreRagResourceOrDict = Union[
|
|
|
3321
3264
|
|
|
3322
3265
|
|
|
3323
3266
|
class RagRetrievalConfigFilter(_common.BaseModel):
|
|
3324
|
-
"""Config for filters."""
|
|
3267
|
+
"""Config for filters. This data type is not supported in Gemini API."""
|
|
3325
3268
|
|
|
3326
3269
|
metadata_filter: Optional[str] = Field(
|
|
3327
3270
|
default=None, description="""Optional. String for metadata filtering."""
|
|
@@ -3337,7 +3280,7 @@ class RagRetrievalConfigFilter(_common.BaseModel):
|
|
|
3337
3280
|
|
|
3338
3281
|
|
|
3339
3282
|
class RagRetrievalConfigFilterDict(TypedDict, total=False):
|
|
3340
|
-
"""Config for filters."""
|
|
3283
|
+
"""Config for filters. This data type is not supported in Gemini API."""
|
|
3341
3284
|
|
|
3342
3285
|
metadata_filter: Optional[str]
|
|
3343
3286
|
"""Optional. String for metadata filtering."""
|
|
@@ -3355,7 +3298,7 @@ RagRetrievalConfigFilterOrDict = Union[
|
|
|
3355
3298
|
|
|
3356
3299
|
|
|
3357
3300
|
class RagRetrievalConfigHybridSearch(_common.BaseModel):
|
|
3358
|
-
"""Config for Hybrid Search."""
|
|
3301
|
+
"""Config for Hybrid Search. This data type is not supported in Gemini API."""
|
|
3359
3302
|
|
|
3360
3303
|
alpha: Optional[float] = Field(
|
|
3361
3304
|
default=None,
|
|
@@ -3364,7 +3307,7 @@ class RagRetrievalConfigHybridSearch(_common.BaseModel):
|
|
|
3364
3307
|
|
|
3365
3308
|
|
|
3366
3309
|
class RagRetrievalConfigHybridSearchDict(TypedDict, total=False):
|
|
3367
|
-
"""Config for Hybrid Search."""
|
|
3310
|
+
"""Config for Hybrid Search. This data type is not supported in Gemini API."""
|
|
3368
3311
|
|
|
3369
3312
|
alpha: Optional[float]
|
|
3370
3313
|
"""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 +3319,7 @@ RagRetrievalConfigHybridSearchOrDict = Union[
|
|
|
3376
3319
|
|
|
3377
3320
|
|
|
3378
3321
|
class RagRetrievalConfigRankingLlmRanker(_common.BaseModel):
|
|
3379
|
-
"""Config for LlmRanker."""
|
|
3322
|
+
"""Config for LlmRanker. This data type is not supported in Gemini API."""
|
|
3380
3323
|
|
|
3381
3324
|
model_name: Optional[str] = Field(
|
|
3382
3325
|
default=None,
|
|
@@ -3385,7 +3328,7 @@ class RagRetrievalConfigRankingLlmRanker(_common.BaseModel):
|
|
|
3385
3328
|
|
|
3386
3329
|
|
|
3387
3330
|
class RagRetrievalConfigRankingLlmRankerDict(TypedDict, total=False):
|
|
3388
|
-
"""Config for LlmRanker."""
|
|
3331
|
+
"""Config for LlmRanker. This data type is not supported in Gemini API."""
|
|
3389
3332
|
|
|
3390
3333
|
model_name: Optional[str]
|
|
3391
3334
|
"""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 +3340,7 @@ RagRetrievalConfigRankingLlmRankerOrDict = Union[
|
|
|
3397
3340
|
|
|
3398
3341
|
|
|
3399
3342
|
class RagRetrievalConfigRankingRankService(_common.BaseModel):
|
|
3400
|
-
"""Config for Rank Service."""
|
|
3343
|
+
"""Config for Rank Service. This data type is not supported in Gemini API."""
|
|
3401
3344
|
|
|
3402
3345
|
model_name: Optional[str] = Field(
|
|
3403
3346
|
default=None,
|
|
@@ -3406,7 +3349,7 @@ class RagRetrievalConfigRankingRankService(_common.BaseModel):
|
|
|
3406
3349
|
|
|
3407
3350
|
|
|
3408
3351
|
class RagRetrievalConfigRankingRankServiceDict(TypedDict, total=False):
|
|
3409
|
-
"""Config for Rank Service."""
|
|
3352
|
+
"""Config for Rank Service. This data type is not supported in Gemini API."""
|
|
3410
3353
|
|
|
3411
3354
|
model_name: Optional[str]
|
|
3412
3355
|
"""Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`"""
|
|
@@ -3419,7 +3362,10 @@ RagRetrievalConfigRankingRankServiceOrDict = Union[
|
|
|
3419
3362
|
|
|
3420
3363
|
|
|
3421
3364
|
class RagRetrievalConfigRanking(_common.BaseModel):
|
|
3422
|
-
"""Config for ranking and reranking.
|
|
3365
|
+
"""Config for ranking and reranking.
|
|
3366
|
+
|
|
3367
|
+
This data type is not supported in Gemini API.
|
|
3368
|
+
"""
|
|
3423
3369
|
|
|
3424
3370
|
llm_ranker: Optional[RagRetrievalConfigRankingLlmRanker] = Field(
|
|
3425
3371
|
default=None, description="""Optional. Config for LlmRanker."""
|
|
@@ -3430,7 +3376,10 @@ class RagRetrievalConfigRanking(_common.BaseModel):
|
|
|
3430
3376
|
|
|
3431
3377
|
|
|
3432
3378
|
class RagRetrievalConfigRankingDict(TypedDict, total=False):
|
|
3433
|
-
"""Config for ranking and reranking.
|
|
3379
|
+
"""Config for ranking and reranking.
|
|
3380
|
+
|
|
3381
|
+
This data type is not supported in Gemini API.
|
|
3382
|
+
"""
|
|
3434
3383
|
|
|
3435
3384
|
llm_ranker: Optional[RagRetrievalConfigRankingLlmRankerDict]
|
|
3436
3385
|
"""Optional. Config for LlmRanker."""
|
|
@@ -3445,7 +3394,10 @@ RagRetrievalConfigRankingOrDict = Union[
|
|
|
3445
3394
|
|
|
3446
3395
|
|
|
3447
3396
|
class RagRetrievalConfig(_common.BaseModel):
|
|
3448
|
-
"""Specifies the context retrieval config.
|
|
3397
|
+
"""Specifies the context retrieval config.
|
|
3398
|
+
|
|
3399
|
+
This data type is not supported in Gemini API.
|
|
3400
|
+
"""
|
|
3449
3401
|
|
|
3450
3402
|
filter: Optional[RagRetrievalConfigFilter] = Field(
|
|
3451
3403
|
default=None, description="""Optional. Config for filters."""
|
|
@@ -3464,7 +3416,10 @@ class RagRetrievalConfig(_common.BaseModel):
|
|
|
3464
3416
|
|
|
3465
3417
|
|
|
3466
3418
|
class RagRetrievalConfigDict(TypedDict, total=False):
|
|
3467
|
-
"""Specifies the context retrieval config.
|
|
3419
|
+
"""Specifies the context retrieval config.
|
|
3420
|
+
|
|
3421
|
+
This data type is not supported in Gemini API.
|
|
3422
|
+
"""
|
|
3468
3423
|
|
|
3469
3424
|
filter: Optional[RagRetrievalConfigFilterDict]
|
|
3470
3425
|
"""Optional. Config for filters."""
|
|
@@ -3483,7 +3438,10 @@ RagRetrievalConfigOrDict = Union[RagRetrievalConfig, RagRetrievalConfigDict]
|
|
|
3483
3438
|
|
|
3484
3439
|
|
|
3485
3440
|
class VertexRagStore(_common.BaseModel):
|
|
3486
|
-
"""Retrieve from Vertex RAG Store for grounding.
|
|
3441
|
+
"""Retrieve from Vertex RAG Store for grounding.
|
|
3442
|
+
|
|
3443
|
+
This data type is not supported in Gemini API.
|
|
3444
|
+
"""
|
|
3487
3445
|
|
|
3488
3446
|
rag_corpora: Optional[list[str]] = Field(
|
|
3489
3447
|
default=None,
|
|
@@ -3512,7 +3470,10 @@ class VertexRagStore(_common.BaseModel):
|
|
|
3512
3470
|
|
|
3513
3471
|
|
|
3514
3472
|
class VertexRagStoreDict(TypedDict, total=False):
|
|
3515
|
-
"""Retrieve from Vertex RAG Store for grounding.
|
|
3473
|
+
"""Retrieve from Vertex RAG Store for grounding.
|
|
3474
|
+
|
|
3475
|
+
This data type is not supported in Gemini API.
|
|
3476
|
+
"""
|
|
3516
3477
|
|
|
3517
3478
|
rag_corpora: Optional[list[str]]
|
|
3518
3479
|
"""Optional. Deprecated. Please use rag_resources instead."""
|
|
@@ -3537,7 +3498,10 @@ VertexRagStoreOrDict = Union[VertexRagStore, VertexRagStoreDict]
|
|
|
3537
3498
|
|
|
3538
3499
|
|
|
3539
3500
|
class Retrieval(_common.BaseModel):
|
|
3540
|
-
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3501
|
+
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3502
|
+
|
|
3503
|
+
This data type is not supported in Gemini API.
|
|
3504
|
+
"""
|
|
3541
3505
|
|
|
3542
3506
|
disable_attribution: Optional[bool] = Field(
|
|
3543
3507
|
default=None,
|
|
@@ -3558,7 +3522,10 @@ class Retrieval(_common.BaseModel):
|
|
|
3558
3522
|
|
|
3559
3523
|
|
|
3560
3524
|
class RetrievalDict(TypedDict, total=False):
|
|
3561
|
-
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3525
|
+
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3526
|
+
|
|
3527
|
+
This data type is not supported in Gemini API.
|
|
3528
|
+
"""
|
|
3562
3529
|
|
|
3563
3530
|
disable_attribution: Optional[bool]
|
|
3564
3531
|
"""Optional. Deprecated. This option is no longer supported."""
|
|
@@ -3580,7 +3547,7 @@ class ToolCodeExecution(_common.BaseModel):
|
|
|
3580
3547
|
"""Tool that executes code generated by the model, and automatically returns the result to the model.
|
|
3581
3548
|
|
|
3582
3549
|
See also [ExecutableCode]and [CodeExecutionResult] which are input and output
|
|
3583
|
-
to this tool.
|
|
3550
|
+
to this tool. This data type is not supported in Gemini API.
|
|
3584
3551
|
"""
|
|
3585
3552
|
|
|
3586
3553
|
pass
|
|
@@ -3590,7 +3557,7 @@ class ToolCodeExecutionDict(TypedDict, total=False):
|
|
|
3590
3557
|
"""Tool that executes code generated by the model, and automatically returns the result to the model.
|
|
3591
3558
|
|
|
3592
3559
|
See also [ExecutableCode]and [CodeExecutionResult] which are input and output
|
|
3593
|
-
to this tool.
|
|
3560
|
+
to this tool. This data type is not supported in Gemini API.
|
|
3594
3561
|
"""
|
|
3595
3562
|
|
|
3596
3563
|
pass
|
|
@@ -3599,6 +3566,128 @@ class ToolCodeExecutionDict(TypedDict, total=False):
|
|
|
3599
3566
|
ToolCodeExecutionOrDict = Union[ToolCodeExecution, ToolCodeExecutionDict]
|
|
3600
3567
|
|
|
3601
3568
|
|
|
3569
|
+
class EnterpriseWebSearch(_common.BaseModel):
|
|
3570
|
+
"""Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.
|
|
3571
|
+
|
|
3572
|
+
This data type is not supported in Gemini API.
|
|
3573
|
+
"""
|
|
3574
|
+
|
|
3575
|
+
exclude_domains: Optional[list[str]] = Field(
|
|
3576
|
+
default=None,
|
|
3577
|
+
description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.""",
|
|
3578
|
+
)
|
|
3579
|
+
blocking_confidence: Optional[PhishBlockThreshold] = Field(
|
|
3580
|
+
default=None,
|
|
3581
|
+
description="""Optional. Sites with confidence level chosen & above this value will be blocked from the search results.""",
|
|
3582
|
+
)
|
|
3583
|
+
|
|
3584
|
+
|
|
3585
|
+
class EnterpriseWebSearchDict(TypedDict, total=False):
|
|
3586
|
+
"""Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.
|
|
3587
|
+
|
|
3588
|
+
This data type is not supported in Gemini API.
|
|
3589
|
+
"""
|
|
3590
|
+
|
|
3591
|
+
exclude_domains: Optional[list[str]]
|
|
3592
|
+
"""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains."""
|
|
3593
|
+
|
|
3594
|
+
blocking_confidence: Optional[PhishBlockThreshold]
|
|
3595
|
+
"""Optional. Sites with confidence level chosen & above this value will be blocked from the search results."""
|
|
3596
|
+
|
|
3597
|
+
|
|
3598
|
+
EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
|
|
3599
|
+
|
|
3600
|
+
|
|
3601
|
+
class Interval(_common.BaseModel):
|
|
3602
|
+
"""Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
|
|
3603
|
+
|
|
3604
|
+
The start must be less than or equal to the end. When the start equals the
|
|
3605
|
+
end, the interval is empty (matches no time). When both start and end are
|
|
3606
|
+
unspecified, the interval matches any time.
|
|
3607
|
+
"""
|
|
3608
|
+
|
|
3609
|
+
end_time: Optional[datetime.datetime] = Field(
|
|
3610
|
+
default=None,
|
|
3611
|
+
description="""Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.""",
|
|
3612
|
+
)
|
|
3613
|
+
start_time: Optional[datetime.datetime] = Field(
|
|
3614
|
+
default=None,
|
|
3615
|
+
description="""Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.""",
|
|
3616
|
+
)
|
|
3617
|
+
|
|
3618
|
+
|
|
3619
|
+
class IntervalDict(TypedDict, total=False):
|
|
3620
|
+
"""Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
|
|
3621
|
+
|
|
3622
|
+
The start must be less than or equal to the end. When the start equals the
|
|
3623
|
+
end, the interval is empty (matches no time). When both start and end are
|
|
3624
|
+
unspecified, the interval matches any time.
|
|
3625
|
+
"""
|
|
3626
|
+
|
|
3627
|
+
end_time: Optional[datetime.datetime]
|
|
3628
|
+
"""Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end."""
|
|
3629
|
+
|
|
3630
|
+
start_time: Optional[datetime.datetime]
|
|
3631
|
+
"""Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start."""
|
|
3632
|
+
|
|
3633
|
+
|
|
3634
|
+
IntervalOrDict = Union[Interval, IntervalDict]
|
|
3635
|
+
|
|
3636
|
+
|
|
3637
|
+
class GoogleSearch(_common.BaseModel):
|
|
3638
|
+
"""GoogleSearch tool type.
|
|
3639
|
+
|
|
3640
|
+
Tool to support Google Search in Model. Powered by Google.
|
|
3641
|
+
"""
|
|
3642
|
+
|
|
3643
|
+
exclude_domains: Optional[list[str]] = Field(
|
|
3644
|
+
default=None,
|
|
3645
|
+
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.""",
|
|
3646
|
+
)
|
|
3647
|
+
blocking_confidence: Optional[PhishBlockThreshold] = Field(
|
|
3648
|
+
default=None,
|
|
3649
|
+
description="""Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API.""",
|
|
3650
|
+
)
|
|
3651
|
+
time_range_filter: Optional[Interval] = Field(
|
|
3652
|
+
default=None,
|
|
3653
|
+
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.""",
|
|
3654
|
+
)
|
|
3655
|
+
|
|
3656
|
+
|
|
3657
|
+
class GoogleSearchDict(TypedDict, total=False):
|
|
3658
|
+
"""GoogleSearch tool type.
|
|
3659
|
+
|
|
3660
|
+
Tool to support Google Search in Model. Powered by Google.
|
|
3661
|
+
"""
|
|
3662
|
+
|
|
3663
|
+
exclude_domains: Optional[list[str]]
|
|
3664
|
+
"""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."""
|
|
3665
|
+
|
|
3666
|
+
blocking_confidence: Optional[PhishBlockThreshold]
|
|
3667
|
+
"""Optional. Sites with confidence level chosen & above this value will be blocked from the search results. This field is not supported in Gemini API."""
|
|
3668
|
+
|
|
3669
|
+
time_range_filter: Optional[IntervalDict]
|
|
3670
|
+
"""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."""
|
|
3671
|
+
|
|
3672
|
+
|
|
3673
|
+
GoogleSearchOrDict = Union[GoogleSearch, GoogleSearchDict]
|
|
3674
|
+
|
|
3675
|
+
|
|
3676
|
+
class UrlContext(_common.BaseModel):
|
|
3677
|
+
"""Tool to support URL context."""
|
|
3678
|
+
|
|
3679
|
+
pass
|
|
3680
|
+
|
|
3681
|
+
|
|
3682
|
+
class UrlContextDict(TypedDict, total=False):
|
|
3683
|
+
"""Tool to support URL context."""
|
|
3684
|
+
|
|
3685
|
+
pass
|
|
3686
|
+
|
|
3687
|
+
|
|
3688
|
+
UrlContextOrDict = Union[UrlContext, UrlContextDict]
|
|
3689
|
+
|
|
3690
|
+
|
|
3602
3691
|
class Tool(_common.BaseModel):
|
|
3603
3692
|
"""Tool details of a tool that the model may use to generate a response."""
|
|
3604
3693
|
|
|
@@ -3608,31 +3697,17 @@ class Tool(_common.BaseModel):
|
|
|
3608
3697
|
)
|
|
3609
3698
|
retrieval: Optional[Retrieval] = Field(
|
|
3610
3699
|
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.""",
|
|
3700
|
+
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
3701
|
)
|
|
3618
3702
|
google_search_retrieval: Optional[GoogleSearchRetrieval] = Field(
|
|
3619
3703
|
default=None,
|
|
3620
3704
|
description="""Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.""",
|
|
3621
3705
|
)
|
|
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
3706
|
google_maps: Optional[GoogleMaps] = Field(
|
|
3628
3707
|
default=None,
|
|
3629
3708
|
description="""Optional. Google Maps tool type. Specialized retrieval tool
|
|
3630
3709
|
that is powered by Google Maps.""",
|
|
3631
3710
|
)
|
|
3632
|
-
url_context: Optional[UrlContext] = Field(
|
|
3633
|
-
default=None,
|
|
3634
|
-
description="""Optional. Tool to support URL context retrieval.""",
|
|
3635
|
-
)
|
|
3636
3711
|
computer_use: Optional[ComputerUse] = Field(
|
|
3637
3712
|
default=None,
|
|
3638
3713
|
description="""Optional. Tool to support the model interacting directly with the
|
|
@@ -3643,6 +3718,18 @@ class Tool(_common.BaseModel):
|
|
|
3643
3718
|
default=None,
|
|
3644
3719
|
description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
|
|
3645
3720
|
)
|
|
3721
|
+
enterprise_web_search: Optional[EnterpriseWebSearch] = Field(
|
|
3722
|
+
default=None,
|
|
3723
|
+
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.""",
|
|
3724
|
+
)
|
|
3725
|
+
google_search: Optional[GoogleSearch] = Field(
|
|
3726
|
+
default=None,
|
|
3727
|
+
description="""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.""",
|
|
3728
|
+
)
|
|
3729
|
+
url_context: Optional[UrlContext] = Field(
|
|
3730
|
+
default=None,
|
|
3731
|
+
description="""Optional. Tool to support URL context retrieval.""",
|
|
3732
|
+
)
|
|
3646
3733
|
|
|
3647
3734
|
|
|
3648
3735
|
class ToolDict(TypedDict, total=False):
|
|
@@ -3652,26 +3739,15 @@ class ToolDict(TypedDict, total=False):
|
|
|
3652
3739
|
"""List of function declarations that the tool supports."""
|
|
3653
3740
|
|
|
3654
3741
|
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."""
|
|
3742
|
+
"""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
3743
|
|
|
3661
3744
|
google_search_retrieval: Optional[GoogleSearchRetrievalDict]
|
|
3662
3745
|
"""Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."""
|
|
3663
3746
|
|
|
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
3747
|
google_maps: Optional[GoogleMapsDict]
|
|
3669
3748
|
"""Optional. Google Maps tool type. Specialized retrieval tool
|
|
3670
3749
|
that is powered by Google Maps."""
|
|
3671
3750
|
|
|
3672
|
-
url_context: Optional[UrlContextDict]
|
|
3673
|
-
"""Optional. Tool to support URL context retrieval."""
|
|
3674
|
-
|
|
3675
3751
|
computer_use: Optional[ComputerUseDict]
|
|
3676
3752
|
"""Optional. Tool to support the model interacting directly with the
|
|
3677
3753
|
computer. If enabled, it automatically populates computer-use specific
|
|
@@ -3680,6 +3756,15 @@ class ToolDict(TypedDict, total=False):
|
|
|
3680
3756
|
code_execution: Optional[ToolCodeExecutionDict]
|
|
3681
3757
|
"""Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
|
|
3682
3758
|
|
|
3759
|
+
enterprise_web_search: Optional[EnterpriseWebSearchDict]
|
|
3760
|
+
"""Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API."""
|
|
3761
|
+
|
|
3762
|
+
google_search: Optional[GoogleSearchDict]
|
|
3763
|
+
"""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."""
|
|
3764
|
+
|
|
3765
|
+
url_context: Optional[UrlContextDict]
|
|
3766
|
+
"""Optional. Tool to support URL context retrieval."""
|
|
3767
|
+
|
|
3683
3768
|
|
|
3684
3769
|
ToolOrDict = Union[Tool, ToolDict]
|
|
3685
3770
|
if _is_mcp_imported:
|
|
@@ -3819,135 +3904,6 @@ class ToolConfigDict(TypedDict, total=False):
|
|
|
3819
3904
|
ToolConfigOrDict = Union[ToolConfig, ToolConfigDict]
|
|
3820
3905
|
|
|
3821
3906
|
|
|
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
3907
|
class AutomaticFunctionCallingConfig(_common.BaseModel):
|
|
3952
3908
|
"""The configuration for automatic function calling."""
|
|
3953
3909
|
|
|
@@ -4215,7 +4171,10 @@ ContentUnionDict = Union[
|
|
|
4215
4171
|
|
|
4216
4172
|
|
|
4217
4173
|
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.
|
|
4174
|
+
"""When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
|
|
4175
|
+
|
|
4176
|
+
This data type is not supported in Gemini API.
|
|
4177
|
+
"""
|
|
4219
4178
|
|
|
4220
4179
|
model_routing_preference: Optional[
|
|
4221
4180
|
Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']
|
|
@@ -4223,7 +4182,10 @@ class GenerationConfigRoutingConfigAutoRoutingMode(_common.BaseModel):
|
|
|
4223
4182
|
|
|
4224
4183
|
|
|
4225
4184
|
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.
|
|
4185
|
+
"""When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
|
|
4186
|
+
|
|
4187
|
+
This data type is not supported in Gemini API.
|
|
4188
|
+
"""
|
|
4227
4189
|
|
|
4228
4190
|
model_routing_preference: Optional[
|
|
4229
4191
|
Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']
|
|
@@ -4238,7 +4200,10 @@ GenerationConfigRoutingConfigAutoRoutingModeOrDict = Union[
|
|
|
4238
4200
|
|
|
4239
4201
|
|
|
4240
4202
|
class GenerationConfigRoutingConfigManualRoutingMode(_common.BaseModel):
|
|
4241
|
-
"""When manual routing is set, the specified model will be used directly.
|
|
4203
|
+
"""When manual routing is set, the specified model will be used directly.
|
|
4204
|
+
|
|
4205
|
+
This data type is not supported in Gemini API.
|
|
4206
|
+
"""
|
|
4242
4207
|
|
|
4243
4208
|
model_name: Optional[str] = Field(
|
|
4244
4209
|
default=None,
|
|
@@ -4246,45 +4211,117 @@ class GenerationConfigRoutingConfigManualRoutingMode(_common.BaseModel):
|
|
|
4246
4211
|
)
|
|
4247
4212
|
|
|
4248
4213
|
|
|
4249
|
-
class GenerationConfigRoutingConfigManualRoutingModeDict(
|
|
4250
|
-
TypedDict, total=False
|
|
4251
|
-
):
|
|
4252
|
-
"""When manual routing is set, the specified model will be used directly.
|
|
4214
|
+
class GenerationConfigRoutingConfigManualRoutingModeDict(
|
|
4215
|
+
TypedDict, total=False
|
|
4216
|
+
):
|
|
4217
|
+
"""When manual routing is set, the specified model will be used directly.
|
|
4218
|
+
|
|
4219
|
+
This data type is not supported in Gemini API.
|
|
4220
|
+
"""
|
|
4221
|
+
|
|
4222
|
+
model_name: Optional[str]
|
|
4223
|
+
"""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)."""
|
|
4224
|
+
|
|
4225
|
+
|
|
4226
|
+
GenerationConfigRoutingConfigManualRoutingModeOrDict = Union[
|
|
4227
|
+
GenerationConfigRoutingConfigManualRoutingMode,
|
|
4228
|
+
GenerationConfigRoutingConfigManualRoutingModeDict,
|
|
4229
|
+
]
|
|
4230
|
+
|
|
4231
|
+
|
|
4232
|
+
class GenerationConfigRoutingConfig(_common.BaseModel):
|
|
4233
|
+
"""The configuration for routing the request to a specific model.
|
|
4234
|
+
|
|
4235
|
+
This data type is not supported in Gemini API.
|
|
4236
|
+
"""
|
|
4237
|
+
|
|
4238
|
+
auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingMode] = Field(
|
|
4239
|
+
default=None, description="""Automated routing."""
|
|
4240
|
+
)
|
|
4241
|
+
manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingMode] = Field(
|
|
4242
|
+
default=None, description="""Manual routing."""
|
|
4243
|
+
)
|
|
4244
|
+
|
|
4245
|
+
|
|
4246
|
+
class GenerationConfigRoutingConfigDict(TypedDict, total=False):
|
|
4247
|
+
"""The configuration for routing the request to a specific model.
|
|
4248
|
+
|
|
4249
|
+
This data type is not supported in Gemini API.
|
|
4250
|
+
"""
|
|
4251
|
+
|
|
4252
|
+
auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingModeDict]
|
|
4253
|
+
"""Automated routing."""
|
|
4254
|
+
|
|
4255
|
+
manual_mode: Optional[GenerationConfigRoutingConfigManualRoutingModeDict]
|
|
4256
|
+
"""Manual routing."""
|
|
4257
|
+
|
|
4258
|
+
|
|
4259
|
+
GenerationConfigRoutingConfigOrDict = Union[
|
|
4260
|
+
GenerationConfigRoutingConfig, GenerationConfigRoutingConfigDict
|
|
4261
|
+
]
|
|
4262
|
+
|
|
4263
|
+
|
|
4264
|
+
class SafetySetting(_common.BaseModel):
|
|
4265
|
+
"""Safety settings."""
|
|
4266
|
+
|
|
4267
|
+
category: Optional[HarmCategory] = Field(
|
|
4268
|
+
default=None, description="""Required. Harm category."""
|
|
4269
|
+
)
|
|
4270
|
+
method: Optional[HarmBlockMethod] = Field(
|
|
4271
|
+
default=None,
|
|
4272
|
+
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.""",
|
|
4273
|
+
)
|
|
4274
|
+
threshold: Optional[HarmBlockThreshold] = Field(
|
|
4275
|
+
default=None, description="""Required. The harm block threshold."""
|
|
4276
|
+
)
|
|
4277
|
+
|
|
4278
|
+
|
|
4279
|
+
class SafetySettingDict(TypedDict, total=False):
|
|
4280
|
+
"""Safety settings."""
|
|
4281
|
+
|
|
4282
|
+
category: Optional[HarmCategory]
|
|
4283
|
+
"""Required. Harm category."""
|
|
4284
|
+
|
|
4285
|
+
method: Optional[HarmBlockMethod]
|
|
4286
|
+
"""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."""
|
|
4253
4287
|
|
|
4254
|
-
|
|
4255
|
-
"""
|
|
4288
|
+
threshold: Optional[HarmBlockThreshold]
|
|
4289
|
+
"""Required. The harm block threshold."""
|
|
4256
4290
|
|
|
4257
4291
|
|
|
4258
|
-
|
|
4259
|
-
GenerationConfigRoutingConfigManualRoutingMode,
|
|
4260
|
-
GenerationConfigRoutingConfigManualRoutingModeDict,
|
|
4261
|
-
]
|
|
4292
|
+
SafetySettingOrDict = Union[SafetySetting, SafetySettingDict]
|
|
4262
4293
|
|
|
4263
4294
|
|
|
4264
|
-
class
|
|
4265
|
-
"""The
|
|
4295
|
+
class SpeechConfig(_common.BaseModel):
|
|
4296
|
+
"""The speech generation config."""
|
|
4266
4297
|
|
|
4267
|
-
|
|
4268
|
-
default=None,
|
|
4298
|
+
language_code: Optional[str] = Field(
|
|
4299
|
+
default=None,
|
|
4300
|
+
description="""Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization.""",
|
|
4269
4301
|
)
|
|
4270
|
-
|
|
4271
|
-
default=None, description="""
|
|
4302
|
+
voice_config: Optional['VoiceConfig'] = Field(
|
|
4303
|
+
default=None, description="""The configuration for the speaker to use."""
|
|
4304
|
+
)
|
|
4305
|
+
multi_speaker_voice_config: Optional['MultiSpeakerVoiceConfig'] = Field(
|
|
4306
|
+
default=None,
|
|
4307
|
+
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
4308
|
)
|
|
4273
4309
|
|
|
4274
4310
|
|
|
4275
|
-
class
|
|
4276
|
-
"""The
|
|
4311
|
+
class SpeechConfigDict(TypedDict, total=False):
|
|
4312
|
+
"""The speech generation config."""
|
|
4277
4313
|
|
|
4278
|
-
|
|
4279
|
-
"""
|
|
4314
|
+
language_code: Optional[str]
|
|
4315
|
+
"""Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization."""
|
|
4280
4316
|
|
|
4281
|
-
|
|
4282
|
-
"""
|
|
4317
|
+
voice_config: Optional['VoiceConfigDict']
|
|
4318
|
+
"""The configuration for the speaker to use."""
|
|
4283
4319
|
|
|
4320
|
+
multi_speaker_voice_config: Optional['MultiSpeakerVoiceConfigDict']
|
|
4321
|
+
"""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
4322
|
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
]
|
|
4323
|
+
|
|
4324
|
+
SpeechConfigOrDict = Union[SpeechConfig, SpeechConfigDict]
|
|
4288
4325
|
|
|
4289
4326
|
|
|
4290
4327
|
SpeechConfigUnion = Union[str, SpeechConfig]
|
|
@@ -4790,7 +4827,8 @@ class GoogleTypeDate(_common.BaseModel):
|
|
|
4790
4827
|
day values. * A month and day, with a zero year (for example, an anniversary).
|
|
4791
4828
|
* A year on its own, with a zero month and a zero day. * A year and month,
|
|
4792
4829
|
with a zero day (for example, a credit card expiration date). Related types: *
|
|
4793
|
-
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
|
|
4830
|
+
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This
|
|
4831
|
+
data type is not supported in Gemini API.
|
|
4794
4832
|
"""
|
|
4795
4833
|
|
|
4796
4834
|
day: Optional[int] = Field(
|
|
@@ -4816,7 +4854,8 @@ class GoogleTypeDateDict(TypedDict, total=False):
|
|
|
4816
4854
|
day values. * A month and day, with a zero year (for example, an anniversary).
|
|
4817
4855
|
* A year on its own, with a zero month and a zero day. * A year and month,
|
|
4818
4856
|
with a zero day (for example, a credit card expiration date). Related types: *
|
|
4819
|
-
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
|
|
4857
|
+
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This
|
|
4858
|
+
data type is not supported in Gemini API.
|
|
4820
4859
|
"""
|
|
4821
4860
|
|
|
4822
4861
|
day: Optional[int]
|
|
@@ -4833,7 +4872,10 @@ GoogleTypeDateOrDict = Union[GoogleTypeDate, GoogleTypeDateDict]
|
|
|
4833
4872
|
|
|
4834
4873
|
|
|
4835
4874
|
class Citation(_common.BaseModel):
|
|
4836
|
-
"""Source attributions for content.
|
|
4875
|
+
"""Source attributions for content.
|
|
4876
|
+
|
|
4877
|
+
This data type is not supported in Gemini API.
|
|
4878
|
+
"""
|
|
4837
4879
|
|
|
4838
4880
|
end_index: Optional[int] = Field(
|
|
4839
4881
|
default=None, description="""Output only. End index into the content."""
|
|
@@ -4858,7 +4900,10 @@ class Citation(_common.BaseModel):
|
|
|
4858
4900
|
|
|
4859
4901
|
|
|
4860
4902
|
class CitationDict(TypedDict, total=False):
|
|
4861
|
-
"""Source attributions for content.
|
|
4903
|
+
"""Source attributions for content.
|
|
4904
|
+
|
|
4905
|
+
This data type is not supported in Gemini API.
|
|
4906
|
+
"""
|
|
4862
4907
|
|
|
4863
4908
|
end_index: Optional[int]
|
|
4864
4909
|
"""Output only. End index into the content."""
|
|
@@ -4907,50 +4952,11 @@ class CitationMetadataDict(TypedDict, total=False):
|
|
|
4907
4952
|
CitationMetadataOrDict = Union[CitationMetadata, CitationMetadataDict]
|
|
4908
4953
|
|
|
4909
4954
|
|
|
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
4955
|
class GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution(_common.BaseModel):
|
|
4953
|
-
"""Author attribution for a photo or review.
|
|
4956
|
+
"""Author attribution for a photo or review.
|
|
4957
|
+
|
|
4958
|
+
This data type is not supported in Gemini API.
|
|
4959
|
+
"""
|
|
4954
4960
|
|
|
4955
4961
|
display_name: Optional[str] = Field(
|
|
4956
4962
|
default=None, description="""Name of the author of the Photo or Review."""
|
|
@@ -4967,7 +4973,10 @@ class GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution(_common.BaseModel):
|
|
|
4967
4973
|
class GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionDict(
|
|
4968
4974
|
TypedDict, total=False
|
|
4969
4975
|
):
|
|
4970
|
-
"""Author attribution for a photo or review.
|
|
4976
|
+
"""Author attribution for a photo or review.
|
|
4977
|
+
|
|
4978
|
+
This data type is not supported in Gemini API.
|
|
4979
|
+
"""
|
|
4971
4980
|
|
|
4972
4981
|
display_name: Optional[str]
|
|
4973
4982
|
"""Name of the author of the Photo or Review."""
|
|
@@ -4986,7 +4995,10 @@ GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionOrDict = Union[
|
|
|
4986
4995
|
|
|
4987
4996
|
|
|
4988
4997
|
class GroundingChunkMapsPlaceAnswerSourcesReviewSnippet(_common.BaseModel):
|
|
4989
|
-
"""Encapsulates a review snippet.
|
|
4998
|
+
"""Encapsulates a review snippet.
|
|
4999
|
+
|
|
5000
|
+
This data type is not supported in Gemini API.
|
|
5001
|
+
"""
|
|
4990
5002
|
|
|
4991
5003
|
author_attribution: Optional[
|
|
4992
5004
|
GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution
|
|
@@ -5017,7 +5029,10 @@ class GroundingChunkMapsPlaceAnswerSourcesReviewSnippet(_common.BaseModel):
|
|
|
5017
5029
|
class GroundingChunkMapsPlaceAnswerSourcesReviewSnippetDict(
|
|
5018
5030
|
TypedDict, total=False
|
|
5019
5031
|
):
|
|
5020
|
-
"""Encapsulates a review snippet.
|
|
5032
|
+
"""Encapsulates a review snippet.
|
|
5033
|
+
|
|
5034
|
+
This data type is not supported in Gemini API.
|
|
5035
|
+
"""
|
|
5021
5036
|
|
|
5022
5037
|
author_attribution: Optional[
|
|
5023
5038
|
GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionDict
|
|
@@ -5050,7 +5065,10 @@ GroundingChunkMapsPlaceAnswerSourcesReviewSnippetOrDict = Union[
|
|
|
5050
5065
|
|
|
5051
5066
|
|
|
5052
5067
|
class GroundingChunkMapsPlaceAnswerSources(_common.BaseModel):
|
|
5053
|
-
"""Sources used to generate the place answer.
|
|
5068
|
+
"""Sources used to generate the place answer.
|
|
5069
|
+
|
|
5070
|
+
This data type is not supported in Gemini API.
|
|
5071
|
+
"""
|
|
5054
5072
|
|
|
5055
5073
|
flag_content_uri: Optional[str] = Field(
|
|
5056
5074
|
default=None,
|
|
@@ -5065,7 +5083,10 @@ class GroundingChunkMapsPlaceAnswerSources(_common.BaseModel):
|
|
|
5065
5083
|
|
|
5066
5084
|
|
|
5067
5085
|
class GroundingChunkMapsPlaceAnswerSourcesDict(TypedDict, total=False):
|
|
5068
|
-
"""Sources used to generate the place answer.
|
|
5086
|
+
"""Sources used to generate the place answer.
|
|
5087
|
+
|
|
5088
|
+
This data type is not supported in Gemini API.
|
|
5089
|
+
"""
|
|
5069
5090
|
|
|
5070
5091
|
flag_content_uri: Optional[str]
|
|
5071
5092
|
"""A link where users can flag a problem with the generated answer."""
|
|
@@ -5083,7 +5104,7 @@ GroundingChunkMapsPlaceAnswerSourcesOrDict = Union[
|
|
|
5083
5104
|
|
|
5084
5105
|
|
|
5085
5106
|
class GroundingChunkMaps(_common.BaseModel):
|
|
5086
|
-
"""Chunk from Google Maps."""
|
|
5107
|
+
"""Chunk from Google Maps. This data type is not supported in Gemini API."""
|
|
5087
5108
|
|
|
5088
5109
|
place_answer_sources: Optional[GroundingChunkMapsPlaceAnswerSources] = Field(
|
|
5089
5110
|
default=None,
|
|
@@ -5105,7 +5126,7 @@ class GroundingChunkMaps(_common.BaseModel):
|
|
|
5105
5126
|
|
|
5106
5127
|
|
|
5107
5128
|
class GroundingChunkMapsDict(TypedDict, total=False):
|
|
5108
|
-
"""Chunk from Google Maps."""
|
|
5129
|
+
"""Chunk from Google Maps. This data type is not supported in Gemini API."""
|
|
5109
5130
|
|
|
5110
5131
|
place_answer_sources: Optional[GroundingChunkMapsPlaceAnswerSourcesDict]
|
|
5111
5132
|
"""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 +5148,10 @@ GroundingChunkMapsOrDict = Union[GroundingChunkMaps, GroundingChunkMapsDict]
|
|
|
5127
5148
|
|
|
5128
5149
|
|
|
5129
5150
|
class RagChunkPageSpan(_common.BaseModel):
|
|
5130
|
-
"""Represents where the chunk starts and ends in the document.
|
|
5151
|
+
"""Represents where the chunk starts and ends in the document.
|
|
5152
|
+
|
|
5153
|
+
This data type is not supported in Gemini API.
|
|
5154
|
+
"""
|
|
5131
5155
|
|
|
5132
5156
|
first_page: Optional[int] = Field(
|
|
5133
5157
|
default=None,
|
|
@@ -5140,7 +5164,10 @@ class RagChunkPageSpan(_common.BaseModel):
|
|
|
5140
5164
|
|
|
5141
5165
|
|
|
5142
5166
|
class RagChunkPageSpanDict(TypedDict, total=False):
|
|
5143
|
-
"""Represents where the chunk starts and ends in the document.
|
|
5167
|
+
"""Represents where the chunk starts and ends in the document.
|
|
5168
|
+
|
|
5169
|
+
This data type is not supported in Gemini API.
|
|
5170
|
+
"""
|
|
5144
5171
|
|
|
5145
5172
|
first_page: Optional[int]
|
|
5146
5173
|
"""Page where chunk starts in the document. Inclusive. 1-indexed."""
|
|
@@ -5153,7 +5180,10 @@ RagChunkPageSpanOrDict = Union[RagChunkPageSpan, RagChunkPageSpanDict]
|
|
|
5153
5180
|
|
|
5154
5181
|
|
|
5155
5182
|
class RagChunk(_common.BaseModel):
|
|
5156
|
-
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5183
|
+
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5184
|
+
|
|
5185
|
+
This data type is not supported in Gemini API.
|
|
5186
|
+
"""
|
|
5157
5187
|
|
|
5158
5188
|
page_span: Optional[RagChunkPageSpan] = Field(
|
|
5159
5189
|
default=None,
|
|
@@ -5165,7 +5195,10 @@ class RagChunk(_common.BaseModel):
|
|
|
5165
5195
|
|
|
5166
5196
|
|
|
5167
5197
|
class RagChunkDict(TypedDict, total=False):
|
|
5168
|
-
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5198
|
+
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5199
|
+
|
|
5200
|
+
This data type is not supported in Gemini API.
|
|
5201
|
+
"""
|
|
5169
5202
|
|
|
5170
5203
|
page_span: Optional[RagChunkPageSpanDict]
|
|
5171
5204
|
"""If populated, represents where the chunk starts and ends in the document."""
|
|
@@ -5178,7 +5211,10 @@ RagChunkOrDict = Union[RagChunk, RagChunkDict]
|
|
|
5178
5211
|
|
|
5179
5212
|
|
|
5180
5213
|
class GroundingChunkRetrievedContext(_common.BaseModel):
|
|
5181
|
-
"""Chunk from context retrieved by the retrieval tools.
|
|
5214
|
+
"""Chunk from context retrieved by the retrieval tools.
|
|
5215
|
+
|
|
5216
|
+
This data type is not supported in Gemini API.
|
|
5217
|
+
"""
|
|
5182
5218
|
|
|
5183
5219
|
document_name: Optional[str] = Field(
|
|
5184
5220
|
default=None,
|
|
@@ -5200,7 +5236,10 @@ class GroundingChunkRetrievedContext(_common.BaseModel):
|
|
|
5200
5236
|
|
|
5201
5237
|
|
|
5202
5238
|
class GroundingChunkRetrievedContextDict(TypedDict, total=False):
|
|
5203
|
-
"""Chunk from context retrieved by the retrieval tools.
|
|
5239
|
+
"""Chunk from context retrieved by the retrieval tools.
|
|
5240
|
+
|
|
5241
|
+
This data type is not supported in Gemini API.
|
|
5242
|
+
"""
|
|
5204
5243
|
|
|
5205
5244
|
document_name: Optional[str]
|
|
5206
5245
|
"""Output only. The full document name for the referenced Vertex AI Search document."""
|
|
@@ -5227,7 +5266,8 @@ class GroundingChunkWeb(_common.BaseModel):
|
|
|
5227
5266
|
"""Chunk from the web."""
|
|
5228
5267
|
|
|
5229
5268
|
domain: Optional[str] = Field(
|
|
5230
|
-
default=None,
|
|
5269
|
+
default=None,
|
|
5270
|
+
description="""Domain of the (original) URI. This field is not supported in Gemini API.""",
|
|
5231
5271
|
)
|
|
5232
5272
|
title: Optional[str] = Field(
|
|
5233
5273
|
default=None, description="""Title of the chunk."""
|
|
@@ -5241,7 +5281,7 @@ class GroundingChunkWebDict(TypedDict, total=False):
|
|
|
5241
5281
|
"""Chunk from the web."""
|
|
5242
5282
|
|
|
5243
5283
|
domain: Optional[str]
|
|
5244
|
-
"""Domain of the (original) URI."""
|
|
5284
|
+
"""Domain of the (original) URI. This field is not supported in Gemini API."""
|
|
5245
5285
|
|
|
5246
5286
|
title: Optional[str]
|
|
5247
5287
|
"""Title of the chunk."""
|
|
@@ -5257,11 +5297,12 @@ class GroundingChunk(_common.BaseModel):
|
|
|
5257
5297
|
"""Grounding chunk."""
|
|
5258
5298
|
|
|
5259
5299
|
maps: Optional[GroundingChunkMaps] = Field(
|
|
5260
|
-
default=None,
|
|
5300
|
+
default=None,
|
|
5301
|
+
description="""Grounding chunk from Google Maps. This field is not supported in Gemini API.""",
|
|
5261
5302
|
)
|
|
5262
5303
|
retrieved_context: Optional[GroundingChunkRetrievedContext] = Field(
|
|
5263
5304
|
default=None,
|
|
5264
|
-
description="""Grounding chunk from context retrieved by the retrieval tools.""",
|
|
5305
|
+
description="""Grounding chunk from context retrieved by the retrieval tools. This field is not supported in Gemini API.""",
|
|
5265
5306
|
)
|
|
5266
5307
|
web: Optional[GroundingChunkWeb] = Field(
|
|
5267
5308
|
default=None, description="""Grounding chunk from the web."""
|
|
@@ -5272,10 +5313,10 @@ class GroundingChunkDict(TypedDict, total=False):
|
|
|
5272
5313
|
"""Grounding chunk."""
|
|
5273
5314
|
|
|
5274
5315
|
maps: Optional[GroundingChunkMapsDict]
|
|
5275
|
-
"""Grounding chunk from Google Maps."""
|
|
5316
|
+
"""Grounding chunk from Google Maps. This field is not supported in Gemini API."""
|
|
5276
5317
|
|
|
5277
5318
|
retrieved_context: Optional[GroundingChunkRetrievedContextDict]
|
|
5278
|
-
"""Grounding chunk from context retrieved by the retrieval tools."""
|
|
5319
|
+
"""Grounding chunk from context retrieved by the retrieval tools. This field is not supported in Gemini API."""
|
|
5279
5320
|
|
|
5280
5321
|
web: Optional[GroundingChunkWebDict]
|
|
5281
5322
|
"""Grounding chunk from the web."""
|
|
@@ -5405,7 +5446,8 @@ SearchEntryPointOrDict = Union[SearchEntryPoint, SearchEntryPointDict]
|
|
|
5405
5446
|
class GroundingMetadataSourceFlaggingUri(_common.BaseModel):
|
|
5406
5447
|
"""Source content flagging uri for a place or review.
|
|
5407
5448
|
|
|
5408
|
-
This is currently populated only for Google Maps grounding.
|
|
5449
|
+
This is currently populated only for Google Maps grounding. This data type is
|
|
5450
|
+
not supported in Gemini API.
|
|
5409
5451
|
"""
|
|
5410
5452
|
|
|
5411
5453
|
flag_content_uri: Optional[str] = Field(
|
|
@@ -5420,7 +5462,8 @@ class GroundingMetadataSourceFlaggingUri(_common.BaseModel):
|
|
|
5420
5462
|
class GroundingMetadataSourceFlaggingUriDict(TypedDict, total=False):
|
|
5421
5463
|
"""Source content flagging uri for a place or review.
|
|
5422
5464
|
|
|
5423
|
-
This is currently populated only for Google Maps grounding.
|
|
5465
|
+
This is currently populated only for Google Maps grounding. This data type is
|
|
5466
|
+
not supported in Gemini API.
|
|
5424
5467
|
"""
|
|
5425
5468
|
|
|
5426
5469
|
flag_content_uri: Optional[str]
|
|
@@ -5440,7 +5483,7 @@ class GroundingMetadata(_common.BaseModel):
|
|
|
5440
5483
|
|
|
5441
5484
|
google_maps_widget_context_token: Optional[str] = Field(
|
|
5442
5485
|
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.""",
|
|
5486
|
+
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
5487
|
)
|
|
5445
5488
|
grounding_chunks: Optional[list[GroundingChunk]] = Field(
|
|
5446
5489
|
default=None,
|
|
@@ -5454,7 +5497,7 @@ class GroundingMetadata(_common.BaseModel):
|
|
|
5454
5497
|
)
|
|
5455
5498
|
retrieval_queries: Optional[list[str]] = Field(
|
|
5456
5499
|
default=None,
|
|
5457
|
-
description="""Optional. Queries executed by the retrieval tools.""",
|
|
5500
|
+
description="""Optional. Queries executed by the retrieval tools. This field is not supported in Gemini API.""",
|
|
5458
5501
|
)
|
|
5459
5502
|
search_entry_point: Optional[SearchEntryPoint] = Field(
|
|
5460
5503
|
default=None,
|
|
@@ -5463,7 +5506,7 @@ class GroundingMetadata(_common.BaseModel):
|
|
|
5463
5506
|
source_flagging_uris: Optional[list[GroundingMetadataSourceFlaggingUri]] = (
|
|
5464
5507
|
Field(
|
|
5465
5508
|
default=None,
|
|
5466
|
-
description="""Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding.""",
|
|
5509
|
+
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
5510
|
)
|
|
5468
5511
|
)
|
|
5469
5512
|
web_search_queries: Optional[list[str]] = Field(
|
|
@@ -5476,7 +5519,7 @@ class GroundingMetadataDict(TypedDict, total=False):
|
|
|
5476
5519
|
"""Metadata returned to client when grounding is enabled."""
|
|
5477
5520
|
|
|
5478
5521
|
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."""
|
|
5522
|
+
"""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
5523
|
|
|
5481
5524
|
grounding_chunks: Optional[list[GroundingChunkDict]]
|
|
5482
5525
|
"""List of supporting references retrieved from specified grounding source."""
|
|
@@ -5488,13 +5531,13 @@ class GroundingMetadataDict(TypedDict, total=False):
|
|
|
5488
5531
|
"""Optional. Output only. Retrieval metadata."""
|
|
5489
5532
|
|
|
5490
5533
|
retrieval_queries: Optional[list[str]]
|
|
5491
|
-
"""Optional. Queries executed by the retrieval tools."""
|
|
5534
|
+
"""Optional. Queries executed by the retrieval tools. This field is not supported in Gemini API."""
|
|
5492
5535
|
|
|
5493
5536
|
search_entry_point: Optional[SearchEntryPointDict]
|
|
5494
5537
|
"""Optional. Google search entry for the following-up web searches."""
|
|
5495
5538
|
|
|
5496
5539
|
source_flagging_uris: Optional[list[GroundingMetadataSourceFlaggingUriDict]]
|
|
5497
|
-
"""Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding."""
|
|
5540
|
+
"""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
5541
|
|
|
5499
5542
|
web_search_queries: Optional[list[str]]
|
|
5500
5543
|
"""Optional. Web search queries for the following-up web search."""
|
|
@@ -5593,21 +5636,23 @@ class SafetyRating(_common.BaseModel):
|
|
|
5593
5636
|
)
|
|
5594
5637
|
overwritten_threshold: Optional[HarmBlockThreshold] = Field(
|
|
5595
5638
|
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.""",
|
|
5639
|
+
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
5640
|
)
|
|
5598
5641
|
probability: Optional[HarmProbability] = Field(
|
|
5599
5642
|
default=None,
|
|
5600
5643
|
description="""Output only. Harm probability levels in the content.""",
|
|
5601
5644
|
)
|
|
5602
5645
|
probability_score: Optional[float] = Field(
|
|
5603
|
-
default=None,
|
|
5646
|
+
default=None,
|
|
5647
|
+
description="""Output only. Harm probability score. This field is not supported in Gemini API.""",
|
|
5604
5648
|
)
|
|
5605
5649
|
severity: Optional[HarmSeverity] = Field(
|
|
5606
5650
|
default=None,
|
|
5607
|
-
description="""Output only. Harm severity levels in the content.""",
|
|
5651
|
+
description="""Output only. Harm severity levels in the content. This field is not supported in Gemini API.""",
|
|
5608
5652
|
)
|
|
5609
5653
|
severity_score: Optional[float] = Field(
|
|
5610
|
-
default=None,
|
|
5654
|
+
default=None,
|
|
5655
|
+
description="""Output only. Harm severity score. This field is not supported in Gemini API.""",
|
|
5611
5656
|
)
|
|
5612
5657
|
|
|
5613
5658
|
|
|
@@ -5621,24 +5666,66 @@ class SafetyRatingDict(TypedDict, total=False):
|
|
|
5621
5666
|
"""Output only. Harm category."""
|
|
5622
5667
|
|
|
5623
5668
|
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."""
|
|
5669
|
+
"""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
5670
|
|
|
5626
5671
|
probability: Optional[HarmProbability]
|
|
5627
5672
|
"""Output only. Harm probability levels in the content."""
|
|
5628
5673
|
|
|
5629
5674
|
probability_score: Optional[float]
|
|
5630
|
-
"""Output only. Harm probability score."""
|
|
5675
|
+
"""Output only. Harm probability score. This field is not supported in Gemini API."""
|
|
5631
5676
|
|
|
5632
5677
|
severity: Optional[HarmSeverity]
|
|
5633
|
-
"""Output only. Harm severity levels in the content."""
|
|
5678
|
+
"""Output only. Harm severity levels in the content. This field is not supported in Gemini API."""
|
|
5634
5679
|
|
|
5635
5680
|
severity_score: Optional[float]
|
|
5636
|
-
"""Output only. Harm severity score."""
|
|
5681
|
+
"""Output only. Harm severity score. This field is not supported in Gemini API."""
|
|
5637
5682
|
|
|
5638
5683
|
|
|
5639
5684
|
SafetyRatingOrDict = Union[SafetyRating, SafetyRatingDict]
|
|
5640
5685
|
|
|
5641
5686
|
|
|
5687
|
+
class UrlMetadata(_common.BaseModel):
|
|
5688
|
+
"""Context of the a single url retrieval."""
|
|
5689
|
+
|
|
5690
|
+
retrieved_url: Optional[str] = Field(
|
|
5691
|
+
default=None, description="""Retrieved url by the tool."""
|
|
5692
|
+
)
|
|
5693
|
+
url_retrieval_status: Optional[UrlRetrievalStatus] = Field(
|
|
5694
|
+
default=None, description="""Status of the url retrieval."""
|
|
5695
|
+
)
|
|
5696
|
+
|
|
5697
|
+
|
|
5698
|
+
class UrlMetadataDict(TypedDict, total=False):
|
|
5699
|
+
"""Context of the a single url retrieval."""
|
|
5700
|
+
|
|
5701
|
+
retrieved_url: Optional[str]
|
|
5702
|
+
"""Retrieved url by the tool."""
|
|
5703
|
+
|
|
5704
|
+
url_retrieval_status: Optional[UrlRetrievalStatus]
|
|
5705
|
+
"""Status of the url retrieval."""
|
|
5706
|
+
|
|
5707
|
+
|
|
5708
|
+
UrlMetadataOrDict = Union[UrlMetadata, UrlMetadataDict]
|
|
5709
|
+
|
|
5710
|
+
|
|
5711
|
+
class UrlContextMetadata(_common.BaseModel):
|
|
5712
|
+
"""Metadata related to url context retrieval tool."""
|
|
5713
|
+
|
|
5714
|
+
url_metadata: Optional[list[UrlMetadata]] = Field(
|
|
5715
|
+
default=None, description="""Output only. List of url context."""
|
|
5716
|
+
)
|
|
5717
|
+
|
|
5718
|
+
|
|
5719
|
+
class UrlContextMetadataDict(TypedDict, total=False):
|
|
5720
|
+
"""Metadata related to url context retrieval tool."""
|
|
5721
|
+
|
|
5722
|
+
url_metadata: Optional[list[UrlMetadataDict]]
|
|
5723
|
+
"""Output only. List of url context."""
|
|
5724
|
+
|
|
5725
|
+
|
|
5726
|
+
UrlContextMetadataOrDict = Union[UrlContextMetadata, UrlContextMetadataDict]
|
|
5727
|
+
|
|
5728
|
+
|
|
5642
5729
|
class Candidate(_common.BaseModel):
|
|
5643
5730
|
"""A response candidate generated from the model."""
|
|
5644
5731
|
|
|
@@ -5668,10 +5755,6 @@ class Candidate(_common.BaseModel):
|
|
|
5668
5755
|
If empty, the model has not stopped generating the tokens.
|
|
5669
5756
|
""",
|
|
5670
5757
|
)
|
|
5671
|
-
url_context_metadata: Optional[UrlContextMetadata] = Field(
|
|
5672
|
-
default=None,
|
|
5673
|
-
description="""Metadata related to url context retrieval tool.""",
|
|
5674
|
-
)
|
|
5675
5758
|
avg_logprobs: Optional[float] = Field(
|
|
5676
5759
|
default=None,
|
|
5677
5760
|
description="""Output only. Average log probability score of the candidate.""",
|
|
@@ -5691,6 +5774,10 @@ class Candidate(_common.BaseModel):
|
|
|
5691
5774
|
default=None,
|
|
5692
5775
|
description="""Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.""",
|
|
5693
5776
|
)
|
|
5777
|
+
url_context_metadata: Optional[UrlContextMetadata] = Field(
|
|
5778
|
+
default=None,
|
|
5779
|
+
description="""Output only. Metadata related to url context retrieval tool.""",
|
|
5780
|
+
)
|
|
5694
5781
|
|
|
5695
5782
|
|
|
5696
5783
|
class CandidateDict(TypedDict, total=False):
|
|
@@ -5717,9 +5804,6 @@ class CandidateDict(TypedDict, total=False):
|
|
|
5717
5804
|
If empty, the model has not stopped generating the tokens.
|
|
5718
5805
|
"""
|
|
5719
5806
|
|
|
5720
|
-
url_context_metadata: Optional[UrlContextMetadataDict]
|
|
5721
|
-
"""Metadata related to url context retrieval tool."""
|
|
5722
|
-
|
|
5723
5807
|
avg_logprobs: Optional[float]
|
|
5724
5808
|
"""Output only. Average log probability score of the candidate."""
|
|
5725
5809
|
|
|
@@ -5735,6 +5819,9 @@ class CandidateDict(TypedDict, total=False):
|
|
|
5735
5819
|
safety_ratings: Optional[list[SafetyRatingDict]]
|
|
5736
5820
|
"""Output only. List of ratings for the safety of a response candidate. There is at most one rating per category."""
|
|
5737
5821
|
|
|
5822
|
+
url_context_metadata: Optional[UrlContextMetadataDict]
|
|
5823
|
+
"""Output only. Metadata related to url context retrieval tool."""
|
|
5824
|
+
|
|
5738
5825
|
|
|
5739
5826
|
CandidateOrDict = Union[Candidate, CandidateDict]
|
|
5740
5827
|
|
|
@@ -5752,7 +5839,7 @@ class GenerateContentResponsePromptFeedback(_common.BaseModel):
|
|
|
5752
5839
|
)
|
|
5753
5840
|
block_reason_message: Optional[str] = Field(
|
|
5754
5841
|
default=None,
|
|
5755
|
-
description="""Output only. A readable message that explains the reason why the prompt was blocked.""",
|
|
5842
|
+
description="""Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API.""",
|
|
5756
5843
|
)
|
|
5757
5844
|
safety_ratings: Optional[list[SafetyRating]] = Field(
|
|
5758
5845
|
default=None,
|
|
@@ -5771,7 +5858,7 @@ class GenerateContentResponsePromptFeedbackDict(TypedDict, total=False):
|
|
|
5771
5858
|
"""Output only. The reason why the prompt was blocked."""
|
|
5772
5859
|
|
|
5773
5860
|
block_reason_message: Optional[str]
|
|
5774
|
-
"""Output only. A readable message that explains the reason why the prompt was blocked."""
|
|
5861
|
+
"""Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API."""
|
|
5775
5862
|
|
|
5776
5863
|
safety_ratings: Optional[list[SafetyRatingDict]]
|
|
5777
5864
|
"""Output only. A list of safety ratings for the prompt. There is one rating per category."""
|
|
@@ -5809,7 +5896,10 @@ ModalityTokenCountOrDict = Union[ModalityTokenCount, ModalityTokenCountDict]
|
|
|
5809
5896
|
|
|
5810
5897
|
|
|
5811
5898
|
class GenerateContentResponseUsageMetadata(_common.BaseModel):
|
|
5812
|
-
"""Usage metadata about response(s).
|
|
5899
|
+
"""Usage metadata about response(s).
|
|
5900
|
+
|
|
5901
|
+
This data type is not supported in Gemini API.
|
|
5902
|
+
"""
|
|
5813
5903
|
|
|
5814
5904
|
cache_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5815
5905
|
default=None,
|
|
@@ -5857,7 +5947,10 @@ class GenerateContentResponseUsageMetadata(_common.BaseModel):
|
|
|
5857
5947
|
|
|
5858
5948
|
|
|
5859
5949
|
class GenerateContentResponseUsageMetadataDict(TypedDict, total=False):
|
|
5860
|
-
"""Usage metadata about response(s).
|
|
5950
|
+
"""Usage metadata about response(s).
|
|
5951
|
+
|
|
5952
|
+
This data type is not supported in Gemini API.
|
|
5953
|
+
"""
|
|
5861
5954
|
|
|
5862
5955
|
cache_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5863
5956
|
"""Output only. List of modalities of the cached content in the request input."""
|
|
@@ -5936,10 +6029,18 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
5936
6029
|
description="""First candidate from the parsed response if response_schema is provided. Not available for streaming.""",
|
|
5937
6030
|
)
|
|
5938
6031
|
|
|
5939
|
-
def _get_text(self, warn_property: str =
|
|
6032
|
+
def _get_text(self, warn_property: Optional[str] = None) -> Optional[str]:
|
|
5940
6033
|
"""Returns the concatenation of all text parts in the response.
|
|
5941
6034
|
|
|
5942
|
-
This is an internal method that allows customizing the warning
|
|
6035
|
+
This is an internal method that allows customizing or disabling the warning
|
|
6036
|
+
message.
|
|
6037
|
+
|
|
6038
|
+
Args:
|
|
6039
|
+
warn_property: The property name that is being accessed. This is used to
|
|
6040
|
+
customize the warning message. If None, no warning will be logged.
|
|
6041
|
+
|
|
6042
|
+
Returns:
|
|
6043
|
+
The concatenation of all text parts in the response.
|
|
5943
6044
|
"""
|
|
5944
6045
|
if (
|
|
5945
6046
|
not self.candidates
|
|
@@ -5947,7 +6048,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
5947
6048
|
or not self.candidates[0].content.parts
|
|
5948
6049
|
):
|
|
5949
6050
|
return None
|
|
5950
|
-
if len(self.candidates) > 1:
|
|
6051
|
+
if len(self.candidates) > 1 and warn_property:
|
|
5951
6052
|
logger.warning(
|
|
5952
6053
|
f'there are {len(self.candidates)} candidates, returning'
|
|
5953
6054
|
f' {warn_property} result from the first candidate. Access'
|
|
@@ -5968,7 +6069,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
5968
6069
|
continue
|
|
5969
6070
|
any_text_part_text = True
|
|
5970
6071
|
text += part.text
|
|
5971
|
-
if non_text_parts:
|
|
6072
|
+
if non_text_parts and warn_property:
|
|
5972
6073
|
logger.warning(
|
|
5973
6074
|
'Warning: there are non-text parts in the response:'
|
|
5974
6075
|
f' {non_text_parts}, returning concatenated {warn_property} result'
|
|
@@ -5997,7 +6098,10 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
5997
6098
|
|
|
5998
6099
|
@property
|
|
5999
6100
|
def text(self) -> Optional[str]:
|
|
6000
|
-
"""Returns the concatenation of all text parts in the response.
|
|
6101
|
+
"""Returns the concatenation of all text parts in the response.
|
|
6102
|
+
|
|
6103
|
+
If there are multiple candidates, returns the text from only the first one.
|
|
6104
|
+
"""
|
|
6001
6105
|
return self._get_text(warn_property='text')
|
|
6002
6106
|
|
|
6003
6107
|
@property
|
|
@@ -6088,7 +6192,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6088
6192
|
):
|
|
6089
6193
|
# Pydantic schema.
|
|
6090
6194
|
try:
|
|
6091
|
-
result_text = result._get_text(
|
|
6195
|
+
result_text = result._get_text()
|
|
6092
6196
|
if result_text is not None:
|
|
6093
6197
|
result.parsed = response_schema.model_validate_json(result_text)
|
|
6094
6198
|
# may not be a valid json per stream response
|
|
@@ -6097,11 +6201,10 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6097
6201
|
except json.decoder.JSONDecodeError:
|
|
6098
6202
|
pass
|
|
6099
6203
|
elif (
|
|
6100
|
-
isinstance(response_schema, EnumMeta)
|
|
6101
|
-
and result._get_text(warn_property='parsed') is not None
|
|
6204
|
+
isinstance(response_schema, EnumMeta) and result._get_text() is not None
|
|
6102
6205
|
):
|
|
6103
6206
|
# Enum with "application/json" returns response in double quotes.
|
|
6104
|
-
result_text = result._get_text(
|
|
6207
|
+
result_text = result._get_text()
|
|
6105
6208
|
if result_text is None:
|
|
6106
6209
|
raise ValueError('Response is empty.')
|
|
6107
6210
|
enum_value = result_text.replace('"', '')
|
|
@@ -6122,7 +6225,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6122
6225
|
placeholder: response_schema # type: ignore[valid-type]
|
|
6123
6226
|
|
|
6124
6227
|
try:
|
|
6125
|
-
result_text = result._get_text(
|
|
6228
|
+
result_text = result._get_text()
|
|
6126
6229
|
if result_text is not None:
|
|
6127
6230
|
parsed = {'placeholder': json.loads(result_text)}
|
|
6128
6231
|
placeholder = Placeholder.model_validate(parsed)
|
|
@@ -6139,7 +6242,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6139
6242
|
# want the result converted to. So just return json.
|
|
6140
6243
|
# JSON schema.
|
|
6141
6244
|
try:
|
|
6142
|
-
result_text = result._get_text(
|
|
6245
|
+
result_text = result._get_text()
|
|
6143
6246
|
if result_text is not None:
|
|
6144
6247
|
result.parsed = json.loads(result_text)
|
|
6145
6248
|
# may not be a valid json per stream response
|
|
@@ -6151,7 +6254,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6151
6254
|
for union_type in union_types:
|
|
6152
6255
|
if issubclass(union_type, pydantic.BaseModel):
|
|
6153
6256
|
try:
|
|
6154
|
-
result_text = result._get_text(
|
|
6257
|
+
result_text = result._get_text()
|
|
6155
6258
|
if result_text is not None:
|
|
6156
6259
|
|
|
6157
6260
|
class Placeholder(pydantic.BaseModel): # type: ignore[no-redef]
|
|
@@ -6166,7 +6269,7 @@ class GenerateContentResponse(_common.BaseModel):
|
|
|
6166
6269
|
pass
|
|
6167
6270
|
else:
|
|
6168
6271
|
try:
|
|
6169
|
-
result_text = result._get_text(
|
|
6272
|
+
result_text = result._get_text()
|
|
6170
6273
|
if result_text is not None:
|
|
6171
6274
|
result.parsed = json.loads(result_text)
|
|
6172
6275
|
# may not be a valid json per stream response
|
|
@@ -7329,6 +7432,12 @@ class _UpscaleImageAPIConfig(_common.BaseModel):
|
|
|
7329
7432
|
default=None,
|
|
7330
7433
|
description="""Cloud Storage URI used to store the generated images.""",
|
|
7331
7434
|
)
|
|
7435
|
+
safety_filter_level: Optional[SafetyFilterLevel] = Field(
|
|
7436
|
+
default=None, description="""Filter level for safety filtering."""
|
|
7437
|
+
)
|
|
7438
|
+
person_generation: Optional[PersonGeneration] = Field(
|
|
7439
|
+
default=None, description="""Allows generation of people by the model."""
|
|
7440
|
+
)
|
|
7332
7441
|
include_rai_reason: Optional[bool] = Field(
|
|
7333
7442
|
default=None,
|
|
7334
7443
|
description="""Whether to include a reason for filtered-out images in the
|
|
@@ -7377,6 +7486,12 @@ class _UpscaleImageAPIConfigDict(TypedDict, total=False):
|
|
|
7377
7486
|
output_gcs_uri: Optional[str]
|
|
7378
7487
|
"""Cloud Storage URI used to store the generated images."""
|
|
7379
7488
|
|
|
7489
|
+
safety_filter_level: Optional[SafetyFilterLevel]
|
|
7490
|
+
"""Filter level for safety filtering."""
|
|
7491
|
+
|
|
7492
|
+
person_generation: Optional[PersonGeneration]
|
|
7493
|
+
"""Allows generation of people by the model."""
|
|
7494
|
+
|
|
7380
7495
|
include_rai_reason: Optional[bool]
|
|
7381
7496
|
"""Whether to include a reason for filtered-out images in the
|
|
7382
7497
|
response."""
|
|
@@ -8290,62 +8405,157 @@ _UpdateModelParametersOrDict = Union[
|
|
|
8290
8405
|
]
|
|
8291
8406
|
|
|
8292
8407
|
|
|
8293
|
-
class DeleteModelConfig(_common.BaseModel):
|
|
8294
|
-
"""Configuration for deleting a tuned model."""
|
|
8408
|
+
class DeleteModelConfig(_common.BaseModel):
|
|
8409
|
+
"""Configuration for deleting a tuned model."""
|
|
8410
|
+
|
|
8411
|
+
http_options: Optional[HttpOptions] = Field(
|
|
8412
|
+
default=None, description="""Used to override HTTP request options."""
|
|
8413
|
+
)
|
|
8414
|
+
|
|
8415
|
+
|
|
8416
|
+
class DeleteModelConfigDict(TypedDict, total=False):
|
|
8417
|
+
"""Configuration for deleting a tuned model."""
|
|
8418
|
+
|
|
8419
|
+
http_options: Optional[HttpOptionsDict]
|
|
8420
|
+
"""Used to override HTTP request options."""
|
|
8421
|
+
|
|
8422
|
+
|
|
8423
|
+
DeleteModelConfigOrDict = Union[DeleteModelConfig, DeleteModelConfigDict]
|
|
8424
|
+
|
|
8425
|
+
|
|
8426
|
+
class _DeleteModelParameters(_common.BaseModel):
|
|
8427
|
+
"""Parameters for deleting a tuned model."""
|
|
8428
|
+
|
|
8429
|
+
model: Optional[str] = Field(default=None, description="""""")
|
|
8430
|
+
config: Optional[DeleteModelConfig] = Field(
|
|
8431
|
+
default=None, description="""Optional parameters for the request."""
|
|
8432
|
+
)
|
|
8433
|
+
|
|
8434
|
+
|
|
8435
|
+
class _DeleteModelParametersDict(TypedDict, total=False):
|
|
8436
|
+
"""Parameters for deleting a tuned model."""
|
|
8437
|
+
|
|
8438
|
+
model: Optional[str]
|
|
8439
|
+
""""""
|
|
8440
|
+
|
|
8441
|
+
config: Optional[DeleteModelConfigDict]
|
|
8442
|
+
"""Optional parameters for the request."""
|
|
8443
|
+
|
|
8444
|
+
|
|
8445
|
+
_DeleteModelParametersOrDict = Union[
|
|
8446
|
+
_DeleteModelParameters, _DeleteModelParametersDict
|
|
8447
|
+
]
|
|
8448
|
+
|
|
8449
|
+
|
|
8450
|
+
class DeleteModelResponse(_common.BaseModel):
|
|
8451
|
+
|
|
8452
|
+
sdk_http_response: Optional[HttpResponse] = Field(
|
|
8453
|
+
default=None, description="""Used to retain the full HTTP response."""
|
|
8454
|
+
)
|
|
8455
|
+
|
|
8456
|
+
|
|
8457
|
+
class DeleteModelResponseDict(TypedDict, total=False):
|
|
8458
|
+
|
|
8459
|
+
sdk_http_response: Optional[HttpResponseDict]
|
|
8460
|
+
"""Used to retain the full HTTP response."""
|
|
8461
|
+
|
|
8462
|
+
|
|
8463
|
+
DeleteModelResponseOrDict = Union[DeleteModelResponse, DeleteModelResponseDict]
|
|
8464
|
+
|
|
8465
|
+
|
|
8466
|
+
class PrebuiltVoiceConfig(_common.BaseModel):
|
|
8467
|
+
"""The configuration for the prebuilt speaker to use."""
|
|
8468
|
+
|
|
8469
|
+
voice_name: Optional[str] = Field(
|
|
8470
|
+
default=None, description="""The name of the preset voice to use."""
|
|
8471
|
+
)
|
|
8472
|
+
|
|
8473
|
+
|
|
8474
|
+
class PrebuiltVoiceConfigDict(TypedDict, total=False):
|
|
8475
|
+
"""The configuration for the prebuilt speaker to use."""
|
|
8476
|
+
|
|
8477
|
+
voice_name: Optional[str]
|
|
8478
|
+
"""The name of the preset voice to use."""
|
|
8479
|
+
|
|
8480
|
+
|
|
8481
|
+
PrebuiltVoiceConfigOrDict = Union[PrebuiltVoiceConfig, PrebuiltVoiceConfigDict]
|
|
8482
|
+
|
|
8483
|
+
|
|
8484
|
+
class VoiceConfig(_common.BaseModel):
|
|
8485
|
+
"""The configuration for the voice to use."""
|
|
8295
8486
|
|
|
8296
|
-
|
|
8297
|
-
default=None,
|
|
8487
|
+
prebuilt_voice_config: Optional[PrebuiltVoiceConfig] = Field(
|
|
8488
|
+
default=None,
|
|
8489
|
+
description="""The configuration for the prebuilt voice to use.""",
|
|
8298
8490
|
)
|
|
8299
8491
|
|
|
8300
8492
|
|
|
8301
|
-
class
|
|
8302
|
-
"""
|
|
8493
|
+
class VoiceConfigDict(TypedDict, total=False):
|
|
8494
|
+
"""The configuration for the voice to use."""
|
|
8303
8495
|
|
|
8304
|
-
|
|
8305
|
-
"""
|
|
8496
|
+
prebuilt_voice_config: Optional[PrebuiltVoiceConfigDict]
|
|
8497
|
+
"""The configuration for the prebuilt voice to use."""
|
|
8306
8498
|
|
|
8307
8499
|
|
|
8308
|
-
|
|
8500
|
+
VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
|
|
8309
8501
|
|
|
8310
8502
|
|
|
8311
|
-
class
|
|
8312
|
-
"""
|
|
8503
|
+
class SpeakerVoiceConfig(_common.BaseModel):
|
|
8504
|
+
"""The configuration for a single speaker in a multi speaker setup.
|
|
8313
8505
|
|
|
8314
|
-
|
|
8315
|
-
|
|
8316
|
-
|
|
8506
|
+
This data type is not supported in Vertex AI.
|
|
8507
|
+
"""
|
|
8508
|
+
|
|
8509
|
+
speaker: Optional[str] = Field(
|
|
8510
|
+
default=None,
|
|
8511
|
+
description="""Required. The name of the speaker to use. Should be the same as in the prompt.""",
|
|
8512
|
+
)
|
|
8513
|
+
voice_config: Optional[VoiceConfig] = Field(
|
|
8514
|
+
default=None,
|
|
8515
|
+
description="""Required. The configuration for the voice to use.""",
|
|
8317
8516
|
)
|
|
8318
8517
|
|
|
8319
8518
|
|
|
8320
|
-
class
|
|
8321
|
-
"""
|
|
8519
|
+
class SpeakerVoiceConfigDict(TypedDict, total=False):
|
|
8520
|
+
"""The configuration for a single speaker in a multi speaker setup.
|
|
8322
8521
|
|
|
8323
|
-
|
|
8324
|
-
"""
|
|
8522
|
+
This data type is not supported in Vertex AI.
|
|
8523
|
+
"""
|
|
8325
8524
|
|
|
8326
|
-
|
|
8327
|
-
"""
|
|
8525
|
+
speaker: Optional[str]
|
|
8526
|
+
"""Required. The name of the speaker to use. Should be the same as in the prompt."""
|
|
8328
8527
|
|
|
8528
|
+
voice_config: Optional[VoiceConfigDict]
|
|
8529
|
+
"""Required. The configuration for the voice to use."""
|
|
8329
8530
|
|
|
8330
|
-
_DeleteModelParametersOrDict = Union[
|
|
8331
|
-
_DeleteModelParameters, _DeleteModelParametersDict
|
|
8332
|
-
]
|
|
8333
8531
|
|
|
8532
|
+
SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
|
|
8334
8533
|
|
|
8335
|
-
class DeleteModelResponse(_common.BaseModel):
|
|
8336
8534
|
|
|
8337
|
-
|
|
8338
|
-
|
|
8535
|
+
class MultiSpeakerVoiceConfig(_common.BaseModel):
|
|
8536
|
+
"""The configuration for the multi-speaker setup.
|
|
8537
|
+
|
|
8538
|
+
This data type is not supported in Vertex AI.
|
|
8539
|
+
"""
|
|
8540
|
+
|
|
8541
|
+
speaker_voice_configs: Optional[list[SpeakerVoiceConfig]] = Field(
|
|
8542
|
+
default=None, description="""Required. All the enabled speaker voices."""
|
|
8339
8543
|
)
|
|
8340
8544
|
|
|
8341
8545
|
|
|
8342
|
-
class
|
|
8546
|
+
class MultiSpeakerVoiceConfigDict(TypedDict, total=False):
|
|
8547
|
+
"""The configuration for the multi-speaker setup.
|
|
8343
8548
|
|
|
8344
|
-
|
|
8345
|
-
"""
|
|
8549
|
+
This data type is not supported in Vertex AI.
|
|
8550
|
+
"""
|
|
8346
8551
|
|
|
8552
|
+
speaker_voice_configs: Optional[list[SpeakerVoiceConfigDict]]
|
|
8553
|
+
"""Required. All the enabled speaker voices."""
|
|
8347
8554
|
|
|
8348
|
-
|
|
8555
|
+
|
|
8556
|
+
MultiSpeakerVoiceConfigOrDict = Union[
|
|
8557
|
+
MultiSpeakerVoiceConfig, MultiSpeakerVoiceConfigDict
|
|
8558
|
+
]
|
|
8349
8559
|
|
|
8350
8560
|
|
|
8351
8561
|
class GenerationConfig(_common.BaseModel):
|
|
@@ -8356,7 +8566,7 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8356
8566
|
)
|
|
8357
8567
|
audio_timestamp: Optional[bool] = Field(
|
|
8358
8568
|
default=None,
|
|
8359
|
-
description="""Optional. If enabled, audio timestamp will be included in the request to the model.""",
|
|
8569
|
+
description="""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API.""",
|
|
8360
8570
|
)
|
|
8361
8571
|
candidate_count: Optional[int] = Field(
|
|
8362
8572
|
default=None,
|
|
@@ -8364,7 +8574,7 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8364
8574
|
)
|
|
8365
8575
|
enable_affective_dialog: Optional[bool] = Field(
|
|
8366
8576
|
default=None,
|
|
8367
|
-
description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly.""",
|
|
8577
|
+
description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly. This field is not supported in Gemini API.""",
|
|
8368
8578
|
)
|
|
8369
8579
|
frequency_penalty: Optional[float] = Field(
|
|
8370
8580
|
default=None, description="""Optional. Frequency penalties."""
|
|
@@ -8403,7 +8613,8 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8403
8613
|
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
8614
|
)
|
|
8405
8615
|
routing_config: Optional[GenerationConfigRoutingConfig] = Field(
|
|
8406
|
-
default=None,
|
|
8616
|
+
default=None,
|
|
8617
|
+
description="""Optional. Routing configuration. This field is not supported in Gemini API.""",
|
|
8407
8618
|
)
|
|
8408
8619
|
seed: Optional[int] = Field(default=None, description="""Optional. Seed.""")
|
|
8409
8620
|
speech_config: Optional[SpeechConfig] = Field(
|
|
@@ -8430,7 +8641,7 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8430
8641
|
)
|
|
8431
8642
|
enable_enhanced_civic_answers: Optional[bool] = Field(
|
|
8432
8643
|
default=None,
|
|
8433
|
-
description="""Optional. Enables enhanced civic answers. It may not be available for all models.""",
|
|
8644
|
+
description="""Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI.""",
|
|
8434
8645
|
)
|
|
8435
8646
|
|
|
8436
8647
|
|
|
@@ -8441,13 +8652,13 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8441
8652
|
"""Optional. Config for model selection."""
|
|
8442
8653
|
|
|
8443
8654
|
audio_timestamp: Optional[bool]
|
|
8444
|
-
"""Optional. If enabled, audio timestamp will be included in the request to the model."""
|
|
8655
|
+
"""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API."""
|
|
8445
8656
|
|
|
8446
8657
|
candidate_count: Optional[int]
|
|
8447
8658
|
"""Optional. Number of candidates to generate."""
|
|
8448
8659
|
|
|
8449
8660
|
enable_affective_dialog: Optional[bool]
|
|
8450
|
-
"""Optional. If enabled, the model will detect emotions and adapt its responses accordingly."""
|
|
8661
|
+
"""Optional. If enabled, the model will detect emotions and adapt its responses accordingly. This field is not supported in Gemini API."""
|
|
8451
8662
|
|
|
8452
8663
|
frequency_penalty: Optional[float]
|
|
8453
8664
|
"""Optional. Frequency penalties."""
|
|
@@ -8480,7 +8691,7 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8480
8691
|
"""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
8692
|
|
|
8482
8693
|
routing_config: Optional[GenerationConfigRoutingConfigDict]
|
|
8483
|
-
"""Optional. Routing configuration."""
|
|
8694
|
+
"""Optional. Routing configuration. This field is not supported in Gemini API."""
|
|
8484
8695
|
|
|
8485
8696
|
seed: Optional[int]
|
|
8486
8697
|
"""Optional. Seed."""
|
|
@@ -8504,7 +8715,7 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8504
8715
|
"""Optional. If specified, nucleus sampling will be used."""
|
|
8505
8716
|
|
|
8506
8717
|
enable_enhanced_civic_answers: Optional[bool]
|
|
8507
|
-
"""Optional. Enables enhanced civic answers. It may not be available for all models."""
|
|
8718
|
+
"""Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI."""
|
|
8508
8719
|
|
|
8509
8720
|
|
|
8510
8721
|
GenerationConfigOrDict = Union[GenerationConfig, GenerationConfigDict]
|
|
@@ -9320,92 +9531,271 @@ class TunedModelCheckpoint(_common.BaseModel):
|
|
|
9320
9531
|
)
|
|
9321
9532
|
step: Optional[int] = Field(
|
|
9322
9533
|
default=None,
|
|
9323
|
-
description="""The step of the checkpoint.
|
|
9324
|
-
""",
|
|
9534
|
+
description="""The step of the checkpoint.
|
|
9535
|
+
""",
|
|
9536
|
+
)
|
|
9537
|
+
endpoint: Optional[str] = Field(
|
|
9538
|
+
default=None,
|
|
9539
|
+
description="""The Endpoint resource name that the checkpoint is deployed to.
|
|
9540
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9541
|
+
""",
|
|
9542
|
+
)
|
|
9543
|
+
|
|
9544
|
+
|
|
9545
|
+
class TunedModelCheckpointDict(TypedDict, total=False):
|
|
9546
|
+
"""TunedModelCheckpoint for the Tuned Model of a Tuning Job."""
|
|
9547
|
+
|
|
9548
|
+
checkpoint_id: Optional[str]
|
|
9549
|
+
"""The ID of the checkpoint.
|
|
9550
|
+
"""
|
|
9551
|
+
|
|
9552
|
+
epoch: Optional[int]
|
|
9553
|
+
"""The epoch of the checkpoint.
|
|
9554
|
+
"""
|
|
9555
|
+
|
|
9556
|
+
step: Optional[int]
|
|
9557
|
+
"""The step of the checkpoint.
|
|
9558
|
+
"""
|
|
9559
|
+
|
|
9560
|
+
endpoint: Optional[str]
|
|
9561
|
+
"""The Endpoint resource name that the checkpoint is deployed to.
|
|
9562
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9563
|
+
"""
|
|
9564
|
+
|
|
9565
|
+
|
|
9566
|
+
TunedModelCheckpointOrDict = Union[
|
|
9567
|
+
TunedModelCheckpoint, TunedModelCheckpointDict
|
|
9568
|
+
]
|
|
9569
|
+
|
|
9570
|
+
|
|
9571
|
+
class TunedModel(_common.BaseModel):
|
|
9572
|
+
"""TunedModel for the Tuned Model of a Tuning Job."""
|
|
9573
|
+
|
|
9574
|
+
model: Optional[str] = Field(
|
|
9575
|
+
default=None,
|
|
9576
|
+
description="""Output only. The resource name of the TunedModel.
|
|
9577
|
+
Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
|
|
9578
|
+
When tuning from a base model, the version_id will be 1.
|
|
9579
|
+
For continuous tuning, the version id will be incremented by 1 from the
|
|
9580
|
+
last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
|
|
9581
|
+
""",
|
|
9582
|
+
)
|
|
9583
|
+
endpoint: Optional[str] = Field(
|
|
9584
|
+
default=None,
|
|
9585
|
+
description="""Output only. A resource name of an Endpoint.
|
|
9586
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9587
|
+
""",
|
|
9588
|
+
)
|
|
9589
|
+
checkpoints: Optional[list[TunedModelCheckpoint]] = Field(
|
|
9590
|
+
default=None,
|
|
9591
|
+
description="""The checkpoints associated with this TunedModel.
|
|
9592
|
+
This field is only populated for tuning jobs that enable intermediate
|
|
9593
|
+
checkpoints.""",
|
|
9594
|
+
)
|
|
9595
|
+
|
|
9596
|
+
|
|
9597
|
+
class TunedModelDict(TypedDict, total=False):
|
|
9598
|
+
"""TunedModel for the Tuned Model of a Tuning Job."""
|
|
9599
|
+
|
|
9600
|
+
model: Optional[str]
|
|
9601
|
+
"""Output only. The resource name of the TunedModel.
|
|
9602
|
+
Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
|
|
9603
|
+
When tuning from a base model, the version_id will be 1.
|
|
9604
|
+
For continuous tuning, the version id will be incremented by 1 from the
|
|
9605
|
+
last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
|
|
9606
|
+
"""
|
|
9607
|
+
|
|
9608
|
+
endpoint: Optional[str]
|
|
9609
|
+
"""Output only. A resource name of an Endpoint.
|
|
9610
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9611
|
+
"""
|
|
9612
|
+
|
|
9613
|
+
checkpoints: Optional[list[TunedModelCheckpointDict]]
|
|
9614
|
+
"""The checkpoints associated with this TunedModel.
|
|
9615
|
+
This field is only populated for tuning jobs that enable intermediate
|
|
9616
|
+
checkpoints."""
|
|
9617
|
+
|
|
9618
|
+
|
|
9619
|
+
TunedModelOrDict = Union[TunedModel, TunedModelDict]
|
|
9620
|
+
|
|
9621
|
+
|
|
9622
|
+
class SupervisedHyperParameters(_common.BaseModel):
|
|
9623
|
+
"""Hyperparameters for SFT. This data type is not supported in Gemini API."""
|
|
9624
|
+
|
|
9625
|
+
adapter_size: Optional[AdapterSize] = Field(
|
|
9626
|
+
default=None, description="""Optional. Adapter size for tuning."""
|
|
9627
|
+
)
|
|
9628
|
+
batch_size: Optional[int] = Field(
|
|
9629
|
+
default=None,
|
|
9630
|
+
description="""Optional. Batch size for tuning. This feature is only available for open source models.""",
|
|
9631
|
+
)
|
|
9632
|
+
epoch_count: Optional[int] = Field(
|
|
9633
|
+
default=None,
|
|
9634
|
+
description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
|
|
9635
|
+
)
|
|
9636
|
+
learning_rate: Optional[float] = Field(
|
|
9637
|
+
default=None,
|
|
9638
|
+
description="""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models.""",
|
|
9639
|
+
)
|
|
9640
|
+
learning_rate_multiplier: Optional[float] = Field(
|
|
9641
|
+
default=None,
|
|
9642
|
+
description="""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models.""",
|
|
9643
|
+
)
|
|
9644
|
+
|
|
9645
|
+
|
|
9646
|
+
class SupervisedHyperParametersDict(TypedDict, total=False):
|
|
9647
|
+
"""Hyperparameters for SFT. This data type is not supported in Gemini API."""
|
|
9648
|
+
|
|
9649
|
+
adapter_size: Optional[AdapterSize]
|
|
9650
|
+
"""Optional. Adapter size for tuning."""
|
|
9651
|
+
|
|
9652
|
+
batch_size: Optional[int]
|
|
9653
|
+
"""Optional. Batch size for tuning. This feature is only available for open source models."""
|
|
9654
|
+
|
|
9655
|
+
epoch_count: Optional[int]
|
|
9656
|
+
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
|
9657
|
+
|
|
9658
|
+
learning_rate: Optional[float]
|
|
9659
|
+
"""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models."""
|
|
9660
|
+
|
|
9661
|
+
learning_rate_multiplier: Optional[float]
|
|
9662
|
+
"""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models."""
|
|
9663
|
+
|
|
9664
|
+
|
|
9665
|
+
SupervisedHyperParametersOrDict = Union[
|
|
9666
|
+
SupervisedHyperParameters, SupervisedHyperParametersDict
|
|
9667
|
+
]
|
|
9668
|
+
|
|
9669
|
+
|
|
9670
|
+
class SupervisedTuningSpec(_common.BaseModel):
|
|
9671
|
+
"""Supervised tuning spec for tuning."""
|
|
9672
|
+
|
|
9673
|
+
export_last_checkpoint_only: Optional[bool] = Field(
|
|
9674
|
+
default=None,
|
|
9675
|
+
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.""",
|
|
9676
|
+
)
|
|
9677
|
+
hyper_parameters: Optional[SupervisedHyperParameters] = Field(
|
|
9678
|
+
default=None, description="""Optional. Hyperparameters for SFT."""
|
|
9679
|
+
)
|
|
9680
|
+
training_dataset_uri: Optional[str] = Field(
|
|
9681
|
+
default=None,
|
|
9682
|
+
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.""",
|
|
9683
|
+
)
|
|
9684
|
+
tuning_mode: Optional[TuningMode] = Field(
|
|
9685
|
+
default=None, description="""Tuning mode."""
|
|
9686
|
+
)
|
|
9687
|
+
validation_dataset_uri: Optional[str] = Field(
|
|
9688
|
+
default=None,
|
|
9689
|
+
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.""",
|
|
9690
|
+
)
|
|
9691
|
+
|
|
9692
|
+
|
|
9693
|
+
class SupervisedTuningSpecDict(TypedDict, total=False):
|
|
9694
|
+
"""Supervised tuning spec for tuning."""
|
|
9695
|
+
|
|
9696
|
+
export_last_checkpoint_only: Optional[bool]
|
|
9697
|
+
"""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."""
|
|
9698
|
+
|
|
9699
|
+
hyper_parameters: Optional[SupervisedHyperParametersDict]
|
|
9700
|
+
"""Optional. Hyperparameters for SFT."""
|
|
9701
|
+
|
|
9702
|
+
training_dataset_uri: Optional[str]
|
|
9703
|
+
"""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."""
|
|
9704
|
+
|
|
9705
|
+
tuning_mode: Optional[TuningMode]
|
|
9706
|
+
"""Tuning mode."""
|
|
9707
|
+
|
|
9708
|
+
validation_dataset_uri: Optional[str]
|
|
9709
|
+
"""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."""
|
|
9710
|
+
|
|
9711
|
+
|
|
9712
|
+
SupervisedTuningSpecOrDict = Union[
|
|
9713
|
+
SupervisedTuningSpec, SupervisedTuningSpecDict
|
|
9714
|
+
]
|
|
9715
|
+
|
|
9716
|
+
|
|
9717
|
+
class PreferenceOptimizationHyperParameters(_common.BaseModel):
|
|
9718
|
+
"""Hyperparameters for Preference Optimization.
|
|
9719
|
+
|
|
9720
|
+
This data type is not supported in Gemini API.
|
|
9721
|
+
"""
|
|
9722
|
+
|
|
9723
|
+
adapter_size: Optional[AdapterSize] = Field(
|
|
9724
|
+
default=None,
|
|
9725
|
+
description="""Optional. Adapter size for preference optimization.""",
|
|
9726
|
+
)
|
|
9727
|
+
beta: Optional[float] = Field(
|
|
9728
|
+
default=None,
|
|
9729
|
+
description="""Optional. Weight for KL Divergence regularization.""",
|
|
9730
|
+
)
|
|
9731
|
+
epoch_count: Optional[int] = Field(
|
|
9732
|
+
default=None,
|
|
9733
|
+
description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
|
|
9325
9734
|
)
|
|
9326
|
-
|
|
9735
|
+
learning_rate_multiplier: Optional[float] = Field(
|
|
9327
9736
|
default=None,
|
|
9328
|
-
description="""
|
|
9329
|
-
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9330
|
-
""",
|
|
9737
|
+
description="""Optional. Multiplier for adjusting the default learning rate.""",
|
|
9331
9738
|
)
|
|
9332
9739
|
|
|
9333
9740
|
|
|
9334
|
-
class
|
|
9335
|
-
"""
|
|
9741
|
+
class PreferenceOptimizationHyperParametersDict(TypedDict, total=False):
|
|
9742
|
+
"""Hyperparameters for Preference Optimization.
|
|
9336
9743
|
|
|
9337
|
-
|
|
9338
|
-
"""
|
|
9339
|
-
"""
|
|
9744
|
+
This data type is not supported in Gemini API.
|
|
9745
|
+
"""
|
|
9340
9746
|
|
|
9341
|
-
|
|
9342
|
-
"""
|
|
9343
|
-
"""
|
|
9747
|
+
adapter_size: Optional[AdapterSize]
|
|
9748
|
+
"""Optional. Adapter size for preference optimization."""
|
|
9344
9749
|
|
|
9345
|
-
|
|
9346
|
-
"""
|
|
9347
|
-
"""
|
|
9750
|
+
beta: Optional[float]
|
|
9751
|
+
"""Optional. Weight for KL Divergence regularization."""
|
|
9348
9752
|
|
|
9349
|
-
|
|
9350
|
-
"""
|
|
9351
|
-
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9352
|
-
"""
|
|
9753
|
+
epoch_count: Optional[int]
|
|
9754
|
+
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
|
9353
9755
|
|
|
9756
|
+
learning_rate_multiplier: Optional[float]
|
|
9757
|
+
"""Optional. Multiplier for adjusting the default learning rate."""
|
|
9354
9758
|
|
|
9355
|
-
|
|
9356
|
-
|
|
9759
|
+
|
|
9760
|
+
PreferenceOptimizationHyperParametersOrDict = Union[
|
|
9761
|
+
PreferenceOptimizationHyperParameters,
|
|
9762
|
+
PreferenceOptimizationHyperParametersDict,
|
|
9357
9763
|
]
|
|
9358
9764
|
|
|
9359
9765
|
|
|
9360
|
-
class
|
|
9361
|
-
"""
|
|
9766
|
+
class PreferenceOptimizationSpec(_common.BaseModel):
|
|
9767
|
+
"""Preference optimization tuning spec for tuning."""
|
|
9362
9768
|
|
|
9363
|
-
|
|
9769
|
+
hyper_parameters: Optional[PreferenceOptimizationHyperParameters] = Field(
|
|
9364
9770
|
default=None,
|
|
9365
|
-
description="""
|
|
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
|
-
""",
|
|
9771
|
+
description="""Optional. Hyperparameters for Preference Optimization.""",
|
|
9371
9772
|
)
|
|
9372
|
-
|
|
9773
|
+
training_dataset_uri: Optional[str] = Field(
|
|
9373
9774
|
default=None,
|
|
9374
|
-
description="""
|
|
9375
|
-
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9376
|
-
""",
|
|
9775
|
+
description="""Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file.""",
|
|
9377
9776
|
)
|
|
9378
|
-
|
|
9777
|
+
validation_dataset_uri: Optional[str] = Field(
|
|
9379
9778
|
default=None,
|
|
9380
|
-
description="""The
|
|
9381
|
-
This field is only populated for tuning jobs that enable intermediate
|
|
9382
|
-
checkpoints.""",
|
|
9779
|
+
description="""Optional. Cloud Storage path to file containing validation dataset for preference optimization tuning. The dataset must be formatted as a JSONL file.""",
|
|
9383
9780
|
)
|
|
9384
9781
|
|
|
9385
9782
|
|
|
9386
|
-
class
|
|
9387
|
-
"""
|
|
9783
|
+
class PreferenceOptimizationSpecDict(TypedDict, total=False):
|
|
9784
|
+
"""Preference optimization tuning spec for tuning."""
|
|
9388
9785
|
|
|
9389
|
-
|
|
9390
|
-
"""
|
|
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
|
-
"""
|
|
9786
|
+
hyper_parameters: Optional[PreferenceOptimizationHyperParametersDict]
|
|
9787
|
+
"""Optional. Hyperparameters for Preference Optimization."""
|
|
9396
9788
|
|
|
9397
|
-
|
|
9398
|
-
"""
|
|
9399
|
-
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9400
|
-
"""
|
|
9789
|
+
training_dataset_uri: Optional[str]
|
|
9790
|
+
"""Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file."""
|
|
9401
9791
|
|
|
9402
|
-
|
|
9403
|
-
"""The
|
|
9404
|
-
This field is only populated for tuning jobs that enable intermediate
|
|
9405
|
-
checkpoints."""
|
|
9792
|
+
validation_dataset_uri: Optional[str]
|
|
9793
|
+
"""Optional. Cloud Storage path to file containing validation dataset for preference optimization tuning. The dataset must be formatted as a JSONL file."""
|
|
9406
9794
|
|
|
9407
9795
|
|
|
9408
|
-
|
|
9796
|
+
PreferenceOptimizationSpecOrDict = Union[
|
|
9797
|
+
PreferenceOptimizationSpec, PreferenceOptimizationSpecDict
|
|
9798
|
+
]
|
|
9409
9799
|
|
|
9410
9800
|
|
|
9411
9801
|
class GcsDestination(_common.BaseModel):
|
|
@@ -9682,7 +10072,8 @@ class GoogleRpcStatus(_common.BaseModel):
|
|
|
9682
10072
|
It is used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
9683
10073
|
three pieces of data: error code, error message, and error details. You can
|
|
9684
10074
|
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).
|
|
10075
|
+
Design Guide](https://cloud.google.com/apis/design/errors). This data type is
|
|
10076
|
+
not supported in Gemini API.
|
|
9686
10077
|
"""
|
|
9687
10078
|
|
|
9688
10079
|
code: Optional[int] = Field(
|
|
@@ -9705,7 +10096,8 @@ class GoogleRpcStatusDict(TypedDict, total=False):
|
|
|
9705
10096
|
It is used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
9706
10097
|
three pieces of data: error code, error message, and error details. You can
|
|
9707
10098
|
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).
|
|
10099
|
+
Design Guide](https://cloud.google.com/apis/design/errors). This data type is
|
|
10100
|
+
not supported in Gemini API.
|
|
9709
10101
|
"""
|
|
9710
10102
|
|
|
9711
10103
|
code: Optional[int]
|
|
@@ -9722,7 +10114,10 @@ GoogleRpcStatusOrDict = Union[GoogleRpcStatus, GoogleRpcStatusDict]
|
|
|
9722
10114
|
|
|
9723
10115
|
|
|
9724
10116
|
class PreTunedModel(_common.BaseModel):
|
|
9725
|
-
"""A pre-tuned model for continuous tuning.
|
|
10117
|
+
"""A pre-tuned model for continuous tuning.
|
|
10118
|
+
|
|
10119
|
+
This data type is not supported in Gemini API.
|
|
10120
|
+
"""
|
|
9726
10121
|
|
|
9727
10122
|
base_model: Optional[str] = Field(
|
|
9728
10123
|
default=None,
|
|
@@ -9739,7 +10134,10 @@ class PreTunedModel(_common.BaseModel):
|
|
|
9739
10134
|
|
|
9740
10135
|
|
|
9741
10136
|
class PreTunedModelDict(TypedDict, total=False):
|
|
9742
|
-
"""A pre-tuned model for continuous tuning.
|
|
10137
|
+
"""A pre-tuned model for continuous tuning.
|
|
10138
|
+
|
|
10139
|
+
This data type is not supported in Gemini API.
|
|
10140
|
+
"""
|
|
9743
10141
|
|
|
9744
10142
|
base_model: Optional[str]
|
|
9745
10143
|
"""Output only. The name of the base model this PreTunedModel was tuned from."""
|
|
@@ -9754,103 +10152,11 @@ class PreTunedModelDict(TypedDict, total=False):
|
|
|
9754
10152
|
PreTunedModelOrDict = Union[PreTunedModel, PreTunedModelDict]
|
|
9755
10153
|
|
|
9756
10154
|
|
|
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
10155
|
class DatasetDistributionDistributionBucket(_common.BaseModel):
|
|
9853
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10156
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10157
|
+
|
|
10158
|
+
This data type is not supported in Gemini API.
|
|
10159
|
+
"""
|
|
9854
10160
|
|
|
9855
10161
|
count: Optional[int] = Field(
|
|
9856
10162
|
default=None,
|
|
@@ -9865,7 +10171,10 @@ class DatasetDistributionDistributionBucket(_common.BaseModel):
|
|
|
9865
10171
|
|
|
9866
10172
|
|
|
9867
10173
|
class DatasetDistributionDistributionBucketDict(TypedDict, total=False):
|
|
9868
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10174
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10175
|
+
|
|
10176
|
+
This data type is not supported in Gemini API.
|
|
10177
|
+
"""
|
|
9869
10178
|
|
|
9870
10179
|
count: Optional[int]
|
|
9871
10180
|
"""Output only. Number of values in the bucket."""
|
|
@@ -9884,7 +10193,10 @@ DatasetDistributionDistributionBucketOrDict = Union[
|
|
|
9884
10193
|
|
|
9885
10194
|
|
|
9886
10195
|
class DatasetDistribution(_common.BaseModel):
|
|
9887
|
-
"""Distribution computed over a tuning dataset.
|
|
10196
|
+
"""Distribution computed over a tuning dataset.
|
|
10197
|
+
|
|
10198
|
+
This data type is not supported in Gemini API.
|
|
10199
|
+
"""
|
|
9888
10200
|
|
|
9889
10201
|
buckets: Optional[list[DatasetDistributionDistributionBucket]] = Field(
|
|
9890
10202
|
default=None, description="""Output only. Defines the histogram bucket."""
|
|
@@ -9920,7 +10232,10 @@ class DatasetDistribution(_common.BaseModel):
|
|
|
9920
10232
|
|
|
9921
10233
|
|
|
9922
10234
|
class DatasetDistributionDict(TypedDict, total=False):
|
|
9923
|
-
"""Distribution computed over a tuning dataset.
|
|
10235
|
+
"""Distribution computed over a tuning dataset.
|
|
10236
|
+
|
|
10237
|
+
This data type is not supported in Gemini API.
|
|
10238
|
+
"""
|
|
9924
10239
|
|
|
9925
10240
|
buckets: Optional[list[DatasetDistributionDistributionBucketDict]]
|
|
9926
10241
|
"""Output only. Defines the histogram bucket."""
|
|
@@ -9951,7 +10266,10 @@ DatasetDistributionOrDict = Union[DatasetDistribution, DatasetDistributionDict]
|
|
|
9951
10266
|
|
|
9952
10267
|
|
|
9953
10268
|
class DatasetStats(_common.BaseModel):
|
|
9954
|
-
"""Statistics computed over a tuning dataset.
|
|
10269
|
+
"""Statistics computed over a tuning dataset.
|
|
10270
|
+
|
|
10271
|
+
This data type is not supported in Gemini API.
|
|
10272
|
+
"""
|
|
9955
10273
|
|
|
9956
10274
|
total_billable_character_count: Optional[int] = Field(
|
|
9957
10275
|
default=None,
|
|
@@ -9988,7 +10306,10 @@ class DatasetStats(_common.BaseModel):
|
|
|
9988
10306
|
|
|
9989
10307
|
|
|
9990
10308
|
class DatasetStatsDict(TypedDict, total=False):
|
|
9991
|
-
"""Statistics computed over a tuning dataset.
|
|
10309
|
+
"""Statistics computed over a tuning dataset.
|
|
10310
|
+
|
|
10311
|
+
This data type is not supported in Gemini API.
|
|
10312
|
+
"""
|
|
9992
10313
|
|
|
9993
10314
|
total_billable_character_count: Optional[int]
|
|
9994
10315
|
"""Output only. Number of billable characters in the tuning dataset."""
|
|
@@ -10019,7 +10340,10 @@ DatasetStatsOrDict = Union[DatasetStats, DatasetStatsDict]
|
|
|
10019
10340
|
|
|
10020
10341
|
|
|
10021
10342
|
class DistillationDataStats(_common.BaseModel):
|
|
10022
|
-
"""Statistics computed for datasets used for distillation.
|
|
10343
|
+
"""Statistics computed for datasets used for distillation.
|
|
10344
|
+
|
|
10345
|
+
This data type is not supported in Gemini API.
|
|
10346
|
+
"""
|
|
10023
10347
|
|
|
10024
10348
|
training_dataset_stats: Optional[DatasetStats] = Field(
|
|
10025
10349
|
default=None,
|
|
@@ -10028,7 +10352,10 @@ class DistillationDataStats(_common.BaseModel):
|
|
|
10028
10352
|
|
|
10029
10353
|
|
|
10030
10354
|
class DistillationDataStatsDict(TypedDict, total=False):
|
|
10031
|
-
"""Statistics computed for datasets used for distillation.
|
|
10355
|
+
"""Statistics computed for datasets used for distillation.
|
|
10356
|
+
|
|
10357
|
+
This data type is not supported in Gemini API.
|
|
10358
|
+
"""
|
|
10032
10359
|
|
|
10033
10360
|
training_dataset_stats: Optional[DatasetStatsDict]
|
|
10034
10361
|
"""Output only. Statistics computed for the training dataset."""
|
|
@@ -10040,7 +10367,10 @@ DistillationDataStatsOrDict = Union[
|
|
|
10040
10367
|
|
|
10041
10368
|
|
|
10042
10369
|
class GeminiPreferenceExampleCompletion(_common.BaseModel):
|
|
10043
|
-
"""Completion and its preference score.
|
|
10370
|
+
"""Completion and its preference score.
|
|
10371
|
+
|
|
10372
|
+
This data type is not supported in Gemini API.
|
|
10373
|
+
"""
|
|
10044
10374
|
|
|
10045
10375
|
completion: Optional[Content] = Field(
|
|
10046
10376
|
default=None,
|
|
@@ -10052,7 +10382,10 @@ class GeminiPreferenceExampleCompletion(_common.BaseModel):
|
|
|
10052
10382
|
|
|
10053
10383
|
|
|
10054
10384
|
class GeminiPreferenceExampleCompletionDict(TypedDict, total=False):
|
|
10055
|
-
"""Completion and its preference score.
|
|
10385
|
+
"""Completion and its preference score.
|
|
10386
|
+
|
|
10387
|
+
This data type is not supported in Gemini API.
|
|
10388
|
+
"""
|
|
10056
10389
|
|
|
10057
10390
|
completion: Optional[ContentDict]
|
|
10058
10391
|
"""Single turn completion for the given prompt."""
|
|
@@ -10067,7 +10400,10 @@ GeminiPreferenceExampleCompletionOrDict = Union[
|
|
|
10067
10400
|
|
|
10068
10401
|
|
|
10069
10402
|
class GeminiPreferenceExample(_common.BaseModel):
|
|
10070
|
-
"""Input example for preference optimization.
|
|
10403
|
+
"""Input example for preference optimization.
|
|
10404
|
+
|
|
10405
|
+
This data type is not supported in Gemini API.
|
|
10406
|
+
"""
|
|
10071
10407
|
|
|
10072
10408
|
completions: Optional[list[GeminiPreferenceExampleCompletion]] = Field(
|
|
10073
10409
|
default=None, description="""List of completions for a given prompt."""
|
|
@@ -10079,7 +10415,10 @@ class GeminiPreferenceExample(_common.BaseModel):
|
|
|
10079
10415
|
|
|
10080
10416
|
|
|
10081
10417
|
class GeminiPreferenceExampleDict(TypedDict, total=False):
|
|
10082
|
-
"""Input example for preference optimization.
|
|
10418
|
+
"""Input example for preference optimization.
|
|
10419
|
+
|
|
10420
|
+
This data type is not supported in Gemini API.
|
|
10421
|
+
"""
|
|
10083
10422
|
|
|
10084
10423
|
completions: Optional[list[GeminiPreferenceExampleCompletionDict]]
|
|
10085
10424
|
"""List of completions for a given prompt."""
|
|
@@ -10094,7 +10433,10 @@ GeminiPreferenceExampleOrDict = Union[
|
|
|
10094
10433
|
|
|
10095
10434
|
|
|
10096
10435
|
class PreferenceOptimizationDataStats(_common.BaseModel):
|
|
10097
|
-
"""Statistics computed for datasets used for preference optimization.
|
|
10436
|
+
"""Statistics computed for datasets used for preference optimization.
|
|
10437
|
+
|
|
10438
|
+
This data type is not supported in Gemini API.
|
|
10439
|
+
"""
|
|
10098
10440
|
|
|
10099
10441
|
score_variance_per_example_distribution: Optional[DatasetDistribution] = (
|
|
10100
10442
|
Field(
|
|
@@ -10133,7 +10475,10 @@ class PreferenceOptimizationDataStats(_common.BaseModel):
|
|
|
10133
10475
|
|
|
10134
10476
|
|
|
10135
10477
|
class PreferenceOptimizationDataStatsDict(TypedDict, total=False):
|
|
10136
|
-
"""Statistics computed for datasets used for preference optimization.
|
|
10478
|
+
"""Statistics computed for datasets used for preference optimization.
|
|
10479
|
+
|
|
10480
|
+
This data type is not supported in Gemini API.
|
|
10481
|
+
"""
|
|
10137
10482
|
|
|
10138
10483
|
score_variance_per_example_distribution: Optional[DatasetDistributionDict]
|
|
10139
10484
|
"""Output only. Dataset distributions for scores variance per example."""
|
|
@@ -10166,7 +10511,10 @@ PreferenceOptimizationDataStatsOrDict = Union[
|
|
|
10166
10511
|
|
|
10167
10512
|
|
|
10168
10513
|
class SupervisedTuningDatasetDistributionDatasetBucket(_common.BaseModel):
|
|
10169
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10514
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10515
|
+
|
|
10516
|
+
This data type is not supported in Gemini API.
|
|
10517
|
+
"""
|
|
10170
10518
|
|
|
10171
10519
|
count: Optional[float] = Field(
|
|
10172
10520
|
default=None,
|
|
@@ -10183,7 +10531,10 @@ class SupervisedTuningDatasetDistributionDatasetBucket(_common.BaseModel):
|
|
|
10183
10531
|
class SupervisedTuningDatasetDistributionDatasetBucketDict(
|
|
10184
10532
|
TypedDict, total=False
|
|
10185
10533
|
):
|
|
10186
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10534
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10535
|
+
|
|
10536
|
+
This data type is not supported in Gemini API.
|
|
10537
|
+
"""
|
|
10187
10538
|
|
|
10188
10539
|
count: Optional[float]
|
|
10189
10540
|
"""Output only. Number of values in the bucket."""
|
|
@@ -10202,7 +10553,10 @@ SupervisedTuningDatasetDistributionDatasetBucketOrDict = Union[
|
|
|
10202
10553
|
|
|
10203
10554
|
|
|
10204
10555
|
class SupervisedTuningDatasetDistribution(_common.BaseModel):
|
|
10205
|
-
"""Dataset distribution for Supervised Tuning.
|
|
10556
|
+
"""Dataset distribution for Supervised Tuning.
|
|
10557
|
+
|
|
10558
|
+
This data type is not supported in Gemini API.
|
|
10559
|
+
"""
|
|
10206
10560
|
|
|
10207
10561
|
billable_sum: Optional[int] = Field(
|
|
10208
10562
|
default=None,
|
|
@@ -10245,7 +10599,10 @@ class SupervisedTuningDatasetDistribution(_common.BaseModel):
|
|
|
10245
10599
|
|
|
10246
10600
|
|
|
10247
10601
|
class SupervisedTuningDatasetDistributionDict(TypedDict, total=False):
|
|
10248
|
-
"""Dataset distribution for Supervised Tuning.
|
|
10602
|
+
"""Dataset distribution for Supervised Tuning.
|
|
10603
|
+
|
|
10604
|
+
This data type is not supported in Gemini API.
|
|
10605
|
+
"""
|
|
10249
10606
|
|
|
10250
10607
|
billable_sum: Optional[int]
|
|
10251
10608
|
"""Output only. Sum of a given population of values that are billable."""
|
|
@@ -10281,7 +10638,10 @@ SupervisedTuningDatasetDistributionOrDict = Union[
|
|
|
10281
10638
|
|
|
10282
10639
|
|
|
10283
10640
|
class SupervisedTuningDataStats(_common.BaseModel):
|
|
10284
|
-
"""Tuning data statistics for Supervised Tuning.
|
|
10641
|
+
"""Tuning data statistics for Supervised Tuning.
|
|
10642
|
+
|
|
10643
|
+
This data type is not supported in Gemini API.
|
|
10644
|
+
"""
|
|
10285
10645
|
|
|
10286
10646
|
dropped_example_reasons: Optional[list[str]] = Field(
|
|
10287
10647
|
default=None,
|
|
@@ -10340,7 +10700,10 @@ class SupervisedTuningDataStats(_common.BaseModel):
|
|
|
10340
10700
|
|
|
10341
10701
|
|
|
10342
10702
|
class SupervisedTuningDataStatsDict(TypedDict, total=False):
|
|
10343
|
-
"""Tuning data statistics for Supervised Tuning.
|
|
10703
|
+
"""Tuning data statistics for Supervised Tuning.
|
|
10704
|
+
|
|
10705
|
+
This data type is not supported in Gemini API.
|
|
10706
|
+
"""
|
|
10344
10707
|
|
|
10345
10708
|
dropped_example_reasons: Optional[list[str]]
|
|
10346
10709
|
"""Output only. For each index in `truncated_example_indices`, the user-facing reason why the example was dropped."""
|
|
@@ -10391,7 +10754,10 @@ SupervisedTuningDataStatsOrDict = Union[
|
|
|
10391
10754
|
|
|
10392
10755
|
|
|
10393
10756
|
class TuningDataStats(_common.BaseModel):
|
|
10394
|
-
"""The tuning data statistic values for TuningJob.
|
|
10757
|
+
"""The tuning data statistic values for TuningJob.
|
|
10758
|
+
|
|
10759
|
+
This data type is not supported in Gemini API.
|
|
10760
|
+
"""
|
|
10395
10761
|
|
|
10396
10762
|
distillation_data_stats: Optional[DistillationDataStats] = Field(
|
|
10397
10763
|
default=None, description="""Output only. Statistics for distillation."""
|
|
@@ -10408,7 +10774,10 @@ class TuningDataStats(_common.BaseModel):
|
|
|
10408
10774
|
|
|
10409
10775
|
|
|
10410
10776
|
class TuningDataStatsDict(TypedDict, total=False):
|
|
10411
|
-
"""The tuning data statistic values for TuningJob.
|
|
10777
|
+
"""The tuning data statistic values for TuningJob.
|
|
10778
|
+
|
|
10779
|
+
This data type is not supported in Gemini API.
|
|
10780
|
+
"""
|
|
10412
10781
|
|
|
10413
10782
|
distillation_data_stats: Optional[DistillationDataStatsDict]
|
|
10414
10783
|
"""Output only. Statistics for distillation."""
|
|
@@ -10426,7 +10795,10 @@ TuningDataStatsOrDict = Union[TuningDataStats, TuningDataStatsDict]
|
|
|
10426
10795
|
|
|
10427
10796
|
|
|
10428
10797
|
class EncryptionSpec(_common.BaseModel):
|
|
10429
|
-
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10798
|
+
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10799
|
+
|
|
10800
|
+
This data type is not supported in Gemini API.
|
|
10801
|
+
"""
|
|
10430
10802
|
|
|
10431
10803
|
kms_key_name: Optional[str] = Field(
|
|
10432
10804
|
default=None,
|
|
@@ -10435,7 +10807,10 @@ class EncryptionSpec(_common.BaseModel):
|
|
|
10435
10807
|
|
|
10436
10808
|
|
|
10437
10809
|
class EncryptionSpecDict(TypedDict, total=False):
|
|
10438
|
-
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10810
|
+
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10811
|
+
|
|
10812
|
+
This data type is not supported in Gemini API.
|
|
10813
|
+
"""
|
|
10439
10814
|
|
|
10440
10815
|
kms_key_name: Optional[str]
|
|
10441
10816
|
"""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 +10820,10 @@ EncryptionSpecOrDict = Union[EncryptionSpec, EncryptionSpecDict]
|
|
|
10445
10820
|
|
|
10446
10821
|
|
|
10447
10822
|
class PartnerModelTuningSpec(_common.BaseModel):
|
|
10448
|
-
"""Tuning spec for Partner models.
|
|
10823
|
+
"""Tuning spec for Partner models.
|
|
10824
|
+
|
|
10825
|
+
This data type is not supported in Gemini API.
|
|
10826
|
+
"""
|
|
10449
10827
|
|
|
10450
10828
|
hyper_parameters: Optional[dict[str, Any]] = Field(
|
|
10451
10829
|
default=None,
|
|
@@ -10462,7 +10840,10 @@ class PartnerModelTuningSpec(_common.BaseModel):
|
|
|
10462
10840
|
|
|
10463
10841
|
|
|
10464
10842
|
class PartnerModelTuningSpecDict(TypedDict, total=False):
|
|
10465
|
-
"""Tuning spec for Partner models.
|
|
10843
|
+
"""Tuning spec for Partner models.
|
|
10844
|
+
|
|
10845
|
+
This data type is not supported in Gemini API.
|
|
10846
|
+
"""
|
|
10466
10847
|
|
|
10467
10848
|
hyper_parameters: Optional[dict[str, Any]]
|
|
10468
10849
|
"""Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model."""
|
|
@@ -10480,7 +10861,7 @@ PartnerModelTuningSpecOrDict = Union[
|
|
|
10480
10861
|
|
|
10481
10862
|
|
|
10482
10863
|
class VeoHyperParameters(_common.BaseModel):
|
|
10483
|
-
"""Hyperparameters for Veo."""
|
|
10864
|
+
"""Hyperparameters for Veo. This data type is not supported in Gemini API."""
|
|
10484
10865
|
|
|
10485
10866
|
epoch_count: Optional[int] = Field(
|
|
10486
10867
|
default=None,
|
|
@@ -10497,7 +10878,7 @@ class VeoHyperParameters(_common.BaseModel):
|
|
|
10497
10878
|
|
|
10498
10879
|
|
|
10499
10880
|
class VeoHyperParametersDict(TypedDict, total=False):
|
|
10500
|
-
"""Hyperparameters for Veo."""
|
|
10881
|
+
"""Hyperparameters for Veo. This data type is not supported in Gemini API."""
|
|
10501
10882
|
|
|
10502
10883
|
epoch_count: Optional[int]
|
|
10503
10884
|
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
|
@@ -10513,7 +10894,10 @@ VeoHyperParametersOrDict = Union[VeoHyperParameters, VeoHyperParametersDict]
|
|
|
10513
10894
|
|
|
10514
10895
|
|
|
10515
10896
|
class VeoTuningSpec(_common.BaseModel):
|
|
10516
|
-
"""Tuning Spec for Veo Model Tuning.
|
|
10897
|
+
"""Tuning Spec for Veo Model Tuning.
|
|
10898
|
+
|
|
10899
|
+
This data type is not supported in Gemini API.
|
|
10900
|
+
"""
|
|
10517
10901
|
|
|
10518
10902
|
hyper_parameters: Optional[VeoHyperParameters] = Field(
|
|
10519
10903
|
default=None, description="""Optional. Hyperparameters for Veo."""
|
|
@@ -10529,7 +10913,10 @@ class VeoTuningSpec(_common.BaseModel):
|
|
|
10529
10913
|
|
|
10530
10914
|
|
|
10531
10915
|
class VeoTuningSpecDict(TypedDict, total=False):
|
|
10532
|
-
"""Tuning Spec for Veo Model Tuning.
|
|
10916
|
+
"""Tuning Spec for Veo Model Tuning.
|
|
10917
|
+
|
|
10918
|
+
This data type is not supported in Gemini API.
|
|
10919
|
+
"""
|
|
10533
10920
|
|
|
10534
10921
|
hyper_parameters: Optional[VeoHyperParametersDict]
|
|
10535
10922
|
"""Optional. Hyperparameters for Veo."""
|
|
@@ -10596,6 +10983,9 @@ class TuningJob(_common.BaseModel):
|
|
|
10596
10983
|
supervised_tuning_spec: Optional[SupervisedTuningSpec] = Field(
|
|
10597
10984
|
default=None, description="""Tuning Spec for Supervised Fine Tuning."""
|
|
10598
10985
|
)
|
|
10986
|
+
preference_optimization_spec: Optional[PreferenceOptimizationSpec] = Field(
|
|
10987
|
+
default=None, description="""Tuning Spec for Preference Optimization."""
|
|
10988
|
+
)
|
|
10599
10989
|
tuning_data_stats: Optional[TuningDataStats] = Field(
|
|
10600
10990
|
default=None,
|
|
10601
10991
|
description="""Output only. The tuning data statistics associated with this TuningJob.""",
|
|
@@ -10696,6 +11086,9 @@ class TuningJobDict(TypedDict, total=False):
|
|
|
10696
11086
|
supervised_tuning_spec: Optional[SupervisedTuningSpecDict]
|
|
10697
11087
|
"""Tuning Spec for Supervised Fine Tuning."""
|
|
10698
11088
|
|
|
11089
|
+
preference_optimization_spec: Optional[PreferenceOptimizationSpecDict]
|
|
11090
|
+
"""Tuning Spec for Preference Optimization."""
|
|
11091
|
+
|
|
10699
11092
|
tuning_data_stats: Optional[TuningDataStatsDict]
|
|
10700
11093
|
"""Output only. The tuning data statistics associated with this TuningJob."""
|
|
10701
11094
|
|
|
@@ -10868,7 +11261,10 @@ _CancelTuningJobParametersOrDict = Union[
|
|
|
10868
11261
|
|
|
10869
11262
|
|
|
10870
11263
|
class TuningExample(_common.BaseModel):
|
|
10871
|
-
"""A single example for tuning.
|
|
11264
|
+
"""A single example for tuning.
|
|
11265
|
+
|
|
11266
|
+
This data type is not supported in Vertex AI.
|
|
11267
|
+
"""
|
|
10872
11268
|
|
|
10873
11269
|
output: Optional[str] = Field(
|
|
10874
11270
|
default=None, description="""Required. The expected model output."""
|
|
@@ -10879,7 +11275,10 @@ class TuningExample(_common.BaseModel):
|
|
|
10879
11275
|
|
|
10880
11276
|
|
|
10881
11277
|
class TuningExampleDict(TypedDict, total=False):
|
|
10882
|
-
"""A single example for tuning.
|
|
11278
|
+
"""A single example for tuning.
|
|
11279
|
+
|
|
11280
|
+
This data type is not supported in Vertex AI.
|
|
11281
|
+
"""
|
|
10883
11282
|
|
|
10884
11283
|
output: Optional[str]
|
|
10885
11284
|
"""Required. The expected model output."""
|
|
@@ -10932,7 +11331,7 @@ class TuningValidationDataset(_common.BaseModel):
|
|
|
10932
11331
|
)
|
|
10933
11332
|
vertex_dataset_resource: Optional[str] = Field(
|
|
10934
11333
|
default=None,
|
|
10935
|
-
description="""The resource name of the Vertex Multimodal Dataset that is used as
|
|
11334
|
+
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
11335
|
)
|
|
10937
11336
|
|
|
10938
11337
|
|
|
@@ -10942,7 +11341,7 @@ class TuningValidationDatasetDict(TypedDict, total=False):
|
|
|
10942
11341
|
"""GCS URI of the file containing validation dataset in JSONL format."""
|
|
10943
11342
|
|
|
10944
11343
|
vertex_dataset_resource: Optional[str]
|
|
10945
|
-
"""The resource name of the Vertex Multimodal Dataset that is used as
|
|
11344
|
+
"""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
11345
|
|
|
10947
11346
|
|
|
10948
11347
|
TuningValidationDatasetOrDict = Union[
|
|
@@ -10951,14 +11350,18 @@ TuningValidationDatasetOrDict = Union[
|
|
|
10951
11350
|
|
|
10952
11351
|
|
|
10953
11352
|
class CreateTuningJobConfig(_common.BaseModel):
|
|
10954
|
-
"""
|
|
11353
|
+
"""Fine-tuning job creation request - optional fields."""
|
|
10955
11354
|
|
|
10956
11355
|
http_options: Optional[HttpOptions] = Field(
|
|
10957
11356
|
default=None, description="""Used to override HTTP request options."""
|
|
10958
11357
|
)
|
|
11358
|
+
method: Optional[TuningMethod] = Field(
|
|
11359
|
+
default=None,
|
|
11360
|
+
description="""The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING). If not set, the default method (SFT) will be used.""",
|
|
11361
|
+
)
|
|
10959
11362
|
validation_dataset: Optional[TuningValidationDataset] = Field(
|
|
10960
11363
|
default=None,
|
|
10961
|
-
description="""
|
|
11364
|
+
description="""Validation dataset for tuning. The dataset must be formatted as a JSONL file.""",
|
|
10962
11365
|
)
|
|
10963
11366
|
tuned_model_display_name: Optional[str] = Field(
|
|
10964
11367
|
default=None,
|
|
@@ -10977,7 +11380,7 @@ class CreateTuningJobConfig(_common.BaseModel):
|
|
|
10977
11380
|
)
|
|
10978
11381
|
export_last_checkpoint_only: Optional[bool] = Field(
|
|
10979
11382
|
default=None,
|
|
10980
|
-
description="""If set to true, disable intermediate checkpoints
|
|
11383
|
+
description="""If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints.""",
|
|
10981
11384
|
)
|
|
10982
11385
|
pre_tuned_model_checkpoint_id: Optional[str] = Field(
|
|
10983
11386
|
default=None,
|
|
@@ -11001,16 +11404,23 @@ class CreateTuningJobConfig(_common.BaseModel):
|
|
|
11001
11404
|
default=None,
|
|
11002
11405
|
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
11406
|
)
|
|
11407
|
+
beta: Optional[float] = Field(
|
|
11408
|
+
default=None,
|
|
11409
|
+
description="""Weight for KL Divergence regularization, Preference Optimization tuning only.""",
|
|
11410
|
+
)
|
|
11004
11411
|
|
|
11005
11412
|
|
|
11006
11413
|
class CreateTuningJobConfigDict(TypedDict, total=False):
|
|
11007
|
-
"""
|
|
11414
|
+
"""Fine-tuning job creation request - optional fields."""
|
|
11008
11415
|
|
|
11009
11416
|
http_options: Optional[HttpOptionsDict]
|
|
11010
11417
|
"""Used to override HTTP request options."""
|
|
11011
11418
|
|
|
11419
|
+
method: Optional[TuningMethod]
|
|
11420
|
+
"""The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING). If not set, the default method (SFT) will be used."""
|
|
11421
|
+
|
|
11012
11422
|
validation_dataset: Optional[TuningValidationDatasetDict]
|
|
11013
|
-
"""
|
|
11423
|
+
"""Validation dataset for tuning. The dataset must be formatted as a JSONL file."""
|
|
11014
11424
|
|
|
11015
11425
|
tuned_model_display_name: Optional[str]
|
|
11016
11426
|
"""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 +11435,7 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
|
|
|
11025
11435
|
"""Multiplier for adjusting the default learning rate."""
|
|
11026
11436
|
|
|
11027
11437
|
export_last_checkpoint_only: Optional[bool]
|
|
11028
|
-
"""If set to true, disable intermediate checkpoints
|
|
11438
|
+
"""If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints."""
|
|
11029
11439
|
|
|
11030
11440
|
pre_tuned_model_checkpoint_id: Optional[str]
|
|
11031
11441
|
"""The optional checkpoint id of the pre-tuned model to use for tuning, if applicable."""
|
|
@@ -11045,6 +11455,9 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
|
|
|
11045
11455
|
labels: Optional[dict[str, str]]
|
|
11046
11456
|
"""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
11457
|
|
|
11458
|
+
beta: Optional[float]
|
|
11459
|
+
"""Weight for KL Divergence regularization, Preference Optimization tuning only."""
|
|
11460
|
+
|
|
11048
11461
|
|
|
11049
11462
|
CreateTuningJobConfigOrDict = Union[
|
|
11050
11463
|
CreateTuningJobConfig, CreateTuningJobConfigDict
|
|
@@ -11052,7 +11465,7 @@ CreateTuningJobConfigOrDict = Union[
|
|
|
11052
11465
|
|
|
11053
11466
|
|
|
11054
11467
|
class _CreateTuningJobParametersPrivate(_common.BaseModel):
|
|
11055
|
-
"""
|
|
11468
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
11056
11469
|
|
|
11057
11470
|
base_model: Optional[str] = Field(
|
|
11058
11471
|
default=None,
|
|
@@ -11071,7 +11484,7 @@ class _CreateTuningJobParametersPrivate(_common.BaseModel):
|
|
|
11071
11484
|
|
|
11072
11485
|
|
|
11073
11486
|
class _CreateTuningJobParametersPrivateDict(TypedDict, total=False):
|
|
11074
|
-
"""
|
|
11487
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
11075
11488
|
|
|
11076
11489
|
base_model: Optional[str]
|
|
11077
11490
|
"""The base model that is being tuned, e.g., "gemini-2.5-flash"."""
|
|
@@ -11273,20 +11686,24 @@ class CachedContentUsageMetadata(_common.BaseModel):
|
|
|
11273
11686
|
"""Metadata on the usage of the cached content."""
|
|
11274
11687
|
|
|
11275
11688
|
audio_duration_seconds: Optional[int] = Field(
|
|
11276
|
-
default=None,
|
|
11689
|
+
default=None,
|
|
11690
|
+
description="""Duration of audio in seconds. This field is not supported in Gemini API.""",
|
|
11277
11691
|
)
|
|
11278
11692
|
image_count: Optional[int] = Field(
|
|
11279
|
-
default=None,
|
|
11693
|
+
default=None,
|
|
11694
|
+
description="""Number of images. This field is not supported in Gemini API.""",
|
|
11280
11695
|
)
|
|
11281
11696
|
text_count: Optional[int] = Field(
|
|
11282
|
-
default=None,
|
|
11697
|
+
default=None,
|
|
11698
|
+
description="""Number of text characters. This field is not supported in Gemini API.""",
|
|
11283
11699
|
)
|
|
11284
11700
|
total_token_count: Optional[int] = Field(
|
|
11285
11701
|
default=None,
|
|
11286
11702
|
description="""Total number of tokens that the cached content consumes.""",
|
|
11287
11703
|
)
|
|
11288
11704
|
video_duration_seconds: Optional[int] = Field(
|
|
11289
|
-
default=None,
|
|
11705
|
+
default=None,
|
|
11706
|
+
description="""Duration of video in seconds. This field is not supported in Gemini API.""",
|
|
11290
11707
|
)
|
|
11291
11708
|
|
|
11292
11709
|
|
|
@@ -11294,19 +11711,19 @@ class CachedContentUsageMetadataDict(TypedDict, total=False):
|
|
|
11294
11711
|
"""Metadata on the usage of the cached content."""
|
|
11295
11712
|
|
|
11296
11713
|
audio_duration_seconds: Optional[int]
|
|
11297
|
-
"""Duration of audio in seconds."""
|
|
11714
|
+
"""Duration of audio in seconds. This field is not supported in Gemini API."""
|
|
11298
11715
|
|
|
11299
11716
|
image_count: Optional[int]
|
|
11300
|
-
"""Number of images."""
|
|
11717
|
+
"""Number of images. This field is not supported in Gemini API."""
|
|
11301
11718
|
|
|
11302
11719
|
text_count: Optional[int]
|
|
11303
|
-
"""Number of text characters."""
|
|
11720
|
+
"""Number of text characters. This field is not supported in Gemini API."""
|
|
11304
11721
|
|
|
11305
11722
|
total_token_count: Optional[int]
|
|
11306
11723
|
"""Total number of tokens that the cached content consumes."""
|
|
11307
11724
|
|
|
11308
11725
|
video_duration_seconds: Optional[int]
|
|
11309
|
-
"""Duration of video in seconds."""
|
|
11726
|
+
"""Duration of video in seconds. This field is not supported in Gemini API."""
|
|
11310
11727
|
|
|
11311
11728
|
|
|
11312
11729
|
CachedContentUsageMetadataOrDict = Union[
|
|
@@ -13293,6 +13710,12 @@ class UpscaleImageConfig(_common.BaseModel):
|
|
|
13293
13710
|
default=None,
|
|
13294
13711
|
description="""Cloud Storage URI used to store the generated images.""",
|
|
13295
13712
|
)
|
|
13713
|
+
safety_filter_level: Optional[SafetyFilterLevel] = Field(
|
|
13714
|
+
default=None, description="""Filter level for safety filtering."""
|
|
13715
|
+
)
|
|
13716
|
+
person_generation: Optional[PersonGeneration] = Field(
|
|
13717
|
+
default=None, description="""Allows generation of people by the model."""
|
|
13718
|
+
)
|
|
13296
13719
|
include_rai_reason: Optional[bool] = Field(
|
|
13297
13720
|
default=None,
|
|
13298
13721
|
description="""Whether to include a reason for filtered-out images in the
|
|
@@ -13340,6 +13763,12 @@ class UpscaleImageConfigDict(TypedDict, total=False):
|
|
|
13340
13763
|
output_gcs_uri: Optional[str]
|
|
13341
13764
|
"""Cloud Storage URI used to store the generated images."""
|
|
13342
13765
|
|
|
13766
|
+
safety_filter_level: Optional[SafetyFilterLevel]
|
|
13767
|
+
"""Filter level for safety filtering."""
|
|
13768
|
+
|
|
13769
|
+
person_generation: Optional[PersonGeneration]
|
|
13770
|
+
"""Allows generation of people by the model."""
|
|
13771
|
+
|
|
13343
13772
|
include_rai_reason: Optional[bool]
|
|
13344
13773
|
"""Whether to include a reason for filtered-out images in the
|
|
13345
13774
|
response."""
|
|
@@ -15878,7 +16307,7 @@ ComputeTokensResultOrDict = Union[ComputeTokensResult, ComputeTokensResultDict]
|
|
|
15878
16307
|
|
|
15879
16308
|
|
|
15880
16309
|
class CreateTuningJobParameters(_common.BaseModel):
|
|
15881
|
-
"""
|
|
16310
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
15882
16311
|
|
|
15883
16312
|
base_model: Optional[str] = Field(
|
|
15884
16313
|
default=None,
|
|
@@ -15894,7 +16323,7 @@ class CreateTuningJobParameters(_common.BaseModel):
|
|
|
15894
16323
|
|
|
15895
16324
|
|
|
15896
16325
|
class CreateTuningJobParametersDict(TypedDict, total=False):
|
|
15897
|
-
"""
|
|
16326
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
15898
16327
|
|
|
15899
16328
|
base_model: Optional[str]
|
|
15900
16329
|
"""The base model that is being tuned, e.g., "gemini-2.5-flash"."""
|