google-genai 1.45.0__py3-none-any.whl → 1.47.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/genai/_api_client.py +47 -17
- google/genai/_extra_utils.py +4 -0
- google/genai/_live_converters.py +66 -61
- google/genai/_tokens_converters.py +47 -47
- google/genai/_transformers.py +10 -1
- google/genai/batches.py +57 -57
- google/genai/caches.py +58 -58
- google/genai/client.py +4 -1
- google/genai/live.py +28 -18
- google/genai/models.py +129 -74
- google/genai/tunings.py +269 -124
- google/genai/types.py +1425 -981
- google/genai/version.py +1 -1
- {google_genai-1.45.0.dist-info → google_genai-1.47.0.dist-info}/METADATA +168 -157
- {google_genai-1.45.0.dist-info → google_genai-1.47.0.dist-info}/RECORD +18 -18
- {google_genai-1.45.0.dist-info → google_genai-1.47.0.dist-info}/WHEEL +0 -0
- {google_genai-1.45.0.dist-info → google_genai-1.47.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.45.0.dist-info → google_genai-1.47.0.dist-info}/top_level.txt +0 -0
google/genai/types.py
CHANGED
|
@@ -89,6 +89,27 @@ else:
|
|
|
89
89
|
except ImportError:
|
|
90
90
|
yaml = None
|
|
91
91
|
|
|
92
|
+
_is_httpx_imported = False
|
|
93
|
+
if typing.TYPE_CHECKING:
|
|
94
|
+
import httpx
|
|
95
|
+
|
|
96
|
+
HttpxClient = httpx.Client
|
|
97
|
+
HttpxAsyncClient = httpx.AsyncClient
|
|
98
|
+
_is_httpx_imported = True
|
|
99
|
+
else:
|
|
100
|
+
HttpxClient: typing.Type = Any
|
|
101
|
+
HttpxAsyncClient: typing.Type = Any
|
|
102
|
+
|
|
103
|
+
try:
|
|
104
|
+
import httpx
|
|
105
|
+
|
|
106
|
+
HttpxClient = httpx.Client
|
|
107
|
+
HttpxAsyncClient = httpx.AsyncClient
|
|
108
|
+
_is_httpx_imported = True
|
|
109
|
+
except ImportError:
|
|
110
|
+
HttpxClient = None
|
|
111
|
+
HttpxAsyncClient = None
|
|
112
|
+
|
|
92
113
|
logger = logging.getLogger('google_genai.types')
|
|
93
114
|
|
|
94
115
|
T = typing.TypeVar('T', bound='GenerateContentResponse')
|
|
@@ -97,7 +118,7 @@ MetricSubclass = typing.TypeVar('MetricSubclass', bound='Metric')
|
|
|
97
118
|
|
|
98
119
|
|
|
99
120
|
class Outcome(_common.CaseInSensitiveEnum):
|
|
100
|
-
"""
|
|
121
|
+
"""Outcome of the code execution."""
|
|
101
122
|
|
|
102
123
|
OUTCOME_UNSPECIFIED = 'OUTCOME_UNSPECIFIED'
|
|
103
124
|
"""Unspecified status. This value should not be used."""
|
|
@@ -110,7 +131,7 @@ class Outcome(_common.CaseInSensitiveEnum):
|
|
|
110
131
|
|
|
111
132
|
|
|
112
133
|
class Language(_common.CaseInSensitiveEnum):
|
|
113
|
-
"""
|
|
134
|
+
"""Programming language of the `code`."""
|
|
114
135
|
|
|
115
136
|
LANGUAGE_UNSPECIFIED = 'LANGUAGE_UNSPECIFIED'
|
|
116
137
|
"""Unspecified language. This value should not be used."""
|
|
@@ -118,8 +139,21 @@ class Language(_common.CaseInSensitiveEnum):
|
|
|
118
139
|
"""Python >= 3.10, with numpy and simpy available."""
|
|
119
140
|
|
|
120
141
|
|
|
142
|
+
class FunctionResponseScheduling(_common.CaseInSensitiveEnum):
|
|
143
|
+
"""Specifies how the response should be scheduled in the conversation."""
|
|
144
|
+
|
|
145
|
+
SCHEDULING_UNSPECIFIED = 'SCHEDULING_UNSPECIFIED'
|
|
146
|
+
"""This value is unused."""
|
|
147
|
+
SILENT = 'SILENT'
|
|
148
|
+
"""Only add the result to the conversation context, do not interrupt or trigger generation."""
|
|
149
|
+
WHEN_IDLE = 'WHEN_IDLE'
|
|
150
|
+
"""Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation."""
|
|
151
|
+
INTERRUPT = 'INTERRUPT'
|
|
152
|
+
"""Add the result to the conversation context, interrupt ongoing generation and prompt to generate output."""
|
|
153
|
+
|
|
154
|
+
|
|
121
155
|
class Type(_common.CaseInSensitiveEnum):
|
|
122
|
-
"""
|
|
156
|
+
"""The type of the data."""
|
|
123
157
|
|
|
124
158
|
TYPE_UNSPECIFIED = 'TYPE_UNSPECIFIED'
|
|
125
159
|
"""Not specified, should not be used."""
|
|
@@ -139,40 +173,83 @@ class Type(_common.CaseInSensitiveEnum):
|
|
|
139
173
|
"""Null type"""
|
|
140
174
|
|
|
141
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
|
+
|
|
142
217
|
class HarmCategory(_common.CaseInSensitiveEnum):
|
|
143
|
-
"""
|
|
218
|
+
"""Harm category."""
|
|
144
219
|
|
|
145
220
|
HARM_CATEGORY_UNSPECIFIED = 'HARM_CATEGORY_UNSPECIFIED'
|
|
146
221
|
"""The harm category is unspecified."""
|
|
147
|
-
HARM_CATEGORY_HATE_SPEECH = 'HARM_CATEGORY_HATE_SPEECH'
|
|
148
|
-
"""The harm category is hate speech."""
|
|
149
|
-
HARM_CATEGORY_DANGEROUS_CONTENT = 'HARM_CATEGORY_DANGEROUS_CONTENT'
|
|
150
|
-
"""The harm category is dangerous content."""
|
|
151
222
|
HARM_CATEGORY_HARASSMENT = 'HARM_CATEGORY_HARASSMENT'
|
|
152
223
|
"""The harm category is harassment."""
|
|
224
|
+
HARM_CATEGORY_HATE_SPEECH = 'HARM_CATEGORY_HATE_SPEECH'
|
|
225
|
+
"""The harm category is hate speech."""
|
|
153
226
|
HARM_CATEGORY_SEXUALLY_EXPLICIT = 'HARM_CATEGORY_SEXUALLY_EXPLICIT'
|
|
154
227
|
"""The harm category is sexually explicit content."""
|
|
228
|
+
HARM_CATEGORY_DANGEROUS_CONTENT = 'HARM_CATEGORY_DANGEROUS_CONTENT'
|
|
229
|
+
"""The harm category is dangerous content."""
|
|
155
230
|
HARM_CATEGORY_CIVIC_INTEGRITY = 'HARM_CATEGORY_CIVIC_INTEGRITY'
|
|
156
231
|
"""Deprecated: Election filter is not longer supported. The harm category is civic integrity."""
|
|
157
232
|
HARM_CATEGORY_IMAGE_HATE = 'HARM_CATEGORY_IMAGE_HATE'
|
|
158
|
-
"""The harm category is image hate."""
|
|
233
|
+
"""The harm category is image hate. This enum value is not supported in Gemini API."""
|
|
159
234
|
HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT = (
|
|
160
235
|
'HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT'
|
|
161
236
|
)
|
|
162
|
-
"""The harm category is image dangerous content."""
|
|
237
|
+
"""The harm category is image dangerous content. This enum value is not supported in Gemini API."""
|
|
163
238
|
HARM_CATEGORY_IMAGE_HARASSMENT = 'HARM_CATEGORY_IMAGE_HARASSMENT'
|
|
164
|
-
"""The harm category is image harassment."""
|
|
239
|
+
"""The harm category is image harassment. This enum value is not supported in Gemini API."""
|
|
165
240
|
HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT = (
|
|
166
241
|
'HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT'
|
|
167
242
|
)
|
|
168
|
-
"""The harm category is image sexually explicit content."""
|
|
243
|
+
"""The harm category is image sexually explicit content. This enum value is not supported in Gemini API."""
|
|
244
|
+
HARM_CATEGORY_JAILBREAK = 'HARM_CATEGORY_JAILBREAK'
|
|
245
|
+
"""The harm category is for jailbreak prompts. This enum value is not supported in Gemini API."""
|
|
169
246
|
|
|
170
247
|
|
|
171
248
|
class HarmBlockMethod(_common.CaseInSensitiveEnum):
|
|
172
|
-
"""
|
|
249
|
+
"""Specify if the threshold is used for probability or severity score.
|
|
173
250
|
|
|
174
|
-
|
|
175
|
-
|
|
251
|
+
If not specified, the threshold is used for probability score. This enum is
|
|
252
|
+
not supported in Gemini API.
|
|
176
253
|
"""
|
|
177
254
|
|
|
178
255
|
HARM_BLOCK_METHOD_UNSPECIFIED = 'HARM_BLOCK_METHOD_UNSPECIFIED'
|
|
@@ -184,7 +261,7 @@ class HarmBlockMethod(_common.CaseInSensitiveEnum):
|
|
|
184
261
|
|
|
185
262
|
|
|
186
263
|
class HarmBlockThreshold(_common.CaseInSensitiveEnum):
|
|
187
|
-
"""
|
|
264
|
+
"""The harm block threshold."""
|
|
188
265
|
|
|
189
266
|
HARM_BLOCK_THRESHOLD_UNSPECIFIED = 'HARM_BLOCK_THRESHOLD_UNSPECIFIED'
|
|
190
267
|
"""Unspecified harm block threshold."""
|
|
@@ -200,59 +277,6 @@ class HarmBlockThreshold(_common.CaseInSensitiveEnum):
|
|
|
200
277
|
"""Turn off the safety filter."""
|
|
201
278
|
|
|
202
279
|
|
|
203
|
-
class Mode(_common.CaseInSensitiveEnum):
|
|
204
|
-
"""The mode of the predictor to be used in dynamic retrieval."""
|
|
205
|
-
|
|
206
|
-
MODE_UNSPECIFIED = 'MODE_UNSPECIFIED'
|
|
207
|
-
"""Always trigger retrieval."""
|
|
208
|
-
MODE_DYNAMIC = 'MODE_DYNAMIC'
|
|
209
|
-
"""Run retrieval only when system decides it is necessary."""
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
class AuthType(_common.CaseInSensitiveEnum):
|
|
213
|
-
"""Type of auth scheme."""
|
|
214
|
-
|
|
215
|
-
AUTH_TYPE_UNSPECIFIED = 'AUTH_TYPE_UNSPECIFIED'
|
|
216
|
-
NO_AUTH = 'NO_AUTH'
|
|
217
|
-
"""No Auth."""
|
|
218
|
-
API_KEY_AUTH = 'API_KEY_AUTH'
|
|
219
|
-
"""API Key Auth."""
|
|
220
|
-
HTTP_BASIC_AUTH = 'HTTP_BASIC_AUTH'
|
|
221
|
-
"""HTTP Basic Auth."""
|
|
222
|
-
GOOGLE_SERVICE_ACCOUNT_AUTH = 'GOOGLE_SERVICE_ACCOUNT_AUTH'
|
|
223
|
-
"""Google Service Account Auth."""
|
|
224
|
-
OAUTH = 'OAUTH'
|
|
225
|
-
"""OAuth auth."""
|
|
226
|
-
OIDC_AUTH = 'OIDC_AUTH'
|
|
227
|
-
"""OpenID Connect (OIDC) Auth."""
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
class ApiSpec(_common.CaseInSensitiveEnum):
|
|
231
|
-
"""The API spec that the external API implements."""
|
|
232
|
-
|
|
233
|
-
API_SPEC_UNSPECIFIED = 'API_SPEC_UNSPECIFIED'
|
|
234
|
-
"""Unspecified API spec. This value should not be used."""
|
|
235
|
-
SIMPLE_SEARCH = 'SIMPLE_SEARCH'
|
|
236
|
-
"""Simple search API spec."""
|
|
237
|
-
ELASTIC_SEARCH = 'ELASTIC_SEARCH'
|
|
238
|
-
"""Elastic search API spec."""
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
|
|
242
|
-
"""Status of the url retrieval."""
|
|
243
|
-
|
|
244
|
-
URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
|
|
245
|
-
"""Default value. This value is unused"""
|
|
246
|
-
URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
|
|
247
|
-
"""Url retrieval is successful."""
|
|
248
|
-
URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
|
|
249
|
-
"""Url retrieval is failed due to error."""
|
|
250
|
-
URL_RETRIEVAL_STATUS_PAYWALL = 'URL_RETRIEVAL_STATUS_PAYWALL'
|
|
251
|
-
"""Url retrieval is failed because the content is behind paywall."""
|
|
252
|
-
URL_RETRIEVAL_STATUS_UNSAFE = 'URL_RETRIEVAL_STATUS_UNSAFE'
|
|
253
|
-
"""Url retrieval is failed because the content is unsafe."""
|
|
254
|
-
|
|
255
|
-
|
|
256
280
|
class FinishReason(_common.CaseInSensitiveEnum):
|
|
257
281
|
"""Output only. The reason why the model stopped generating tokens.
|
|
258
282
|
|
|
@@ -307,7 +331,10 @@ class HarmProbability(_common.CaseInSensitiveEnum):
|
|
|
307
331
|
|
|
308
332
|
|
|
309
333
|
class HarmSeverity(_common.CaseInSensitiveEnum):
|
|
310
|
-
"""Output only.
|
|
334
|
+
"""Output only.
|
|
335
|
+
|
|
336
|
+
Harm severity levels in the content. This enum is not supported in Gemini API.
|
|
337
|
+
"""
|
|
311
338
|
|
|
312
339
|
HARM_SEVERITY_UNSPECIFIED = 'HARM_SEVERITY_UNSPECIFIED'
|
|
313
340
|
"""Harm severity unspecified."""
|
|
@@ -321,28 +348,47 @@ class HarmSeverity(_common.CaseInSensitiveEnum):
|
|
|
321
348
|
"""High level of harm severity."""
|
|
322
349
|
|
|
323
350
|
|
|
351
|
+
class UrlRetrievalStatus(_common.CaseInSensitiveEnum):
|
|
352
|
+
"""Status of the url retrieval."""
|
|
353
|
+
|
|
354
|
+
URL_RETRIEVAL_STATUS_UNSPECIFIED = 'URL_RETRIEVAL_STATUS_UNSPECIFIED'
|
|
355
|
+
"""Default value. This value is unused."""
|
|
356
|
+
URL_RETRIEVAL_STATUS_SUCCESS = 'URL_RETRIEVAL_STATUS_SUCCESS'
|
|
357
|
+
"""Url retrieval is successful."""
|
|
358
|
+
URL_RETRIEVAL_STATUS_ERROR = 'URL_RETRIEVAL_STATUS_ERROR'
|
|
359
|
+
"""Url retrieval is failed due to error."""
|
|
360
|
+
URL_RETRIEVAL_STATUS_PAYWALL = 'URL_RETRIEVAL_STATUS_PAYWALL'
|
|
361
|
+
"""Url retrieval is failed because the content is behind paywall. This enum value is not supported in Vertex AI."""
|
|
362
|
+
URL_RETRIEVAL_STATUS_UNSAFE = 'URL_RETRIEVAL_STATUS_UNSAFE'
|
|
363
|
+
"""Url retrieval is failed because the content is unsafe. This enum value is not supported in Vertex AI."""
|
|
364
|
+
|
|
365
|
+
|
|
324
366
|
class BlockedReason(_common.CaseInSensitiveEnum):
|
|
325
|
-
"""Output only.
|
|
367
|
+
"""Output only. The reason why the prompt was blocked."""
|
|
326
368
|
|
|
327
369
|
BLOCKED_REASON_UNSPECIFIED = 'BLOCKED_REASON_UNSPECIFIED'
|
|
328
|
-
"""
|
|
370
|
+
"""The blocked reason is unspecified."""
|
|
329
371
|
SAFETY = 'SAFETY'
|
|
330
|
-
"""
|
|
372
|
+
"""The prompt was blocked for safety reasons."""
|
|
331
373
|
OTHER = 'OTHER'
|
|
332
|
-
"""
|
|
374
|
+
"""The prompt was blocked for other reasons. For example, it may be due to the prompt's language, or because it contains other harmful content."""
|
|
333
375
|
BLOCKLIST = 'BLOCKLIST'
|
|
334
|
-
"""
|
|
376
|
+
"""The prompt was blocked because it contains a term from the terminology blocklist."""
|
|
335
377
|
PROHIBITED_CONTENT = 'PROHIBITED_CONTENT'
|
|
336
|
-
"""
|
|
378
|
+
"""The prompt was blocked because it contains prohibited content."""
|
|
337
379
|
IMAGE_SAFETY = 'IMAGE_SAFETY'
|
|
338
|
-
"""
|
|
380
|
+
"""The prompt was blocked because it contains content that is unsafe for image generation."""
|
|
381
|
+
MODEL_ARMOR = 'MODEL_ARMOR'
|
|
382
|
+
"""The prompt was blocked by Model Armor. This enum value is not supported in Gemini API."""
|
|
383
|
+
JAILBREAK = 'JAILBREAK'
|
|
384
|
+
"""The prompt was blocked as a jailbreak attempt. This enum value is not supported in Gemini API."""
|
|
339
385
|
|
|
340
386
|
|
|
341
387
|
class TrafficType(_common.CaseInSensitiveEnum):
|
|
342
388
|
"""Output only.
|
|
343
389
|
|
|
344
390
|
Traffic type. This shows whether a request consumes Pay-As-You-Go or
|
|
345
|
-
Provisioned Throughput quota.
|
|
391
|
+
Provisioned Throughput quota. This enum is not supported in Gemini API.
|
|
346
392
|
"""
|
|
347
393
|
|
|
348
394
|
TRAFFIC_TYPE_UNSPECIFIED = 'TRAFFIC_TYPE_UNSPECIFIED'
|
|
@@ -379,6 +425,36 @@ class MediaResolution(_common.CaseInSensitiveEnum):
|
|
|
379
425
|
"""Media resolution set to high (zoomed reframing with 256 tokens)."""
|
|
380
426
|
|
|
381
427
|
|
|
428
|
+
class TuningMode(_common.CaseInSensitiveEnum):
|
|
429
|
+
"""Tuning mode. This enum is not supported in Gemini API."""
|
|
430
|
+
|
|
431
|
+
TUNING_MODE_UNSPECIFIED = 'TUNING_MODE_UNSPECIFIED'
|
|
432
|
+
"""Tuning mode is unspecified."""
|
|
433
|
+
TUNING_MODE_FULL = 'TUNING_MODE_FULL'
|
|
434
|
+
"""Full fine-tuning mode."""
|
|
435
|
+
TUNING_MODE_PEFT_ADAPTER = 'TUNING_MODE_PEFT_ADAPTER'
|
|
436
|
+
"""PEFT adapter tuning mode."""
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
class AdapterSize(_common.CaseInSensitiveEnum):
|
|
440
|
+
"""Adapter size for tuning. This enum is not supported in Gemini API."""
|
|
441
|
+
|
|
442
|
+
ADAPTER_SIZE_UNSPECIFIED = 'ADAPTER_SIZE_UNSPECIFIED'
|
|
443
|
+
"""Adapter size is unspecified."""
|
|
444
|
+
ADAPTER_SIZE_ONE = 'ADAPTER_SIZE_ONE'
|
|
445
|
+
"""Adapter size 1."""
|
|
446
|
+
ADAPTER_SIZE_TWO = 'ADAPTER_SIZE_TWO'
|
|
447
|
+
"""Adapter size 2."""
|
|
448
|
+
ADAPTER_SIZE_FOUR = 'ADAPTER_SIZE_FOUR'
|
|
449
|
+
"""Adapter size 4."""
|
|
450
|
+
ADAPTER_SIZE_EIGHT = 'ADAPTER_SIZE_EIGHT'
|
|
451
|
+
"""Adapter size 8."""
|
|
452
|
+
ADAPTER_SIZE_SIXTEEN = 'ADAPTER_SIZE_SIXTEEN'
|
|
453
|
+
"""Adapter size 16."""
|
|
454
|
+
ADAPTER_SIZE_THIRTY_TWO = 'ADAPTER_SIZE_THIRTY_TWO'
|
|
455
|
+
"""Adapter size 32."""
|
|
456
|
+
|
|
457
|
+
|
|
382
458
|
class JobState(_common.CaseInSensitiveEnum):
|
|
383
459
|
"""Job state."""
|
|
384
460
|
|
|
@@ -408,38 +484,11 @@ class JobState(_common.CaseInSensitiveEnum):
|
|
|
408
484
|
"""The job is partially succeeded, some results may be missing due to errors."""
|
|
409
485
|
|
|
410
486
|
|
|
411
|
-
class TuningMode(_common.CaseInSensitiveEnum):
|
|
412
|
-
"""Tuning mode."""
|
|
413
|
-
|
|
414
|
-
TUNING_MODE_UNSPECIFIED = 'TUNING_MODE_UNSPECIFIED'
|
|
415
|
-
"""Tuning mode is unspecified."""
|
|
416
|
-
TUNING_MODE_FULL = 'TUNING_MODE_FULL'
|
|
417
|
-
"""Full fine-tuning mode."""
|
|
418
|
-
TUNING_MODE_PEFT_ADAPTER = 'TUNING_MODE_PEFT_ADAPTER'
|
|
419
|
-
"""PEFT adapter tuning mode."""
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
class AdapterSize(_common.CaseInSensitiveEnum):
|
|
423
|
-
"""Optional. Adapter size for tuning."""
|
|
424
|
-
|
|
425
|
-
ADAPTER_SIZE_UNSPECIFIED = 'ADAPTER_SIZE_UNSPECIFIED'
|
|
426
|
-
"""Adapter size is unspecified."""
|
|
427
|
-
ADAPTER_SIZE_ONE = 'ADAPTER_SIZE_ONE'
|
|
428
|
-
"""Adapter size 1."""
|
|
429
|
-
ADAPTER_SIZE_TWO = 'ADAPTER_SIZE_TWO'
|
|
430
|
-
"""Adapter size 2."""
|
|
431
|
-
ADAPTER_SIZE_FOUR = 'ADAPTER_SIZE_FOUR'
|
|
432
|
-
"""Adapter size 4."""
|
|
433
|
-
ADAPTER_SIZE_EIGHT = 'ADAPTER_SIZE_EIGHT'
|
|
434
|
-
"""Adapter size 8."""
|
|
435
|
-
ADAPTER_SIZE_SIXTEEN = 'ADAPTER_SIZE_SIXTEEN'
|
|
436
|
-
"""Adapter size 16."""
|
|
437
|
-
ADAPTER_SIZE_THIRTY_TWO = 'ADAPTER_SIZE_THIRTY_TWO'
|
|
438
|
-
"""Adapter size 32."""
|
|
439
|
-
|
|
440
|
-
|
|
441
487
|
class TuningTask(_common.CaseInSensitiveEnum):
|
|
442
|
-
"""
|
|
488
|
+
"""The tuning task.
|
|
489
|
+
|
|
490
|
+
Either I2V or T2V. This enum is not supported in Gemini API.
|
|
491
|
+
"""
|
|
443
492
|
|
|
444
493
|
TUNING_TASK_UNSPECIFIED = 'TUNING_TASK_UNSPECIFIED'
|
|
445
494
|
"""Default value. This value is unused."""
|
|
@@ -655,6 +704,15 @@ class VideoCompressionQuality(_common.CaseInSensitiveEnum):
|
|
|
655
704
|
with a larger file size."""
|
|
656
705
|
|
|
657
706
|
|
|
707
|
+
class TuningMethod(_common.CaseInSensitiveEnum):
|
|
708
|
+
"""Enum representing the tuning method."""
|
|
709
|
+
|
|
710
|
+
SUPERVISED_FINE_TUNING = 'SUPERVISED_FINE_TUNING'
|
|
711
|
+
"""Supervised fine tuning."""
|
|
712
|
+
PREFERENCE_TUNING = 'PREFERENCE_TUNING'
|
|
713
|
+
"""Preference optimization tuning."""
|
|
714
|
+
|
|
715
|
+
|
|
658
716
|
class FileState(_common.CaseInSensitiveEnum):
|
|
659
717
|
"""State for the lifecycle of a File."""
|
|
660
718
|
|
|
@@ -702,19 +760,6 @@ class MediaModality(_common.CaseInSensitiveEnum):
|
|
|
702
760
|
"""Document, e.g. PDF."""
|
|
703
761
|
|
|
704
762
|
|
|
705
|
-
class FunctionResponseScheduling(_common.CaseInSensitiveEnum):
|
|
706
|
-
"""Specifies how the response should be scheduled in the conversation."""
|
|
707
|
-
|
|
708
|
-
SCHEDULING_UNSPECIFIED = 'SCHEDULING_UNSPECIFIED'
|
|
709
|
-
"""This value is unused."""
|
|
710
|
-
SILENT = 'SILENT'
|
|
711
|
-
"""Only add the result to the conversation context, do not interrupt or trigger generation."""
|
|
712
|
-
WHEN_IDLE = 'WHEN_IDLE'
|
|
713
|
-
"""Add the result to the conversation context, and prompt to generate output without interrupting ongoing generation."""
|
|
714
|
-
INTERRUPT = 'INTERRUPT'
|
|
715
|
-
"""Add the result to the conversation context, interrupt ongoing generation and prompt to generate output."""
|
|
716
|
-
|
|
717
|
-
|
|
718
763
|
class StartSensitivity(_common.CaseInSensitiveEnum):
|
|
719
764
|
"""Start of speech sensitivity."""
|
|
720
765
|
|
|
@@ -823,116 +868,6 @@ class LiveMusicPlaybackControl(_common.CaseInSensitiveEnum):
|
|
|
823
868
|
Retains the current prompts and config."""
|
|
824
869
|
|
|
825
870
|
|
|
826
|
-
class VideoMetadata(_common.BaseModel):
|
|
827
|
-
"""Describes how the video in the Part should be used by the model."""
|
|
828
|
-
|
|
829
|
-
fps: Optional[float] = Field(
|
|
830
|
-
default=None,
|
|
831
|
-
description="""The frame rate of the video sent to the model. If not specified, the
|
|
832
|
-
default value will be 1.0. The fps range is (0.0, 24.0].""",
|
|
833
|
-
)
|
|
834
|
-
end_offset: Optional[str] = Field(
|
|
835
|
-
default=None, description="""Optional. The end offset of the video."""
|
|
836
|
-
)
|
|
837
|
-
start_offset: Optional[str] = Field(
|
|
838
|
-
default=None, description="""Optional. The start offset of the video."""
|
|
839
|
-
)
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
class VideoMetadataDict(TypedDict, total=False):
|
|
843
|
-
"""Describes how the video in the Part should be used by the model."""
|
|
844
|
-
|
|
845
|
-
fps: Optional[float]
|
|
846
|
-
"""The frame rate of the video sent to the model. If not specified, the
|
|
847
|
-
default value will be 1.0. The fps range is (0.0, 24.0]."""
|
|
848
|
-
|
|
849
|
-
end_offset: Optional[str]
|
|
850
|
-
"""Optional. The end offset of the video."""
|
|
851
|
-
|
|
852
|
-
start_offset: Optional[str]
|
|
853
|
-
"""Optional. The start offset of the video."""
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
VideoMetadataOrDict = Union[VideoMetadata, VideoMetadataDict]
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
class Blob(_common.BaseModel):
|
|
860
|
-
"""Content blob."""
|
|
861
|
-
|
|
862
|
-
display_name: Optional[str] = Field(
|
|
863
|
-
default=None,
|
|
864
|
-
description="""Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls.""",
|
|
865
|
-
)
|
|
866
|
-
data: Optional[bytes] = Field(
|
|
867
|
-
default=None, description="""Required. Raw bytes."""
|
|
868
|
-
)
|
|
869
|
-
mime_type: Optional[str] = Field(
|
|
870
|
-
default=None,
|
|
871
|
-
description="""Required. The IANA standard MIME type of the source data.""",
|
|
872
|
-
)
|
|
873
|
-
|
|
874
|
-
def as_image(self) -> Optional['Image']:
|
|
875
|
-
"""Returns the Blob as a Image, or None if the Blob is not an image."""
|
|
876
|
-
if (
|
|
877
|
-
not self.data
|
|
878
|
-
or not self.mime_type
|
|
879
|
-
or not self.mime_type.startswith('image/')
|
|
880
|
-
):
|
|
881
|
-
return None
|
|
882
|
-
return Image(
|
|
883
|
-
image_bytes=self.data,
|
|
884
|
-
mime_type=self.mime_type,
|
|
885
|
-
)
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
class BlobDict(TypedDict, total=False):
|
|
889
|
-
"""Content blob."""
|
|
890
|
-
|
|
891
|
-
display_name: Optional[str]
|
|
892
|
-
"""Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is not currently used in the Gemini GenerateContent calls."""
|
|
893
|
-
|
|
894
|
-
data: Optional[bytes]
|
|
895
|
-
"""Required. Raw bytes."""
|
|
896
|
-
|
|
897
|
-
mime_type: Optional[str]
|
|
898
|
-
"""Required. The IANA standard MIME type of the source data."""
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
BlobOrDict = Union[Blob, BlobDict]
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
class FileData(_common.BaseModel):
|
|
905
|
-
"""URI based data."""
|
|
906
|
-
|
|
907
|
-
display_name: Optional[str] = Field(
|
|
908
|
-
default=None,
|
|
909
|
-
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.""",
|
|
910
|
-
)
|
|
911
|
-
file_uri: Optional[str] = Field(
|
|
912
|
-
default=None, description="""Required. URI."""
|
|
913
|
-
)
|
|
914
|
-
mime_type: Optional[str] = Field(
|
|
915
|
-
default=None,
|
|
916
|
-
description="""Required. The IANA standard MIME type of the source data.""",
|
|
917
|
-
)
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
class FileDataDict(TypedDict, total=False):
|
|
921
|
-
"""URI based data."""
|
|
922
|
-
|
|
923
|
-
display_name: Optional[str]
|
|
924
|
-
"""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."""
|
|
925
|
-
|
|
926
|
-
file_uri: Optional[str]
|
|
927
|
-
"""Required. URI."""
|
|
928
|
-
|
|
929
|
-
mime_type: Optional[str]
|
|
930
|
-
"""Required. The IANA standard MIME type of the source data."""
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
FileDataOrDict = Union[FileData, FileDataDict]
|
|
934
|
-
|
|
935
|
-
|
|
936
871
|
class FunctionCall(_common.BaseModel):
|
|
937
872
|
"""A function call."""
|
|
938
873
|
|
|
@@ -1029,11 +964,43 @@ class ExecutableCodeDict(TypedDict, total=False):
|
|
|
1029
964
|
code: Optional[str]
|
|
1030
965
|
"""Required. The code to be executed."""
|
|
1031
966
|
|
|
1032
|
-
language: Optional[Language]
|
|
1033
|
-
"""Required. Programming language of the `code`."""
|
|
967
|
+
language: Optional[Language]
|
|
968
|
+
"""Required. Programming language of the `code`."""
|
|
969
|
+
|
|
970
|
+
|
|
971
|
+
ExecutableCodeOrDict = Union[ExecutableCode, ExecutableCodeDict]
|
|
972
|
+
|
|
973
|
+
|
|
974
|
+
class FileData(_common.BaseModel):
|
|
975
|
+
"""URI based data."""
|
|
976
|
+
|
|
977
|
+
display_name: Optional[str] = Field(
|
|
978
|
+
default=None,
|
|
979
|
+
description="""Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API.""",
|
|
980
|
+
)
|
|
981
|
+
file_uri: Optional[str] = Field(
|
|
982
|
+
default=None, description="""Required. URI."""
|
|
983
|
+
)
|
|
984
|
+
mime_type: Optional[str] = Field(
|
|
985
|
+
default=None,
|
|
986
|
+
description="""Required. The IANA standard MIME type of the source data.""",
|
|
987
|
+
)
|
|
988
|
+
|
|
989
|
+
|
|
990
|
+
class FileDataDict(TypedDict, total=False):
|
|
991
|
+
"""URI based data."""
|
|
992
|
+
|
|
993
|
+
display_name: Optional[str]
|
|
994
|
+
"""Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API."""
|
|
995
|
+
|
|
996
|
+
file_uri: Optional[str]
|
|
997
|
+
"""Required. URI."""
|
|
998
|
+
|
|
999
|
+
mime_type: Optional[str]
|
|
1000
|
+
"""Required. The IANA standard MIME type of the source data."""
|
|
1034
1001
|
|
|
1035
1002
|
|
|
1036
|
-
|
|
1003
|
+
FileDataOrDict = Union[FileData, FileDataDict]
|
|
1037
1004
|
|
|
1038
1005
|
|
|
1039
1006
|
class FunctionResponseBlob(_common.BaseModel):
|
|
@@ -1247,31 +1214,90 @@ class FunctionResponseDict(TypedDict, total=False):
|
|
|
1247
1214
|
FunctionResponseOrDict = Union[FunctionResponse, FunctionResponseDict]
|
|
1248
1215
|
|
|
1249
1216
|
|
|
1250
|
-
class
|
|
1251
|
-
"""
|
|
1252
|
-
|
|
1253
|
-
Exactly one field within a Part should be set, representing the specific type
|
|
1254
|
-
of content being conveyed. Using multiple fields within the same `Part`
|
|
1255
|
-
instance is considered invalid.
|
|
1256
|
-
"""
|
|
1217
|
+
class Blob(_common.BaseModel):
|
|
1218
|
+
"""Content blob."""
|
|
1257
1219
|
|
|
1258
|
-
|
|
1259
|
-
default=None, description="""
|
|
1220
|
+
data: Optional[bytes] = Field(
|
|
1221
|
+
default=None, description="""Required. Raw bytes."""
|
|
1260
1222
|
)
|
|
1261
|
-
|
|
1223
|
+
display_name: Optional[str] = Field(
|
|
1262
1224
|
default=None,
|
|
1263
|
-
description="""
|
|
1225
|
+
description="""Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API.""",
|
|
1264
1226
|
)
|
|
1265
|
-
|
|
1266
|
-
default=None,
|
|
1227
|
+
mime_type: Optional[str] = Field(
|
|
1228
|
+
default=None,
|
|
1229
|
+
description="""Required. The IANA standard MIME type of the source data.""",
|
|
1267
1230
|
)
|
|
1268
|
-
|
|
1269
|
-
|
|
1231
|
+
|
|
1232
|
+
def as_image(self) -> Optional['Image']:
|
|
1233
|
+
"""Returns the Blob as a Image, or None if the Blob is not an image."""
|
|
1234
|
+
if (
|
|
1235
|
+
not self.data
|
|
1236
|
+
or not self.mime_type
|
|
1237
|
+
or not self.mime_type.startswith('image/')
|
|
1238
|
+
):
|
|
1239
|
+
return None
|
|
1240
|
+
return Image(
|
|
1241
|
+
image_bytes=self.data,
|
|
1242
|
+
mime_type=self.mime_type,
|
|
1243
|
+
)
|
|
1244
|
+
|
|
1245
|
+
|
|
1246
|
+
class BlobDict(TypedDict, total=False):
|
|
1247
|
+
"""Content blob."""
|
|
1248
|
+
|
|
1249
|
+
data: Optional[bytes]
|
|
1250
|
+
"""Required. Raw bytes."""
|
|
1251
|
+
|
|
1252
|
+
display_name: Optional[str]
|
|
1253
|
+
"""Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled. This field is not supported in Gemini API."""
|
|
1254
|
+
|
|
1255
|
+
mime_type: Optional[str]
|
|
1256
|
+
"""Required. The IANA standard MIME type of the source data."""
|
|
1257
|
+
|
|
1258
|
+
|
|
1259
|
+
BlobOrDict = Union[Blob, BlobDict]
|
|
1260
|
+
|
|
1261
|
+
|
|
1262
|
+
class VideoMetadata(_common.BaseModel):
|
|
1263
|
+
"""Metadata describes the input video content."""
|
|
1264
|
+
|
|
1265
|
+
end_offset: Optional[str] = Field(
|
|
1266
|
+
default=None, description="""Optional. The end offset of the video."""
|
|
1270
1267
|
)
|
|
1271
|
-
|
|
1268
|
+
fps: Optional[float] = Field(
|
|
1272
1269
|
default=None,
|
|
1273
|
-
description="""
|
|
1270
|
+
description="""Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0].""",
|
|
1271
|
+
)
|
|
1272
|
+
start_offset: Optional[str] = Field(
|
|
1273
|
+
default=None, description="""Optional. The start offset of the video."""
|
|
1274
1274
|
)
|
|
1275
|
+
|
|
1276
|
+
|
|
1277
|
+
class VideoMetadataDict(TypedDict, total=False):
|
|
1278
|
+
"""Metadata describes the input video content."""
|
|
1279
|
+
|
|
1280
|
+
end_offset: Optional[str]
|
|
1281
|
+
"""Optional. The end offset of the video."""
|
|
1282
|
+
|
|
1283
|
+
fps: Optional[float]
|
|
1284
|
+
"""Optional. The frame rate of the video sent to the model. If not specified, the default value will be 1.0. The fps range is (0.0, 24.0]."""
|
|
1285
|
+
|
|
1286
|
+
start_offset: Optional[str]
|
|
1287
|
+
"""Optional. The start offset of the video."""
|
|
1288
|
+
|
|
1289
|
+
|
|
1290
|
+
VideoMetadataOrDict = Union[VideoMetadata, VideoMetadataDict]
|
|
1291
|
+
|
|
1292
|
+
|
|
1293
|
+
class Part(_common.BaseModel):
|
|
1294
|
+
"""A datatype containing media content.
|
|
1295
|
+
|
|
1296
|
+
Exactly one field within a Part should be set, representing the specific type
|
|
1297
|
+
of content being conveyed. Using multiple fields within the same `Part`
|
|
1298
|
+
instance is considered invalid.
|
|
1299
|
+
"""
|
|
1300
|
+
|
|
1275
1301
|
function_call: Optional[FunctionCall] = Field(
|
|
1276
1302
|
default=None,
|
|
1277
1303
|
description="""A predicted [FunctionCall] returned from the model that contains a string
|
|
@@ -1286,13 +1312,31 @@ class Part(_common.BaseModel):
|
|
|
1286
1312
|
default=None,
|
|
1287
1313
|
description="""Optional. Code generated by the model that is meant to be executed.""",
|
|
1288
1314
|
)
|
|
1315
|
+
file_data: Optional[FileData] = Field(
|
|
1316
|
+
default=None, description="""Optional. URI based data."""
|
|
1317
|
+
)
|
|
1289
1318
|
function_response: Optional[FunctionResponse] = Field(
|
|
1290
1319
|
default=None,
|
|
1291
1320
|
description="""Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model.""",
|
|
1292
1321
|
)
|
|
1322
|
+
inline_data: Optional[Blob] = Field(
|
|
1323
|
+
default=None, description="""Optional. Inlined bytes data."""
|
|
1324
|
+
)
|
|
1293
1325
|
text: Optional[str] = Field(
|
|
1294
1326
|
default=None, description="""Optional. Text part (can be code)."""
|
|
1295
1327
|
)
|
|
1328
|
+
thought: Optional[bool] = Field(
|
|
1329
|
+
default=None,
|
|
1330
|
+
description="""Optional. Indicates if the part is thought from the model.""",
|
|
1331
|
+
)
|
|
1332
|
+
thought_signature: Optional[bytes] = Field(
|
|
1333
|
+
default=None,
|
|
1334
|
+
description="""Optional. An opaque signature for the thought so it can be reused in subsequent requests.""",
|
|
1335
|
+
)
|
|
1336
|
+
video_metadata: Optional[VideoMetadata] = Field(
|
|
1337
|
+
default=None,
|
|
1338
|
+
description="""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.""",
|
|
1339
|
+
)
|
|
1296
1340
|
|
|
1297
1341
|
def as_image(self) -> Optional['Image']:
|
|
1298
1342
|
"""Returns the part as a PIL Image, or None if the part is not an image."""
|
|
@@ -1371,21 +1415,6 @@ class PartDict(TypedDict, total=False):
|
|
|
1371
1415
|
instance is considered invalid.
|
|
1372
1416
|
"""
|
|
1373
1417
|
|
|
1374
|
-
video_metadata: Optional[VideoMetadataDict]
|
|
1375
|
-
"""Metadata for a given video."""
|
|
1376
|
-
|
|
1377
|
-
thought: Optional[bool]
|
|
1378
|
-
"""Indicates if the part is thought from the model."""
|
|
1379
|
-
|
|
1380
|
-
inline_data: Optional[BlobDict]
|
|
1381
|
-
"""Optional. Inlined bytes data."""
|
|
1382
|
-
|
|
1383
|
-
file_data: Optional[FileDataDict]
|
|
1384
|
-
"""Optional. URI based data."""
|
|
1385
|
-
|
|
1386
|
-
thought_signature: Optional[bytes]
|
|
1387
|
-
"""An opaque signature for the thought so it can be reused in subsequent requests."""
|
|
1388
|
-
|
|
1389
1418
|
function_call: Optional[FunctionCallDict]
|
|
1390
1419
|
"""A predicted [FunctionCall] returned from the model that contains a string
|
|
1391
1420
|
representing the [FunctionDeclaration.name] and a structured JSON object
|
|
@@ -1397,12 +1426,27 @@ class PartDict(TypedDict, total=False):
|
|
|
1397
1426
|
executable_code: Optional[ExecutableCodeDict]
|
|
1398
1427
|
"""Optional. Code generated by the model that is meant to be executed."""
|
|
1399
1428
|
|
|
1429
|
+
file_data: Optional[FileDataDict]
|
|
1430
|
+
"""Optional. URI based data."""
|
|
1431
|
+
|
|
1400
1432
|
function_response: Optional[FunctionResponseDict]
|
|
1401
1433
|
"""Optional. The result output of a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function call. It is used as context to the model."""
|
|
1402
1434
|
|
|
1435
|
+
inline_data: Optional[BlobDict]
|
|
1436
|
+
"""Optional. Inlined bytes data."""
|
|
1437
|
+
|
|
1403
1438
|
text: Optional[str]
|
|
1404
1439
|
"""Optional. Text part (can be code)."""
|
|
1405
1440
|
|
|
1441
|
+
thought: Optional[bool]
|
|
1442
|
+
"""Optional. Indicates if the part is thought from the model."""
|
|
1443
|
+
|
|
1444
|
+
thought_signature: Optional[bytes]
|
|
1445
|
+
"""Optional. An opaque signature for the thought so it can be reused in subsequent requests."""
|
|
1446
|
+
|
|
1447
|
+
video_metadata: Optional[VideoMetadataDict]
|
|
1448
|
+
"""Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data."""
|
|
1449
|
+
|
|
1406
1450
|
|
|
1407
1451
|
PartOrDict = Union[Part, PartDict]
|
|
1408
1452
|
|
|
@@ -1417,9 +1461,7 @@ class Content(_common.BaseModel):
|
|
|
1417
1461
|
)
|
|
1418
1462
|
role: Optional[str] = Field(
|
|
1419
1463
|
default=None,
|
|
1420
|
-
description="""Optional. The producer of the content. Must be either 'user' or
|
|
1421
|
-
'model'. Useful to set for multi-turn conversations, otherwise can be
|
|
1422
|
-
empty. If role is not specified, SDK will determine the role.""",
|
|
1464
|
+
description="""Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset.""",
|
|
1423
1465
|
)
|
|
1424
1466
|
|
|
1425
1467
|
|
|
@@ -1431,9 +1473,7 @@ class ContentDict(TypedDict, total=False):
|
|
|
1431
1473
|
a different IANA MIME type."""
|
|
1432
1474
|
|
|
1433
1475
|
role: Optional[str]
|
|
1434
|
-
"""Optional. The producer of the content. Must be either 'user' or
|
|
1435
|
-
'model'. Useful to set for multi-turn conversations, otherwise can be
|
|
1436
|
-
empty. If role is not specified, SDK will determine the role."""
|
|
1476
|
+
"""Optional. The producer of the content. Must be either 'user' or 'model'. Useful to set for multi-turn conversations, otherwise can be left blank or unset."""
|
|
1437
1477
|
|
|
1438
1478
|
|
|
1439
1479
|
ContentOrDict = Union[Content, ContentDict]
|
|
@@ -1445,27 +1485,28 @@ class HttpRetryOptions(_common.BaseModel):
|
|
|
1445
1485
|
attempts: Optional[int] = Field(
|
|
1446
1486
|
default=None,
|
|
1447
1487
|
description="""Maximum number of attempts, including the original request.
|
|
1448
|
-
If 0 or 1, it means no retries.""",
|
|
1488
|
+
If 0 or 1, it means no retries. If not specified, default to 5.""",
|
|
1449
1489
|
)
|
|
1450
1490
|
initial_delay: Optional[float] = Field(
|
|
1451
1491
|
default=None,
|
|
1452
|
-
description="""Initial delay before the first retry, in fractions of a second.""",
|
|
1492
|
+
description="""Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second.""",
|
|
1453
1493
|
)
|
|
1454
1494
|
max_delay: Optional[float] = Field(
|
|
1455
1495
|
default=None,
|
|
1456
|
-
description="""Maximum delay between retries, in fractions of a second.""",
|
|
1496
|
+
description="""Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds.""",
|
|
1457
1497
|
)
|
|
1458
1498
|
exp_base: Optional[float] = Field(
|
|
1459
1499
|
default=None,
|
|
1460
|
-
description="""Multiplier by which the delay increases after each attempt.""",
|
|
1500
|
+
description="""Multiplier by which the delay increases after each attempt. If not specified, default to 2.0.""",
|
|
1461
1501
|
)
|
|
1462
1502
|
jitter: Optional[float] = Field(
|
|
1463
|
-
default=None,
|
|
1503
|
+
default=None,
|
|
1504
|
+
description="""Randomness factor for the delay. If not specified, default to 1.0.""",
|
|
1464
1505
|
)
|
|
1465
1506
|
http_status_codes: Optional[list[int]] = Field(
|
|
1466
1507
|
default=None,
|
|
1467
1508
|
description="""List of HTTP status codes that should trigger a retry.
|
|
1468
|
-
If not specified, a default set of retryable codes may be used.""",
|
|
1509
|
+
If not specified, a default set of retryable codes (408, 429, and 5xx) may be used.""",
|
|
1469
1510
|
)
|
|
1470
1511
|
|
|
1471
1512
|
|
|
@@ -1474,23 +1515,23 @@ class HttpRetryOptionsDict(TypedDict, total=False):
|
|
|
1474
1515
|
|
|
1475
1516
|
attempts: Optional[int]
|
|
1476
1517
|
"""Maximum number of attempts, including the original request.
|
|
1477
|
-
If 0 or 1, it means no retries."""
|
|
1518
|
+
If 0 or 1, it means no retries. If not specified, default to 5."""
|
|
1478
1519
|
|
|
1479
1520
|
initial_delay: Optional[float]
|
|
1480
|
-
"""Initial delay before the first retry, in fractions of a second."""
|
|
1521
|
+
"""Initial delay before the first retry, in fractions of a second. If not specified, default to 1.0 second."""
|
|
1481
1522
|
|
|
1482
1523
|
max_delay: Optional[float]
|
|
1483
|
-
"""Maximum delay between retries, in fractions of a second."""
|
|
1524
|
+
"""Maximum delay between retries, in fractions of a second. If not specified, default to 60.0 seconds."""
|
|
1484
1525
|
|
|
1485
1526
|
exp_base: Optional[float]
|
|
1486
|
-
"""Multiplier by which the delay increases after each attempt."""
|
|
1527
|
+
"""Multiplier by which the delay increases after each attempt. If not specified, default to 2.0."""
|
|
1487
1528
|
|
|
1488
1529
|
jitter: Optional[float]
|
|
1489
|
-
"""Randomness factor for the delay."""
|
|
1530
|
+
"""Randomness factor for the delay. If not specified, default to 1.0."""
|
|
1490
1531
|
|
|
1491
1532
|
http_status_codes: Optional[list[int]]
|
|
1492
1533
|
"""List of HTTP status codes that should trigger a retry.
|
|
1493
|
-
If not specified, a default set of retryable codes may be used."""
|
|
1534
|
+
If not specified, a default set of retryable codes (408, 429, and 5xx) may be used."""
|
|
1494
1535
|
|
|
1495
1536
|
|
|
1496
1537
|
HttpRetryOptionsOrDict = Union[HttpRetryOptions, HttpRetryOptionsDict]
|
|
@@ -1530,6 +1571,15 @@ class HttpOptions(_common.BaseModel):
|
|
|
1530
1571
|
default=None, description="""HTTP retry options for the request."""
|
|
1531
1572
|
)
|
|
1532
1573
|
|
|
1574
|
+
httpx_client: Optional['HttpxClient'] = Field(
|
|
1575
|
+
default=None,
|
|
1576
|
+
description="""A custom httpx client to be used for the request.""",
|
|
1577
|
+
)
|
|
1578
|
+
httpx_async_client: Optional['HttpxAsyncClient'] = Field(
|
|
1579
|
+
default=None,
|
|
1580
|
+
description="""A custom httpx async client to be used for the request.""",
|
|
1581
|
+
)
|
|
1582
|
+
|
|
1533
1583
|
|
|
1534
1584
|
class HttpOptionsDict(TypedDict, total=False):
|
|
1535
1585
|
"""HTTP options to be used in each of the requests."""
|
|
@@ -2160,7 +2210,7 @@ class Schema(_common.BaseModel):
|
|
|
2160
2210
|
for this_field_value in field_value
|
|
2161
2211
|
]
|
|
2162
2212
|
setattr(schema, field_name, list_schema_field_value)
|
|
2163
|
-
if not schema.type and not is_union_like_type:
|
|
2213
|
+
if not schema.type and not is_union_like_type and not schema.any_of:
|
|
2164
2214
|
schema.type = Type('OBJECT')
|
|
2165
2215
|
elif field_name in dict_schema_field_names:
|
|
2166
2216
|
dict_schema_field_value: dict[str, 'Schema'] = {
|
|
@@ -2332,39 +2382,6 @@ ModelSelectionConfigOrDict = Union[
|
|
|
2332
2382
|
]
|
|
2333
2383
|
|
|
2334
2384
|
|
|
2335
|
-
class SafetySetting(_common.BaseModel):
|
|
2336
|
-
"""Safety settings."""
|
|
2337
|
-
|
|
2338
|
-
method: Optional[HarmBlockMethod] = Field(
|
|
2339
|
-
default=None,
|
|
2340
|
-
description="""Determines if the harm block method uses probability or probability
|
|
2341
|
-
and severity scores.""",
|
|
2342
|
-
)
|
|
2343
|
-
category: Optional[HarmCategory] = Field(
|
|
2344
|
-
default=None, description="""Required. Harm category."""
|
|
2345
|
-
)
|
|
2346
|
-
threshold: Optional[HarmBlockThreshold] = Field(
|
|
2347
|
-
default=None, description="""Required. The harm block threshold."""
|
|
2348
|
-
)
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
class SafetySettingDict(TypedDict, total=False):
|
|
2352
|
-
"""Safety settings."""
|
|
2353
|
-
|
|
2354
|
-
method: Optional[HarmBlockMethod]
|
|
2355
|
-
"""Determines if the harm block method uses probability or probability
|
|
2356
|
-
and severity scores."""
|
|
2357
|
-
|
|
2358
|
-
category: Optional[HarmCategory]
|
|
2359
|
-
"""Required. Harm category."""
|
|
2360
|
-
|
|
2361
|
-
threshold: Optional[HarmBlockThreshold]
|
|
2362
|
-
"""Required. The harm block threshold."""
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
SafetySettingOrDict = Union[SafetySetting, SafetySettingDict]
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
2385
|
class FunctionDeclaration(_common.BaseModel):
|
|
2369
2386
|
"""Defines a function that the model can generate JSON inputs for.
|
|
2370
2387
|
|
|
@@ -2625,74 +2642,6 @@ class FunctionDeclarationDict(TypedDict, total=False):
|
|
|
2625
2642
|
FunctionDeclarationOrDict = Union[FunctionDeclaration, FunctionDeclarationDict]
|
|
2626
2643
|
|
|
2627
2644
|
|
|
2628
|
-
class Interval(_common.BaseModel):
|
|
2629
|
-
"""Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
|
|
2630
|
-
|
|
2631
|
-
The start time must be less than or equal to the end time.
|
|
2632
|
-
When the start equals the end time, the interval is an empty interval.
|
|
2633
|
-
(matches no time)
|
|
2634
|
-
When both start and end are unspecified, the interval matches any time.
|
|
2635
|
-
"""
|
|
2636
|
-
|
|
2637
|
-
start_time: Optional[datetime.datetime] = Field(
|
|
2638
|
-
default=None, description="""The start time of the interval."""
|
|
2639
|
-
)
|
|
2640
|
-
end_time: Optional[datetime.datetime] = Field(
|
|
2641
|
-
default=None, description="""The end time of the interval."""
|
|
2642
|
-
)
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
class IntervalDict(TypedDict, total=False):
|
|
2646
|
-
"""Represents a time interval, encoded as a start time (inclusive) and an end time (exclusive).
|
|
2647
|
-
|
|
2648
|
-
The start time must be less than or equal to the end time.
|
|
2649
|
-
When the start equals the end time, the interval is an empty interval.
|
|
2650
|
-
(matches no time)
|
|
2651
|
-
When both start and end are unspecified, the interval matches any time.
|
|
2652
|
-
"""
|
|
2653
|
-
|
|
2654
|
-
start_time: Optional[datetime.datetime]
|
|
2655
|
-
"""The start time of the interval."""
|
|
2656
|
-
|
|
2657
|
-
end_time: Optional[datetime.datetime]
|
|
2658
|
-
"""The end time of the interval."""
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
IntervalOrDict = Union[Interval, IntervalDict]
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
class GoogleSearch(_common.BaseModel):
|
|
2665
|
-
"""Tool to support Google Search in Model. Powered by Google."""
|
|
2666
|
-
|
|
2667
|
-
time_range_filter: Optional[Interval] = Field(
|
|
2668
|
-
default=None,
|
|
2669
|
-
description="""Optional. Filter search results to a specific time range.
|
|
2670
|
-
If customers set a start time, they must set an end time (and vice versa).
|
|
2671
|
-
""",
|
|
2672
|
-
)
|
|
2673
|
-
exclude_domains: Optional[list[str]] = Field(
|
|
2674
|
-
default=None,
|
|
2675
|
-
description="""Optional. List of domains to be excluded from the search results.
|
|
2676
|
-
The default limit is 2000 domains.""",
|
|
2677
|
-
)
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
class GoogleSearchDict(TypedDict, total=False):
|
|
2681
|
-
"""Tool to support Google Search in Model. Powered by Google."""
|
|
2682
|
-
|
|
2683
|
-
time_range_filter: Optional[IntervalDict]
|
|
2684
|
-
"""Optional. Filter search results to a specific time range.
|
|
2685
|
-
If customers set a start time, they must set an end time (and vice versa).
|
|
2686
|
-
"""
|
|
2687
|
-
|
|
2688
|
-
exclude_domains: Optional[list[str]]
|
|
2689
|
-
"""Optional. List of domains to be excluded from the search results.
|
|
2690
|
-
The default limit is 2000 domains."""
|
|
2691
|
-
|
|
2692
|
-
|
|
2693
|
-
GoogleSearchOrDict = Union[GoogleSearch, GoogleSearchDict]
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
2645
|
class DynamicRetrievalConfig(_common.BaseModel):
|
|
2697
2646
|
"""Describes the options to customize dynamic retrieval."""
|
|
2698
2647
|
|
|
@@ -2742,25 +2691,6 @@ GoogleSearchRetrievalOrDict = Union[
|
|
|
2742
2691
|
]
|
|
2743
2692
|
|
|
2744
2693
|
|
|
2745
|
-
class EnterpriseWebSearch(_common.BaseModel):
|
|
2746
|
-
"""Tool to search public web data, powered by Vertex AI Search and Sec4 compliance."""
|
|
2747
|
-
|
|
2748
|
-
exclude_domains: Optional[list[str]] = Field(
|
|
2749
|
-
default=None,
|
|
2750
|
-
description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.""",
|
|
2751
|
-
)
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
class EnterpriseWebSearchDict(TypedDict, total=False):
|
|
2755
|
-
"""Tool to search public web data, powered by Vertex AI Search and Sec4 compliance."""
|
|
2756
|
-
|
|
2757
|
-
exclude_domains: Optional[list[str]]
|
|
2758
|
-
"""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains."""
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
2694
|
class ApiKeyConfig(_common.BaseModel):
|
|
2765
2695
|
"""Config for authentication with API key."""
|
|
2766
2696
|
|
|
@@ -2781,7 +2711,10 @@ ApiKeyConfigOrDict = Union[ApiKeyConfig, ApiKeyConfigDict]
|
|
|
2781
2711
|
|
|
2782
2712
|
|
|
2783
2713
|
class AuthConfigGoogleServiceAccountConfig(_common.BaseModel):
|
|
2784
|
-
"""Config for Google Service Account Authentication.
|
|
2714
|
+
"""Config for Google Service Account Authentication.
|
|
2715
|
+
|
|
2716
|
+
This data type is not supported in Gemini API.
|
|
2717
|
+
"""
|
|
2785
2718
|
|
|
2786
2719
|
service_account: Optional[str] = Field(
|
|
2787
2720
|
default=None,
|
|
@@ -2790,7 +2723,10 @@ class AuthConfigGoogleServiceAccountConfig(_common.BaseModel):
|
|
|
2790
2723
|
|
|
2791
2724
|
|
|
2792
2725
|
class AuthConfigGoogleServiceAccountConfigDict(TypedDict, total=False):
|
|
2793
|
-
"""Config for Google Service Account Authentication.
|
|
2726
|
+
"""Config for Google Service Account Authentication.
|
|
2727
|
+
|
|
2728
|
+
This data type is not supported in Gemini API.
|
|
2729
|
+
"""
|
|
2794
2730
|
|
|
2795
2731
|
service_account: Optional[str]
|
|
2796
2732
|
"""Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension."""
|
|
@@ -2803,7 +2739,10 @@ AuthConfigGoogleServiceAccountConfigOrDict = Union[
|
|
|
2803
2739
|
|
|
2804
2740
|
|
|
2805
2741
|
class AuthConfigHttpBasicAuthConfig(_common.BaseModel):
|
|
2806
|
-
"""Config for HTTP Basic Authentication.
|
|
2742
|
+
"""Config for HTTP Basic Authentication.
|
|
2743
|
+
|
|
2744
|
+
This data type is not supported in Gemini API.
|
|
2745
|
+
"""
|
|
2807
2746
|
|
|
2808
2747
|
credential_secret: Optional[str] = Field(
|
|
2809
2748
|
default=None,
|
|
@@ -2812,7 +2751,10 @@ class AuthConfigHttpBasicAuthConfig(_common.BaseModel):
|
|
|
2812
2751
|
|
|
2813
2752
|
|
|
2814
2753
|
class AuthConfigHttpBasicAuthConfigDict(TypedDict, total=False):
|
|
2815
|
-
"""Config for HTTP Basic Authentication.
|
|
2754
|
+
"""Config for HTTP Basic Authentication.
|
|
2755
|
+
|
|
2756
|
+
This data type is not supported in Gemini API.
|
|
2757
|
+
"""
|
|
2816
2758
|
|
|
2817
2759
|
credential_secret: Optional[str]
|
|
2818
2760
|
"""Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource."""
|
|
@@ -2824,7 +2766,7 @@ AuthConfigHttpBasicAuthConfigOrDict = Union[
|
|
|
2824
2766
|
|
|
2825
2767
|
|
|
2826
2768
|
class AuthConfigOauthConfig(_common.BaseModel):
|
|
2827
|
-
"""Config for user oauth."""
|
|
2769
|
+
"""Config for user oauth. This data type is not supported in Gemini API."""
|
|
2828
2770
|
|
|
2829
2771
|
access_token: Optional[str] = Field(
|
|
2830
2772
|
default=None,
|
|
@@ -2837,7 +2779,7 @@ class AuthConfigOauthConfig(_common.BaseModel):
|
|
|
2837
2779
|
|
|
2838
2780
|
|
|
2839
2781
|
class AuthConfigOauthConfigDict(TypedDict, total=False):
|
|
2840
|
-
"""Config for user oauth."""
|
|
2782
|
+
"""Config for user oauth. This data type is not supported in Gemini API."""
|
|
2841
2783
|
|
|
2842
2784
|
access_token: Optional[str]
|
|
2843
2785
|
"""Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time."""
|
|
@@ -2852,7 +2794,10 @@ AuthConfigOauthConfigOrDict = Union[
|
|
|
2852
2794
|
|
|
2853
2795
|
|
|
2854
2796
|
class AuthConfigOidcConfig(_common.BaseModel):
|
|
2855
|
-
"""Config for user OIDC auth.
|
|
2797
|
+
"""Config for user OIDC auth.
|
|
2798
|
+
|
|
2799
|
+
This data type is not supported in Gemini API.
|
|
2800
|
+
"""
|
|
2856
2801
|
|
|
2857
2802
|
id_token: Optional[str] = Field(
|
|
2858
2803
|
default=None,
|
|
@@ -2865,7 +2810,10 @@ class AuthConfigOidcConfig(_common.BaseModel):
|
|
|
2865
2810
|
|
|
2866
2811
|
|
|
2867
2812
|
class AuthConfigOidcConfigDict(TypedDict, total=False):
|
|
2868
|
-
"""Config for user OIDC auth.
|
|
2813
|
+
"""Config for user OIDC auth.
|
|
2814
|
+
|
|
2815
|
+
This data type is not supported in Gemini API.
|
|
2816
|
+
"""
|
|
2869
2817
|
|
|
2870
2818
|
id_token: Optional[str]
|
|
2871
2819
|
"""OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time."""
|
|
@@ -2948,28 +2896,13 @@ class GoogleMapsDict(TypedDict, total=False):
|
|
|
2948
2896
|
"""Tool to support Google Maps in Model."""
|
|
2949
2897
|
|
|
2950
2898
|
auth_config: Optional[AuthConfigDict]
|
|
2951
|
-
"""Optional. Auth config for the Google Maps tool."""
|
|
2952
|
-
|
|
2953
|
-
enable_widget: Optional[bool]
|
|
2954
|
-
"""Optional. If true, include the widget context token in the response."""
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
class UrlContext(_common.BaseModel):
|
|
2961
|
-
"""Tool to support URL context retrieval."""
|
|
2962
|
-
|
|
2963
|
-
pass
|
|
2964
|
-
|
|
2965
|
-
|
|
2966
|
-
class UrlContextDict(TypedDict, total=False):
|
|
2967
|
-
"""Tool to support URL context retrieval."""
|
|
2899
|
+
"""Optional. Auth config for the Google Maps tool."""
|
|
2968
2900
|
|
|
2969
|
-
|
|
2901
|
+
enable_widget: Optional[bool]
|
|
2902
|
+
"""Optional. If true, include the widget context token in the response."""
|
|
2970
2903
|
|
|
2971
2904
|
|
|
2972
|
-
|
|
2905
|
+
GoogleMapsOrDict = Union[GoogleMaps, GoogleMapsDict]
|
|
2973
2906
|
|
|
2974
2907
|
|
|
2975
2908
|
class ComputerUse(_common.BaseModel):
|
|
@@ -3006,7 +2939,7 @@ ComputerUseOrDict = Union[ComputerUse, ComputerUseDict]
|
|
|
3006
2939
|
|
|
3007
2940
|
|
|
3008
2941
|
class ApiAuthApiKeyConfig(_common.BaseModel):
|
|
3009
|
-
"""The API secret."""
|
|
2942
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
3010
2943
|
|
|
3011
2944
|
api_key_secret_version: Optional[str] = Field(
|
|
3012
2945
|
default=None,
|
|
@@ -3019,7 +2952,7 @@ class ApiAuthApiKeyConfig(_common.BaseModel):
|
|
|
3019
2952
|
|
|
3020
2953
|
|
|
3021
2954
|
class ApiAuthApiKeyConfigDict(TypedDict, total=False):
|
|
3022
|
-
"""The API secret."""
|
|
2955
|
+
"""The API secret. This data type is not supported in Gemini API."""
|
|
3023
2956
|
|
|
3024
2957
|
api_key_secret_version: Optional[str]
|
|
3025
2958
|
"""Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}"""
|
|
@@ -3035,7 +2968,7 @@ class ApiAuth(_common.BaseModel):
|
|
|
3035
2968
|
"""The generic reusable api auth config.
|
|
3036
2969
|
|
|
3037
2970
|
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
3038
|
-
instead.
|
|
2971
|
+
instead. This data type is not supported in Gemini API.
|
|
3039
2972
|
"""
|
|
3040
2973
|
|
|
3041
2974
|
api_key_config: Optional[ApiAuthApiKeyConfig] = Field(
|
|
@@ -3047,7 +2980,7 @@ class ApiAuthDict(TypedDict, total=False):
|
|
|
3047
2980
|
"""The generic reusable api auth config.
|
|
3048
2981
|
|
|
3049
2982
|
Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto)
|
|
3050
|
-
instead.
|
|
2983
|
+
instead. This data type is not supported in Gemini API.
|
|
3051
2984
|
"""
|
|
3052
2985
|
|
|
3053
2986
|
api_key_config: Optional[ApiAuthApiKeyConfigDict]
|
|
@@ -3058,7 +2991,10 @@ ApiAuthOrDict = Union[ApiAuth, ApiAuthDict]
|
|
|
3058
2991
|
|
|
3059
2992
|
|
|
3060
2993
|
class ExternalApiElasticSearchParams(_common.BaseModel):
|
|
3061
|
-
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
2994
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
2995
|
+
|
|
2996
|
+
This data type is not supported in Gemini API.
|
|
2997
|
+
"""
|
|
3062
2998
|
|
|
3063
2999
|
index: Optional[str] = Field(
|
|
3064
3000
|
default=None, description="""The ElasticSearch index to use."""
|
|
@@ -3073,7 +3009,10 @@ class ExternalApiElasticSearchParams(_common.BaseModel):
|
|
|
3073
3009
|
|
|
3074
3010
|
|
|
3075
3011
|
class ExternalApiElasticSearchParamsDict(TypedDict, total=False):
|
|
3076
|
-
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
3012
|
+
"""The search parameters to use for the ELASTIC_SEARCH spec.
|
|
3013
|
+
|
|
3014
|
+
This data type is not supported in Gemini API.
|
|
3015
|
+
"""
|
|
3077
3016
|
|
|
3078
3017
|
index: Optional[str]
|
|
3079
3018
|
"""The ElasticSearch index to use."""
|
|
@@ -3091,13 +3030,19 @@ ExternalApiElasticSearchParamsOrDict = Union[
|
|
|
3091
3030
|
|
|
3092
3031
|
|
|
3093
3032
|
class ExternalApiSimpleSearchParams(_common.BaseModel):
|
|
3094
|
-
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3033
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3034
|
+
|
|
3035
|
+
This data type is not supported in Gemini API.
|
|
3036
|
+
"""
|
|
3095
3037
|
|
|
3096
3038
|
pass
|
|
3097
3039
|
|
|
3098
3040
|
|
|
3099
3041
|
class ExternalApiSimpleSearchParamsDict(TypedDict, total=False):
|
|
3100
|
-
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3042
|
+
"""The search parameters to use for SIMPLE_SEARCH spec.
|
|
3043
|
+
|
|
3044
|
+
This data type is not supported in Gemini API.
|
|
3045
|
+
"""
|
|
3101
3046
|
|
|
3102
3047
|
pass
|
|
3103
3048
|
|
|
@@ -3111,7 +3056,7 @@ class ExternalApi(_common.BaseModel):
|
|
|
3111
3056
|
"""Retrieve from data source powered by external API for grounding.
|
|
3112
3057
|
|
|
3113
3058
|
The external API is not owned by Google, but need to follow the pre-defined
|
|
3114
|
-
API spec.
|
|
3059
|
+
API spec. This data type is not supported in Gemini API.
|
|
3115
3060
|
"""
|
|
3116
3061
|
|
|
3117
3062
|
api_auth: Optional[ApiAuth] = Field(
|
|
@@ -3142,7 +3087,7 @@ class ExternalApiDict(TypedDict, total=False):
|
|
|
3142
3087
|
"""Retrieve from data source powered by external API for grounding.
|
|
3143
3088
|
|
|
3144
3089
|
The external API is not owned by Google, but need to follow the pre-defined
|
|
3145
|
-
API spec.
|
|
3090
|
+
API spec. This data type is not supported in Gemini API.
|
|
3146
3091
|
"""
|
|
3147
3092
|
|
|
3148
3093
|
api_auth: Optional[ApiAuthDict]
|
|
@@ -3171,7 +3116,8 @@ class VertexAISearchDataStoreSpec(_common.BaseModel):
|
|
|
3171
3116
|
"""Define data stores within engine to filter on in a search call and configurations for those data stores.
|
|
3172
3117
|
|
|
3173
3118
|
For more information, see
|
|
3174
|
-
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
|
|
3119
|
+
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec.
|
|
3120
|
+
This data type is not supported in Gemini API.
|
|
3175
3121
|
"""
|
|
3176
3122
|
|
|
3177
3123
|
data_store: Optional[str] = Field(
|
|
@@ -3188,7 +3134,8 @@ class VertexAISearchDataStoreSpecDict(TypedDict, total=False):
|
|
|
3188
3134
|
"""Define data stores within engine to filter on in a search call and configurations for those data stores.
|
|
3189
3135
|
|
|
3190
3136
|
For more information, see
|
|
3191
|
-
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
|
|
3137
|
+
https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec.
|
|
3138
|
+
This data type is not supported in Gemini API.
|
|
3192
3139
|
"""
|
|
3193
3140
|
|
|
3194
3141
|
data_store: Optional[str]
|
|
@@ -3207,7 +3154,8 @@ class VertexAISearch(_common.BaseModel):
|
|
|
3207
3154
|
"""Retrieve from Vertex AI Search datastore or engine for grounding.
|
|
3208
3155
|
|
|
3209
3156
|
datastore and engine are mutually exclusive. See
|
|
3210
|
-
https://cloud.google.com/products/agent-builder
|
|
3157
|
+
https://cloud.google.com/products/agent-builder. This data type is not
|
|
3158
|
+
supported in Gemini API.
|
|
3211
3159
|
"""
|
|
3212
3160
|
|
|
3213
3161
|
data_store_specs: Optional[list[VertexAISearchDataStoreSpec]] = Field(
|
|
@@ -3236,7 +3184,8 @@ class VertexAISearchDict(TypedDict, total=False):
|
|
|
3236
3184
|
"""Retrieve from Vertex AI Search datastore or engine for grounding.
|
|
3237
3185
|
|
|
3238
3186
|
datastore and engine are mutually exclusive. See
|
|
3239
|
-
https://cloud.google.com/products/agent-builder
|
|
3187
|
+
https://cloud.google.com/products/agent-builder. This data type is not
|
|
3188
|
+
supported in Gemini API.
|
|
3240
3189
|
"""
|
|
3241
3190
|
|
|
3242
3191
|
data_store_specs: Optional[list[VertexAISearchDataStoreSpecDict]]
|
|
@@ -3259,7 +3208,10 @@ VertexAISearchOrDict = Union[VertexAISearch, VertexAISearchDict]
|
|
|
3259
3208
|
|
|
3260
3209
|
|
|
3261
3210
|
class VertexRagStoreRagResource(_common.BaseModel):
|
|
3262
|
-
"""The definition of the Rag resource.
|
|
3211
|
+
"""The definition of the Rag resource.
|
|
3212
|
+
|
|
3213
|
+
This data type is not supported in Gemini API.
|
|
3214
|
+
"""
|
|
3263
3215
|
|
|
3264
3216
|
rag_corpus: Optional[str] = Field(
|
|
3265
3217
|
default=None,
|
|
@@ -3272,7 +3224,10 @@ class VertexRagStoreRagResource(_common.BaseModel):
|
|
|
3272
3224
|
|
|
3273
3225
|
|
|
3274
3226
|
class VertexRagStoreRagResourceDict(TypedDict, total=False):
|
|
3275
|
-
"""The definition of the Rag resource.
|
|
3227
|
+
"""The definition of the Rag resource.
|
|
3228
|
+
|
|
3229
|
+
This data type is not supported in Gemini API.
|
|
3230
|
+
"""
|
|
3276
3231
|
|
|
3277
3232
|
rag_corpus: Optional[str]
|
|
3278
3233
|
"""Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`"""
|
|
@@ -3287,7 +3242,7 @@ VertexRagStoreRagResourceOrDict = Union[
|
|
|
3287
3242
|
|
|
3288
3243
|
|
|
3289
3244
|
class RagRetrievalConfigFilter(_common.BaseModel):
|
|
3290
|
-
"""Config for filters."""
|
|
3245
|
+
"""Config for filters. This data type is not supported in Gemini API."""
|
|
3291
3246
|
|
|
3292
3247
|
metadata_filter: Optional[str] = Field(
|
|
3293
3248
|
default=None, description="""Optional. String for metadata filtering."""
|
|
@@ -3303,7 +3258,7 @@ class RagRetrievalConfigFilter(_common.BaseModel):
|
|
|
3303
3258
|
|
|
3304
3259
|
|
|
3305
3260
|
class RagRetrievalConfigFilterDict(TypedDict, total=False):
|
|
3306
|
-
"""Config for filters."""
|
|
3261
|
+
"""Config for filters. This data type is not supported in Gemini API."""
|
|
3307
3262
|
|
|
3308
3263
|
metadata_filter: Optional[str]
|
|
3309
3264
|
"""Optional. String for metadata filtering."""
|
|
@@ -3321,7 +3276,7 @@ RagRetrievalConfigFilterOrDict = Union[
|
|
|
3321
3276
|
|
|
3322
3277
|
|
|
3323
3278
|
class RagRetrievalConfigHybridSearch(_common.BaseModel):
|
|
3324
|
-
"""Config for Hybrid Search."""
|
|
3279
|
+
"""Config for Hybrid Search. This data type is not supported in Gemini API."""
|
|
3325
3280
|
|
|
3326
3281
|
alpha: Optional[float] = Field(
|
|
3327
3282
|
default=None,
|
|
@@ -3330,7 +3285,7 @@ class RagRetrievalConfigHybridSearch(_common.BaseModel):
|
|
|
3330
3285
|
|
|
3331
3286
|
|
|
3332
3287
|
class RagRetrievalConfigHybridSearchDict(TypedDict, total=False):
|
|
3333
|
-
"""Config for Hybrid Search."""
|
|
3288
|
+
"""Config for Hybrid Search. This data type is not supported in Gemini API."""
|
|
3334
3289
|
|
|
3335
3290
|
alpha: Optional[float]
|
|
3336
3291
|
"""Optional. Alpha value controls the weight between dense and sparse vector search results. The range is [0, 1], while 0 means sparse vector search only and 1 means dense vector search only. The default value is 0.5 which balances sparse and dense vector search equally."""
|
|
@@ -3342,7 +3297,7 @@ RagRetrievalConfigHybridSearchOrDict = Union[
|
|
|
3342
3297
|
|
|
3343
3298
|
|
|
3344
3299
|
class RagRetrievalConfigRankingLlmRanker(_common.BaseModel):
|
|
3345
|
-
"""Config for LlmRanker."""
|
|
3300
|
+
"""Config for LlmRanker. This data type is not supported in Gemini API."""
|
|
3346
3301
|
|
|
3347
3302
|
model_name: Optional[str] = Field(
|
|
3348
3303
|
default=None,
|
|
@@ -3351,7 +3306,7 @@ class RagRetrievalConfigRankingLlmRanker(_common.BaseModel):
|
|
|
3351
3306
|
|
|
3352
3307
|
|
|
3353
3308
|
class RagRetrievalConfigRankingLlmRankerDict(TypedDict, total=False):
|
|
3354
|
-
"""Config for LlmRanker."""
|
|
3309
|
+
"""Config for LlmRanker. This data type is not supported in Gemini API."""
|
|
3355
3310
|
|
|
3356
3311
|
model_name: Optional[str]
|
|
3357
3312
|
"""Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models)."""
|
|
@@ -3363,7 +3318,7 @@ RagRetrievalConfigRankingLlmRankerOrDict = Union[
|
|
|
3363
3318
|
|
|
3364
3319
|
|
|
3365
3320
|
class RagRetrievalConfigRankingRankService(_common.BaseModel):
|
|
3366
|
-
"""Config for Rank Service."""
|
|
3321
|
+
"""Config for Rank Service. This data type is not supported in Gemini API."""
|
|
3367
3322
|
|
|
3368
3323
|
model_name: Optional[str] = Field(
|
|
3369
3324
|
default=None,
|
|
@@ -3372,7 +3327,7 @@ class RagRetrievalConfigRankingRankService(_common.BaseModel):
|
|
|
3372
3327
|
|
|
3373
3328
|
|
|
3374
3329
|
class RagRetrievalConfigRankingRankServiceDict(TypedDict, total=False):
|
|
3375
|
-
"""Config for Rank Service."""
|
|
3330
|
+
"""Config for Rank Service. This data type is not supported in Gemini API."""
|
|
3376
3331
|
|
|
3377
3332
|
model_name: Optional[str]
|
|
3378
3333
|
"""Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`"""
|
|
@@ -3385,7 +3340,10 @@ RagRetrievalConfigRankingRankServiceOrDict = Union[
|
|
|
3385
3340
|
|
|
3386
3341
|
|
|
3387
3342
|
class RagRetrievalConfigRanking(_common.BaseModel):
|
|
3388
|
-
"""Config for ranking and reranking.
|
|
3343
|
+
"""Config for ranking and reranking.
|
|
3344
|
+
|
|
3345
|
+
This data type is not supported in Gemini API.
|
|
3346
|
+
"""
|
|
3389
3347
|
|
|
3390
3348
|
llm_ranker: Optional[RagRetrievalConfigRankingLlmRanker] = Field(
|
|
3391
3349
|
default=None, description="""Optional. Config for LlmRanker."""
|
|
@@ -3396,7 +3354,10 @@ class RagRetrievalConfigRanking(_common.BaseModel):
|
|
|
3396
3354
|
|
|
3397
3355
|
|
|
3398
3356
|
class RagRetrievalConfigRankingDict(TypedDict, total=False):
|
|
3399
|
-
"""Config for ranking and reranking.
|
|
3357
|
+
"""Config for ranking and reranking.
|
|
3358
|
+
|
|
3359
|
+
This data type is not supported in Gemini API.
|
|
3360
|
+
"""
|
|
3400
3361
|
|
|
3401
3362
|
llm_ranker: Optional[RagRetrievalConfigRankingLlmRankerDict]
|
|
3402
3363
|
"""Optional. Config for LlmRanker."""
|
|
@@ -3411,7 +3372,10 @@ RagRetrievalConfigRankingOrDict = Union[
|
|
|
3411
3372
|
|
|
3412
3373
|
|
|
3413
3374
|
class RagRetrievalConfig(_common.BaseModel):
|
|
3414
|
-
"""Specifies the context retrieval config.
|
|
3375
|
+
"""Specifies the context retrieval config.
|
|
3376
|
+
|
|
3377
|
+
This data type is not supported in Gemini API.
|
|
3378
|
+
"""
|
|
3415
3379
|
|
|
3416
3380
|
filter: Optional[RagRetrievalConfigFilter] = Field(
|
|
3417
3381
|
default=None, description="""Optional. Config for filters."""
|
|
@@ -3430,7 +3394,10 @@ class RagRetrievalConfig(_common.BaseModel):
|
|
|
3430
3394
|
|
|
3431
3395
|
|
|
3432
3396
|
class RagRetrievalConfigDict(TypedDict, total=False):
|
|
3433
|
-
"""Specifies the context retrieval config.
|
|
3397
|
+
"""Specifies the context retrieval config.
|
|
3398
|
+
|
|
3399
|
+
This data type is not supported in Gemini API.
|
|
3400
|
+
"""
|
|
3434
3401
|
|
|
3435
3402
|
filter: Optional[RagRetrievalConfigFilterDict]
|
|
3436
3403
|
"""Optional. Config for filters."""
|
|
@@ -3449,7 +3416,10 @@ RagRetrievalConfigOrDict = Union[RagRetrievalConfig, RagRetrievalConfigDict]
|
|
|
3449
3416
|
|
|
3450
3417
|
|
|
3451
3418
|
class VertexRagStore(_common.BaseModel):
|
|
3452
|
-
"""Retrieve from Vertex RAG Store for grounding.
|
|
3419
|
+
"""Retrieve from Vertex RAG Store for grounding.
|
|
3420
|
+
|
|
3421
|
+
This data type is not supported in Gemini API.
|
|
3422
|
+
"""
|
|
3453
3423
|
|
|
3454
3424
|
rag_corpora: Optional[list[str]] = Field(
|
|
3455
3425
|
default=None,
|
|
@@ -3478,7 +3448,10 @@ class VertexRagStore(_common.BaseModel):
|
|
|
3478
3448
|
|
|
3479
3449
|
|
|
3480
3450
|
class VertexRagStoreDict(TypedDict, total=False):
|
|
3481
|
-
"""Retrieve from Vertex RAG Store for grounding.
|
|
3451
|
+
"""Retrieve from Vertex RAG Store for grounding.
|
|
3452
|
+
|
|
3453
|
+
This data type is not supported in Gemini API.
|
|
3454
|
+
"""
|
|
3482
3455
|
|
|
3483
3456
|
rag_corpora: Optional[list[str]]
|
|
3484
3457
|
"""Optional. Deprecated. Please use rag_resources instead."""
|
|
@@ -3503,7 +3476,10 @@ VertexRagStoreOrDict = Union[VertexRagStore, VertexRagStoreDict]
|
|
|
3503
3476
|
|
|
3504
3477
|
|
|
3505
3478
|
class Retrieval(_common.BaseModel):
|
|
3506
|
-
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3479
|
+
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3480
|
+
|
|
3481
|
+
This data type is not supported in Gemini API.
|
|
3482
|
+
"""
|
|
3507
3483
|
|
|
3508
3484
|
disable_attribution: Optional[bool] = Field(
|
|
3509
3485
|
default=None,
|
|
@@ -3524,7 +3500,10 @@ class Retrieval(_common.BaseModel):
|
|
|
3524
3500
|
|
|
3525
3501
|
|
|
3526
3502
|
class RetrievalDict(TypedDict, total=False):
|
|
3527
|
-
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3503
|
+
"""Defines a retrieval tool that model can call to access external knowledge.
|
|
3504
|
+
|
|
3505
|
+
This data type is not supported in Gemini API.
|
|
3506
|
+
"""
|
|
3528
3507
|
|
|
3529
3508
|
disable_attribution: Optional[bool]
|
|
3530
3509
|
"""Optional. Deprecated. This option is no longer supported."""
|
|
@@ -3546,7 +3525,7 @@ class ToolCodeExecution(_common.BaseModel):
|
|
|
3546
3525
|
"""Tool that executes code generated by the model, and automatically returns the result to the model.
|
|
3547
3526
|
|
|
3548
3527
|
See also [ExecutableCode]and [CodeExecutionResult] which are input and output
|
|
3549
|
-
to this tool.
|
|
3528
|
+
to this tool. This data type is not supported in Gemini API.
|
|
3550
3529
|
"""
|
|
3551
3530
|
|
|
3552
3531
|
pass
|
|
@@ -3556,7 +3535,7 @@ class ToolCodeExecutionDict(TypedDict, total=False):
|
|
|
3556
3535
|
"""Tool that executes code generated by the model, and automatically returns the result to the model.
|
|
3557
3536
|
|
|
3558
3537
|
See also [ExecutableCode]and [CodeExecutionResult] which are input and output
|
|
3559
|
-
to this tool.
|
|
3538
|
+
to this tool. This data type is not supported in Gemini API.
|
|
3560
3539
|
"""
|
|
3561
3540
|
|
|
3562
3541
|
pass
|
|
@@ -3565,6 +3544,114 @@ class ToolCodeExecutionDict(TypedDict, total=False):
|
|
|
3565
3544
|
ToolCodeExecutionOrDict = Union[ToolCodeExecution, ToolCodeExecutionDict]
|
|
3566
3545
|
|
|
3567
3546
|
|
|
3547
|
+
class EnterpriseWebSearch(_common.BaseModel):
|
|
3548
|
+
"""Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.
|
|
3549
|
+
|
|
3550
|
+
This data type is not supported in Gemini API.
|
|
3551
|
+
"""
|
|
3552
|
+
|
|
3553
|
+
exclude_domains: Optional[list[str]] = Field(
|
|
3554
|
+
default=None,
|
|
3555
|
+
description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.""",
|
|
3556
|
+
)
|
|
3557
|
+
|
|
3558
|
+
|
|
3559
|
+
class EnterpriseWebSearchDict(TypedDict, total=False):
|
|
3560
|
+
"""Tool to search public web data, powered by Vertex AI Search and Sec4 compliance.
|
|
3561
|
+
|
|
3562
|
+
This data type is not supported in Gemini API.
|
|
3563
|
+
"""
|
|
3564
|
+
|
|
3565
|
+
exclude_domains: Optional[list[str]]
|
|
3566
|
+
"""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains."""
|
|
3567
|
+
|
|
3568
|
+
|
|
3569
|
+
EnterpriseWebSearchOrDict = Union[EnterpriseWebSearch, EnterpriseWebSearchDict]
|
|
3570
|
+
|
|
3571
|
+
|
|
3572
|
+
class Interval(_common.BaseModel):
|
|
3573
|
+
"""Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
|
|
3574
|
+
|
|
3575
|
+
The start must be less than or equal to the end. When the start equals the
|
|
3576
|
+
end, the interval is empty (matches no time). When both start and end are
|
|
3577
|
+
unspecified, the interval matches any time.
|
|
3578
|
+
"""
|
|
3579
|
+
|
|
3580
|
+
end_time: Optional[datetime.datetime] = Field(
|
|
3581
|
+
default=None,
|
|
3582
|
+
description="""Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end.""",
|
|
3583
|
+
)
|
|
3584
|
+
start_time: Optional[datetime.datetime] = Field(
|
|
3585
|
+
default=None,
|
|
3586
|
+
description="""Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start.""",
|
|
3587
|
+
)
|
|
3588
|
+
|
|
3589
|
+
|
|
3590
|
+
class IntervalDict(TypedDict, total=False):
|
|
3591
|
+
"""Represents a time interval, encoded as a Timestamp start (inclusive) and a Timestamp end (exclusive).
|
|
3592
|
+
|
|
3593
|
+
The start must be less than or equal to the end. When the start equals the
|
|
3594
|
+
end, the interval is empty (matches no time). When both start and end are
|
|
3595
|
+
unspecified, the interval matches any time.
|
|
3596
|
+
"""
|
|
3597
|
+
|
|
3598
|
+
end_time: Optional[datetime.datetime]
|
|
3599
|
+
"""Optional. Exclusive end of the interval. If specified, a Timestamp matching this interval will have to be before the end."""
|
|
3600
|
+
|
|
3601
|
+
start_time: Optional[datetime.datetime]
|
|
3602
|
+
"""Optional. Inclusive start of the interval. If specified, a Timestamp matching this interval will have to be the same or after the start."""
|
|
3603
|
+
|
|
3604
|
+
|
|
3605
|
+
IntervalOrDict = Union[Interval, IntervalDict]
|
|
3606
|
+
|
|
3607
|
+
|
|
3608
|
+
class GoogleSearch(_common.BaseModel):
|
|
3609
|
+
"""GoogleSearch tool type.
|
|
3610
|
+
|
|
3611
|
+
Tool to support Google Search in Model. Powered by Google.
|
|
3612
|
+
"""
|
|
3613
|
+
|
|
3614
|
+
exclude_domains: Optional[list[str]] = Field(
|
|
3615
|
+
default=None,
|
|
3616
|
+
description="""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API.""",
|
|
3617
|
+
)
|
|
3618
|
+
time_range_filter: Optional[Interval] = Field(
|
|
3619
|
+
default=None,
|
|
3620
|
+
description="""Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI.""",
|
|
3621
|
+
)
|
|
3622
|
+
|
|
3623
|
+
|
|
3624
|
+
class GoogleSearchDict(TypedDict, total=False):
|
|
3625
|
+
"""GoogleSearch tool type.
|
|
3626
|
+
|
|
3627
|
+
Tool to support Google Search in Model. Powered by Google.
|
|
3628
|
+
"""
|
|
3629
|
+
|
|
3630
|
+
exclude_domains: Optional[list[str]]
|
|
3631
|
+
"""Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: ["amazon.com", "facebook.com"]. This field is not supported in Gemini API."""
|
|
3632
|
+
|
|
3633
|
+
time_range_filter: Optional[IntervalDict]
|
|
3634
|
+
"""Optional. Filter search results to a specific time range. If customers set a start time, they must set an end time (and vice versa). This field is not supported in Vertex AI."""
|
|
3635
|
+
|
|
3636
|
+
|
|
3637
|
+
GoogleSearchOrDict = Union[GoogleSearch, GoogleSearchDict]
|
|
3638
|
+
|
|
3639
|
+
|
|
3640
|
+
class UrlContext(_common.BaseModel):
|
|
3641
|
+
"""Tool to support URL context."""
|
|
3642
|
+
|
|
3643
|
+
pass
|
|
3644
|
+
|
|
3645
|
+
|
|
3646
|
+
class UrlContextDict(TypedDict, total=False):
|
|
3647
|
+
"""Tool to support URL context."""
|
|
3648
|
+
|
|
3649
|
+
pass
|
|
3650
|
+
|
|
3651
|
+
|
|
3652
|
+
UrlContextOrDict = Union[UrlContext, UrlContextDict]
|
|
3653
|
+
|
|
3654
|
+
|
|
3568
3655
|
class Tool(_common.BaseModel):
|
|
3569
3656
|
"""Tool details of a tool that the model may use to generate a response."""
|
|
3570
3657
|
|
|
@@ -3574,31 +3661,17 @@ class Tool(_common.BaseModel):
|
|
|
3574
3661
|
)
|
|
3575
3662
|
retrieval: Optional[Retrieval] = Field(
|
|
3576
3663
|
default=None,
|
|
3577
|
-
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.""",
|
|
3578
|
-
)
|
|
3579
|
-
google_search: Optional[GoogleSearch] = Field(
|
|
3580
|
-
default=None,
|
|
3581
|
-
description="""Optional. Google Search tool type. Specialized retrieval tool
|
|
3582
|
-
that is powered by Google Search.""",
|
|
3664
|
+
description="""Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API.""",
|
|
3583
3665
|
)
|
|
3584
3666
|
google_search_retrieval: Optional[GoogleSearchRetrieval] = Field(
|
|
3585
3667
|
default=None,
|
|
3586
3668
|
description="""Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search.""",
|
|
3587
3669
|
)
|
|
3588
|
-
enterprise_web_search: Optional[EnterpriseWebSearch] = Field(
|
|
3589
|
-
default=None,
|
|
3590
|
-
description="""Optional. Enterprise web search tool type. Specialized retrieval
|
|
3591
|
-
tool that is powered by Vertex AI Search and Sec4 compliance.""",
|
|
3592
|
-
)
|
|
3593
3670
|
google_maps: Optional[GoogleMaps] = Field(
|
|
3594
3671
|
default=None,
|
|
3595
3672
|
description="""Optional. Google Maps tool type. Specialized retrieval tool
|
|
3596
3673
|
that is powered by Google Maps.""",
|
|
3597
3674
|
)
|
|
3598
|
-
url_context: Optional[UrlContext] = Field(
|
|
3599
|
-
default=None,
|
|
3600
|
-
description="""Optional. Tool to support URL context retrieval.""",
|
|
3601
|
-
)
|
|
3602
3675
|
computer_use: Optional[ComputerUse] = Field(
|
|
3603
3676
|
default=None,
|
|
3604
3677
|
description="""Optional. Tool to support the model interacting directly with the
|
|
@@ -3609,6 +3682,18 @@ class Tool(_common.BaseModel):
|
|
|
3609
3682
|
default=None,
|
|
3610
3683
|
description="""Optional. CodeExecution tool type. Enables the model to execute code as part of generation.""",
|
|
3611
3684
|
)
|
|
3685
|
+
enterprise_web_search: Optional[EnterpriseWebSearch] = Field(
|
|
3686
|
+
default=None,
|
|
3687
|
+
description="""Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API.""",
|
|
3688
|
+
)
|
|
3689
|
+
google_search: Optional[GoogleSearch] = Field(
|
|
3690
|
+
default=None,
|
|
3691
|
+
description="""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.""",
|
|
3692
|
+
)
|
|
3693
|
+
url_context: Optional[UrlContext] = Field(
|
|
3694
|
+
default=None,
|
|
3695
|
+
description="""Optional. Tool to support URL context retrieval.""",
|
|
3696
|
+
)
|
|
3612
3697
|
|
|
3613
3698
|
|
|
3614
3699
|
class ToolDict(TypedDict, total=False):
|
|
@@ -3618,26 +3703,15 @@ class ToolDict(TypedDict, total=False):
|
|
|
3618
3703
|
"""List of function declarations that the tool supports."""
|
|
3619
3704
|
|
|
3620
3705
|
retrieval: Optional[RetrievalDict]
|
|
3621
|
-
"""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."""
|
|
3622
|
-
|
|
3623
|
-
google_search: Optional[GoogleSearchDict]
|
|
3624
|
-
"""Optional. Google Search tool type. Specialized retrieval tool
|
|
3625
|
-
that is powered by Google Search."""
|
|
3706
|
+
"""Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation. This field is not supported in Gemini API."""
|
|
3626
3707
|
|
|
3627
3708
|
google_search_retrieval: Optional[GoogleSearchRetrievalDict]
|
|
3628
3709
|
"""Optional. GoogleSearchRetrieval tool type. Specialized retrieval tool that is powered by Google search."""
|
|
3629
3710
|
|
|
3630
|
-
enterprise_web_search: Optional[EnterpriseWebSearchDict]
|
|
3631
|
-
"""Optional. Enterprise web search tool type. Specialized retrieval
|
|
3632
|
-
tool that is powered by Vertex AI Search and Sec4 compliance."""
|
|
3633
|
-
|
|
3634
3711
|
google_maps: Optional[GoogleMapsDict]
|
|
3635
3712
|
"""Optional. Google Maps tool type. Specialized retrieval tool
|
|
3636
3713
|
that is powered by Google Maps."""
|
|
3637
3714
|
|
|
3638
|
-
url_context: Optional[UrlContextDict]
|
|
3639
|
-
"""Optional. Tool to support URL context retrieval."""
|
|
3640
|
-
|
|
3641
3715
|
computer_use: Optional[ComputerUseDict]
|
|
3642
3716
|
"""Optional. Tool to support the model interacting directly with the
|
|
3643
3717
|
computer. If enabled, it automatically populates computer-use specific
|
|
@@ -3646,6 +3720,15 @@ class ToolDict(TypedDict, total=False):
|
|
|
3646
3720
|
code_execution: Optional[ToolCodeExecutionDict]
|
|
3647
3721
|
"""Optional. CodeExecution tool type. Enables the model to execute code as part of generation."""
|
|
3648
3722
|
|
|
3723
|
+
enterprise_web_search: Optional[EnterpriseWebSearchDict]
|
|
3724
|
+
"""Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance. This field is not supported in Gemini API."""
|
|
3725
|
+
|
|
3726
|
+
google_search: Optional[GoogleSearchDict]
|
|
3727
|
+
"""Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google."""
|
|
3728
|
+
|
|
3729
|
+
url_context: Optional[UrlContextDict]
|
|
3730
|
+
"""Optional. Tool to support URL context retrieval."""
|
|
3731
|
+
|
|
3649
3732
|
|
|
3650
3733
|
ToolOrDict = Union[Tool, ToolDict]
|
|
3651
3734
|
if _is_mcp_imported:
|
|
@@ -3737,181 +3820,52 @@ class RetrievalConfig(_common.BaseModel):
|
|
|
3737
3820
|
lat_lng: Optional[LatLng] = Field(
|
|
3738
3821
|
default=None, description="""Optional. The location of the user."""
|
|
3739
3822
|
)
|
|
3740
|
-
language_code: Optional[str] = Field(
|
|
3741
|
-
default=None, description="""The language code of the user."""
|
|
3742
|
-
)
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
class RetrievalConfigDict(TypedDict, total=False):
|
|
3746
|
-
"""Retrieval config."""
|
|
3747
|
-
|
|
3748
|
-
lat_lng: Optional[LatLngDict]
|
|
3749
|
-
"""Optional. The location of the user."""
|
|
3750
|
-
|
|
3751
|
-
language_code: Optional[str]
|
|
3752
|
-
"""The language code of the user."""
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
RetrievalConfigOrDict = Union[RetrievalConfig, RetrievalConfigDict]
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
class ToolConfig(_common.BaseModel):
|
|
3759
|
-
"""Tool config.
|
|
3760
|
-
|
|
3761
|
-
This config is shared for all tools provided in the request.
|
|
3762
|
-
"""
|
|
3763
|
-
|
|
3764
|
-
function_calling_config: Optional[FunctionCallingConfig] = Field(
|
|
3765
|
-
default=None, description="""Optional. Function calling config."""
|
|
3766
|
-
)
|
|
3767
|
-
retrieval_config: Optional[RetrievalConfig] = Field(
|
|
3768
|
-
default=None, description="""Optional. Retrieval config."""
|
|
3769
|
-
)
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
class ToolConfigDict(TypedDict, total=False):
|
|
3773
|
-
"""Tool config.
|
|
3774
|
-
|
|
3775
|
-
This config is shared for all tools provided in the request.
|
|
3776
|
-
"""
|
|
3777
|
-
|
|
3778
|
-
function_calling_config: Optional[FunctionCallingConfigDict]
|
|
3779
|
-
"""Optional. Function calling config."""
|
|
3780
|
-
|
|
3781
|
-
retrieval_config: Optional[RetrievalConfigDict]
|
|
3782
|
-
"""Optional. Retrieval config."""
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
ToolConfigOrDict = Union[ToolConfig, ToolConfigDict]
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
class PrebuiltVoiceConfig(_common.BaseModel):
|
|
3789
|
-
"""The configuration for the prebuilt speaker to use."""
|
|
3790
|
-
|
|
3791
|
-
voice_name: Optional[str] = Field(
|
|
3792
|
-
default=None, description="""The name of the prebuilt voice to use."""
|
|
3793
|
-
)
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
class PrebuiltVoiceConfigDict(TypedDict, total=False):
|
|
3797
|
-
"""The configuration for the prebuilt speaker to use."""
|
|
3798
|
-
|
|
3799
|
-
voice_name: Optional[str]
|
|
3800
|
-
"""The name of the prebuilt voice to use."""
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
PrebuiltVoiceConfigOrDict = Union[PrebuiltVoiceConfig, PrebuiltVoiceConfigDict]
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
class VoiceConfig(_common.BaseModel):
|
|
3807
|
-
"""The configuration for the voice to use."""
|
|
3808
|
-
|
|
3809
|
-
prebuilt_voice_config: Optional[PrebuiltVoiceConfig] = Field(
|
|
3810
|
-
default=None,
|
|
3811
|
-
description="""The configuration for the speaker to use.
|
|
3812
|
-
""",
|
|
3813
|
-
)
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
class VoiceConfigDict(TypedDict, total=False):
|
|
3817
|
-
"""The configuration for the voice to use."""
|
|
3818
|
-
|
|
3819
|
-
prebuilt_voice_config: Optional[PrebuiltVoiceConfigDict]
|
|
3820
|
-
"""The configuration for the speaker to use.
|
|
3821
|
-
"""
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
class SpeakerVoiceConfig(_common.BaseModel):
|
|
3828
|
-
"""The configuration for the speaker to use."""
|
|
3829
|
-
|
|
3830
|
-
speaker: Optional[str] = Field(
|
|
3831
|
-
default=None,
|
|
3832
|
-
description="""The name of the speaker to use. Should be the same as in the
|
|
3833
|
-
prompt.""",
|
|
3834
|
-
)
|
|
3835
|
-
voice_config: Optional[VoiceConfig] = Field(
|
|
3836
|
-
default=None, description="""The configuration for the voice to use."""
|
|
3837
|
-
)
|
|
3838
|
-
|
|
3839
|
-
|
|
3840
|
-
class SpeakerVoiceConfigDict(TypedDict, total=False):
|
|
3841
|
-
"""The configuration for the speaker to use."""
|
|
3842
|
-
|
|
3843
|
-
speaker: Optional[str]
|
|
3844
|
-
"""The name of the speaker to use. Should be the same as in the
|
|
3845
|
-
prompt."""
|
|
3846
|
-
|
|
3847
|
-
voice_config: Optional[VoiceConfigDict]
|
|
3848
|
-
"""The configuration for the voice to use."""
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
|
|
3852
|
-
|
|
3823
|
+
language_code: Optional[str] = Field(
|
|
3824
|
+
default=None, description="""The language code of the user."""
|
|
3825
|
+
)
|
|
3853
3826
|
|
|
3854
|
-
class MultiSpeakerVoiceConfig(_common.BaseModel):
|
|
3855
|
-
"""The configuration for the multi-speaker setup."""
|
|
3856
3827
|
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
)
|
|
3828
|
+
class RetrievalConfigDict(TypedDict, total=False):
|
|
3829
|
+
"""Retrieval config."""
|
|
3860
3830
|
|
|
3831
|
+
lat_lng: Optional[LatLngDict]
|
|
3832
|
+
"""Optional. The location of the user."""
|
|
3861
3833
|
|
|
3862
|
-
|
|
3863
|
-
"""The
|
|
3834
|
+
language_code: Optional[str]
|
|
3835
|
+
"""The language code of the user."""
|
|
3864
3836
|
|
|
3865
|
-
speaker_voice_configs: Optional[list[SpeakerVoiceConfigDict]]
|
|
3866
|
-
"""The configuration for the speaker to use."""
|
|
3867
3837
|
|
|
3838
|
+
RetrievalConfigOrDict = Union[RetrievalConfig, RetrievalConfigDict]
|
|
3868
3839
|
|
|
3869
|
-
MultiSpeakerVoiceConfigOrDict = Union[
|
|
3870
|
-
MultiSpeakerVoiceConfig, MultiSpeakerVoiceConfigDict
|
|
3871
|
-
]
|
|
3872
3840
|
|
|
3841
|
+
class ToolConfig(_common.BaseModel):
|
|
3842
|
+
"""Tool config.
|
|
3873
3843
|
|
|
3874
|
-
|
|
3875
|
-
"""
|
|
3844
|
+
This config is shared for all tools provided in the request.
|
|
3845
|
+
"""
|
|
3876
3846
|
|
|
3877
|
-
|
|
3878
|
-
default=None,
|
|
3879
|
-
description="""The configuration for the speaker to use.
|
|
3880
|
-
""",
|
|
3881
|
-
)
|
|
3882
|
-
multi_speaker_voice_config: Optional[MultiSpeakerVoiceConfig] = Field(
|
|
3883
|
-
default=None,
|
|
3884
|
-
description="""The configuration for the multi-speaker setup.
|
|
3885
|
-
It is mutually exclusive with the voice_config field.
|
|
3886
|
-
""",
|
|
3847
|
+
function_calling_config: Optional[FunctionCallingConfig] = Field(
|
|
3848
|
+
default=None, description="""Optional. Function calling config."""
|
|
3887
3849
|
)
|
|
3888
|
-
|
|
3889
|
-
default=None,
|
|
3890
|
-
description="""Language code (ISO 639. e.g. en-US) for the speech synthesization.
|
|
3891
|
-
Only available for Live API.
|
|
3892
|
-
""",
|
|
3850
|
+
retrieval_config: Optional[RetrievalConfig] = Field(
|
|
3851
|
+
default=None, description="""Optional. Retrieval config."""
|
|
3893
3852
|
)
|
|
3894
3853
|
|
|
3895
3854
|
|
|
3896
|
-
class
|
|
3897
|
-
"""
|
|
3855
|
+
class ToolConfigDict(TypedDict, total=False):
|
|
3856
|
+
"""Tool config.
|
|
3898
3857
|
|
|
3899
|
-
|
|
3900
|
-
"""
|
|
3901
|
-
"""
|
|
3858
|
+
This config is shared for all tools provided in the request.
|
|
3859
|
+
"""
|
|
3902
3860
|
|
|
3903
|
-
|
|
3904
|
-
"""
|
|
3905
|
-
It is mutually exclusive with the voice_config field.
|
|
3906
|
-
"""
|
|
3861
|
+
function_calling_config: Optional[FunctionCallingConfigDict]
|
|
3862
|
+
"""Optional. Function calling config."""
|
|
3907
3863
|
|
|
3908
|
-
|
|
3909
|
-
"""
|
|
3910
|
-
Only available for Live API.
|
|
3911
|
-
"""
|
|
3864
|
+
retrieval_config: Optional[RetrievalConfigDict]
|
|
3865
|
+
"""Optional. Retrieval config."""
|
|
3912
3866
|
|
|
3913
3867
|
|
|
3914
|
-
|
|
3868
|
+
ToolConfigOrDict = Union[ToolConfig, ToolConfigDict]
|
|
3915
3869
|
|
|
3916
3870
|
|
|
3917
3871
|
class AutomaticFunctionCallingConfig(_common.BaseModel):
|
|
@@ -4181,7 +4135,10 @@ ContentUnionDict = Union[
|
|
|
4181
4135
|
|
|
4182
4136
|
|
|
4183
4137
|
class GenerationConfigRoutingConfigAutoRoutingMode(_common.BaseModel):
|
|
4184
|
-
"""When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
|
|
4138
|
+
"""When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
|
|
4139
|
+
|
|
4140
|
+
This data type is not supported in Gemini API.
|
|
4141
|
+
"""
|
|
4185
4142
|
|
|
4186
4143
|
model_routing_preference: Optional[
|
|
4187
4144
|
Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']
|
|
@@ -4189,7 +4146,10 @@ class GenerationConfigRoutingConfigAutoRoutingMode(_common.BaseModel):
|
|
|
4189
4146
|
|
|
4190
4147
|
|
|
4191
4148
|
class GenerationConfigRoutingConfigAutoRoutingModeDict(TypedDict, total=False):
|
|
4192
|
-
"""When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
|
|
4149
|
+
"""When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference.
|
|
4150
|
+
|
|
4151
|
+
This data type is not supported in Gemini API.
|
|
4152
|
+
"""
|
|
4193
4153
|
|
|
4194
4154
|
model_routing_preference: Optional[
|
|
4195
4155
|
Literal['UNKNOWN', 'PRIORITIZE_QUALITY', 'BALANCED', 'PRIORITIZE_COST']
|
|
@@ -4204,7 +4164,10 @@ GenerationConfigRoutingConfigAutoRoutingModeOrDict = Union[
|
|
|
4204
4164
|
|
|
4205
4165
|
|
|
4206
4166
|
class GenerationConfigRoutingConfigManualRoutingMode(_common.BaseModel):
|
|
4207
|
-
"""When manual routing is set, the specified model will be used directly.
|
|
4167
|
+
"""When manual routing is set, the specified model will be used directly.
|
|
4168
|
+
|
|
4169
|
+
This data type is not supported in Gemini API.
|
|
4170
|
+
"""
|
|
4208
4171
|
|
|
4209
4172
|
model_name: Optional[str] = Field(
|
|
4210
4173
|
default=None,
|
|
@@ -4215,7 +4178,10 @@ class GenerationConfigRoutingConfigManualRoutingMode(_common.BaseModel):
|
|
|
4215
4178
|
class GenerationConfigRoutingConfigManualRoutingModeDict(
|
|
4216
4179
|
TypedDict, total=False
|
|
4217
4180
|
):
|
|
4218
|
-
"""When manual routing is set, the specified model will be used directly.
|
|
4181
|
+
"""When manual routing is set, the specified model will be used directly.
|
|
4182
|
+
|
|
4183
|
+
This data type is not supported in Gemini API.
|
|
4184
|
+
"""
|
|
4219
4185
|
|
|
4220
4186
|
model_name: Optional[str]
|
|
4221
4187
|
"""The model name to use. Only the public LLM models are accepted. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models)."""
|
|
@@ -4228,7 +4194,10 @@ GenerationConfigRoutingConfigManualRoutingModeOrDict = Union[
|
|
|
4228
4194
|
|
|
4229
4195
|
|
|
4230
4196
|
class GenerationConfigRoutingConfig(_common.BaseModel):
|
|
4231
|
-
"""The configuration for routing the request to a specific model.
|
|
4197
|
+
"""The configuration for routing the request to a specific model.
|
|
4198
|
+
|
|
4199
|
+
This data type is not supported in Gemini API.
|
|
4200
|
+
"""
|
|
4232
4201
|
|
|
4233
4202
|
auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingMode] = Field(
|
|
4234
4203
|
default=None, description="""Automated routing."""
|
|
@@ -4239,7 +4208,10 @@ class GenerationConfigRoutingConfig(_common.BaseModel):
|
|
|
4239
4208
|
|
|
4240
4209
|
|
|
4241
4210
|
class GenerationConfigRoutingConfigDict(TypedDict, total=False):
|
|
4242
|
-
"""The configuration for routing the request to a specific model.
|
|
4211
|
+
"""The configuration for routing the request to a specific model.
|
|
4212
|
+
|
|
4213
|
+
This data type is not supported in Gemini API.
|
|
4214
|
+
"""
|
|
4243
4215
|
|
|
4244
4216
|
auto_mode: Optional[GenerationConfigRoutingConfigAutoRoutingModeDict]
|
|
4245
4217
|
"""Automated routing."""
|
|
@@ -4253,6 +4225,69 @@ GenerationConfigRoutingConfigOrDict = Union[
|
|
|
4253
4225
|
]
|
|
4254
4226
|
|
|
4255
4227
|
|
|
4228
|
+
class SafetySetting(_common.BaseModel):
|
|
4229
|
+
"""Safety settings."""
|
|
4230
|
+
|
|
4231
|
+
category: Optional[HarmCategory] = Field(
|
|
4232
|
+
default=None, description="""Required. Harm category."""
|
|
4233
|
+
)
|
|
4234
|
+
method: Optional[HarmBlockMethod] = Field(
|
|
4235
|
+
default=None,
|
|
4236
|
+
description="""Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. This field is not supported in Gemini API.""",
|
|
4237
|
+
)
|
|
4238
|
+
threshold: Optional[HarmBlockThreshold] = Field(
|
|
4239
|
+
default=None, description="""Required. The harm block threshold."""
|
|
4240
|
+
)
|
|
4241
|
+
|
|
4242
|
+
|
|
4243
|
+
class SafetySettingDict(TypedDict, total=False):
|
|
4244
|
+
"""Safety settings."""
|
|
4245
|
+
|
|
4246
|
+
category: Optional[HarmCategory]
|
|
4247
|
+
"""Required. Harm category."""
|
|
4248
|
+
|
|
4249
|
+
method: Optional[HarmBlockMethod]
|
|
4250
|
+
"""Optional. Specify if the threshold is used for probability or severity score. If not specified, the threshold is used for probability score. This field is not supported in Gemini API."""
|
|
4251
|
+
|
|
4252
|
+
threshold: Optional[HarmBlockThreshold]
|
|
4253
|
+
"""Required. The harm block threshold."""
|
|
4254
|
+
|
|
4255
|
+
|
|
4256
|
+
SafetySettingOrDict = Union[SafetySetting, SafetySettingDict]
|
|
4257
|
+
|
|
4258
|
+
|
|
4259
|
+
class SpeechConfig(_common.BaseModel):
|
|
4260
|
+
"""The speech generation config."""
|
|
4261
|
+
|
|
4262
|
+
language_code: Optional[str] = Field(
|
|
4263
|
+
default=None,
|
|
4264
|
+
description="""Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization.""",
|
|
4265
|
+
)
|
|
4266
|
+
voice_config: Optional['VoiceConfig'] = Field(
|
|
4267
|
+
default=None, description="""The configuration for the speaker to use."""
|
|
4268
|
+
)
|
|
4269
|
+
multi_speaker_voice_config: Optional['MultiSpeakerVoiceConfig'] = Field(
|
|
4270
|
+
default=None,
|
|
4271
|
+
description="""Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field. This field is not supported in Vertex AI.""",
|
|
4272
|
+
)
|
|
4273
|
+
|
|
4274
|
+
|
|
4275
|
+
class SpeechConfigDict(TypedDict, total=False):
|
|
4276
|
+
"""The speech generation config."""
|
|
4277
|
+
|
|
4278
|
+
language_code: Optional[str]
|
|
4279
|
+
"""Optional. Language code (ISO 639. e.g. en-US) for the speech synthesization."""
|
|
4280
|
+
|
|
4281
|
+
voice_config: Optional['VoiceConfigDict']
|
|
4282
|
+
"""The configuration for the speaker to use."""
|
|
4283
|
+
|
|
4284
|
+
multi_speaker_voice_config: Optional['MultiSpeakerVoiceConfigDict']
|
|
4285
|
+
"""Optional. The configuration for the multi-speaker setup. It is mutually exclusive with the voice_config field. This field is not supported in Vertex AI."""
|
|
4286
|
+
|
|
4287
|
+
|
|
4288
|
+
SpeechConfigOrDict = Union[SpeechConfig, SpeechConfigDict]
|
|
4289
|
+
|
|
4290
|
+
|
|
4256
4291
|
SpeechConfigUnion = Union[str, SpeechConfig]
|
|
4257
4292
|
|
|
4258
4293
|
|
|
@@ -4756,7 +4791,8 @@ class GoogleTypeDate(_common.BaseModel):
|
|
|
4756
4791
|
day values. * A month and day, with a zero year (for example, an anniversary).
|
|
4757
4792
|
* A year on its own, with a zero month and a zero day. * A year and month,
|
|
4758
4793
|
with a zero day (for example, a credit card expiration date). Related types: *
|
|
4759
|
-
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
|
|
4794
|
+
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This
|
|
4795
|
+
data type is not supported in Gemini API.
|
|
4760
4796
|
"""
|
|
4761
4797
|
|
|
4762
4798
|
day: Optional[int] = Field(
|
|
@@ -4782,7 +4818,8 @@ class GoogleTypeDateDict(TypedDict, total=False):
|
|
|
4782
4818
|
day values. * A month and day, with a zero year (for example, an anniversary).
|
|
4783
4819
|
* A year on its own, with a zero month and a zero day. * A year and month,
|
|
4784
4820
|
with a zero day (for example, a credit card expiration date). Related types: *
|
|
4785
|
-
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
|
|
4821
|
+
google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp. This
|
|
4822
|
+
data type is not supported in Gemini API.
|
|
4786
4823
|
"""
|
|
4787
4824
|
|
|
4788
4825
|
day: Optional[int]
|
|
@@ -4799,7 +4836,10 @@ GoogleTypeDateOrDict = Union[GoogleTypeDate, GoogleTypeDateDict]
|
|
|
4799
4836
|
|
|
4800
4837
|
|
|
4801
4838
|
class Citation(_common.BaseModel):
|
|
4802
|
-
"""Source attributions for content.
|
|
4839
|
+
"""Source attributions for content.
|
|
4840
|
+
|
|
4841
|
+
This data type is not supported in Gemini API.
|
|
4842
|
+
"""
|
|
4803
4843
|
|
|
4804
4844
|
end_index: Optional[int] = Field(
|
|
4805
4845
|
default=None, description="""Output only. End index into the content."""
|
|
@@ -4824,7 +4864,10 @@ class Citation(_common.BaseModel):
|
|
|
4824
4864
|
|
|
4825
4865
|
|
|
4826
4866
|
class CitationDict(TypedDict, total=False):
|
|
4827
|
-
"""Source attributions for content.
|
|
4867
|
+
"""Source attributions for content.
|
|
4868
|
+
|
|
4869
|
+
This data type is not supported in Gemini API.
|
|
4870
|
+
"""
|
|
4828
4871
|
|
|
4829
4872
|
end_index: Optional[int]
|
|
4830
4873
|
"""Output only. End index into the content."""
|
|
@@ -4873,50 +4916,11 @@ class CitationMetadataDict(TypedDict, total=False):
|
|
|
4873
4916
|
CitationMetadataOrDict = Union[CitationMetadata, CitationMetadataDict]
|
|
4874
4917
|
|
|
4875
4918
|
|
|
4876
|
-
class UrlMetadata(_common.BaseModel):
|
|
4877
|
-
"""Context for a single url retrieval."""
|
|
4878
|
-
|
|
4879
|
-
retrieved_url: Optional[str] = Field(
|
|
4880
|
-
default=None, description="""The URL retrieved by the tool."""
|
|
4881
|
-
)
|
|
4882
|
-
url_retrieval_status: Optional[UrlRetrievalStatus] = Field(
|
|
4883
|
-
default=None, description="""Status of the url retrieval."""
|
|
4884
|
-
)
|
|
4885
|
-
|
|
4886
|
-
|
|
4887
|
-
class UrlMetadataDict(TypedDict, total=False):
|
|
4888
|
-
"""Context for a single url retrieval."""
|
|
4889
|
-
|
|
4890
|
-
retrieved_url: Optional[str]
|
|
4891
|
-
"""The URL retrieved by the tool."""
|
|
4892
|
-
|
|
4893
|
-
url_retrieval_status: Optional[UrlRetrievalStatus]
|
|
4894
|
-
"""Status of the url retrieval."""
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
UrlMetadataOrDict = Union[UrlMetadata, UrlMetadataDict]
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
class UrlContextMetadata(_common.BaseModel):
|
|
4901
|
-
"""Metadata related to url context retrieval tool."""
|
|
4902
|
-
|
|
4903
|
-
url_metadata: Optional[list[UrlMetadata]] = Field(
|
|
4904
|
-
default=None, description="""List of url context."""
|
|
4905
|
-
)
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
class UrlContextMetadataDict(TypedDict, total=False):
|
|
4909
|
-
"""Metadata related to url context retrieval tool."""
|
|
4910
|
-
|
|
4911
|
-
url_metadata: Optional[list[UrlMetadataDict]]
|
|
4912
|
-
"""List of url context."""
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
UrlContextMetadataOrDict = Union[UrlContextMetadata, UrlContextMetadataDict]
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
4919
|
class GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution(_common.BaseModel):
|
|
4919
|
-
"""Author attribution for a photo or review.
|
|
4920
|
+
"""Author attribution for a photo or review.
|
|
4921
|
+
|
|
4922
|
+
This data type is not supported in Gemini API.
|
|
4923
|
+
"""
|
|
4920
4924
|
|
|
4921
4925
|
display_name: Optional[str] = Field(
|
|
4922
4926
|
default=None, description="""Name of the author of the Photo or Review."""
|
|
@@ -4933,7 +4937,10 @@ class GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution(_common.BaseModel):
|
|
|
4933
4937
|
class GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionDict(
|
|
4934
4938
|
TypedDict, total=False
|
|
4935
4939
|
):
|
|
4936
|
-
"""Author attribution for a photo or review.
|
|
4940
|
+
"""Author attribution for a photo or review.
|
|
4941
|
+
|
|
4942
|
+
This data type is not supported in Gemini API.
|
|
4943
|
+
"""
|
|
4937
4944
|
|
|
4938
4945
|
display_name: Optional[str]
|
|
4939
4946
|
"""Name of the author of the Photo or Review."""
|
|
@@ -4952,7 +4959,10 @@ GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionOrDict = Union[
|
|
|
4952
4959
|
|
|
4953
4960
|
|
|
4954
4961
|
class GroundingChunkMapsPlaceAnswerSourcesReviewSnippet(_common.BaseModel):
|
|
4955
|
-
"""Encapsulates a review snippet.
|
|
4962
|
+
"""Encapsulates a review snippet.
|
|
4963
|
+
|
|
4964
|
+
This data type is not supported in Gemini API.
|
|
4965
|
+
"""
|
|
4956
4966
|
|
|
4957
4967
|
author_attribution: Optional[
|
|
4958
4968
|
GroundingChunkMapsPlaceAnswerSourcesAuthorAttribution
|
|
@@ -4983,7 +4993,10 @@ class GroundingChunkMapsPlaceAnswerSourcesReviewSnippet(_common.BaseModel):
|
|
|
4983
4993
|
class GroundingChunkMapsPlaceAnswerSourcesReviewSnippetDict(
|
|
4984
4994
|
TypedDict, total=False
|
|
4985
4995
|
):
|
|
4986
|
-
"""Encapsulates a review snippet.
|
|
4996
|
+
"""Encapsulates a review snippet.
|
|
4997
|
+
|
|
4998
|
+
This data type is not supported in Gemini API.
|
|
4999
|
+
"""
|
|
4987
5000
|
|
|
4988
5001
|
author_attribution: Optional[
|
|
4989
5002
|
GroundingChunkMapsPlaceAnswerSourcesAuthorAttributionDict
|
|
@@ -5016,7 +5029,10 @@ GroundingChunkMapsPlaceAnswerSourcesReviewSnippetOrDict = Union[
|
|
|
5016
5029
|
|
|
5017
5030
|
|
|
5018
5031
|
class GroundingChunkMapsPlaceAnswerSources(_common.BaseModel):
|
|
5019
|
-
"""Sources used to generate the place answer.
|
|
5032
|
+
"""Sources used to generate the place answer.
|
|
5033
|
+
|
|
5034
|
+
This data type is not supported in Gemini API.
|
|
5035
|
+
"""
|
|
5020
5036
|
|
|
5021
5037
|
flag_content_uri: Optional[str] = Field(
|
|
5022
5038
|
default=None,
|
|
@@ -5031,7 +5047,10 @@ class GroundingChunkMapsPlaceAnswerSources(_common.BaseModel):
|
|
|
5031
5047
|
|
|
5032
5048
|
|
|
5033
5049
|
class GroundingChunkMapsPlaceAnswerSourcesDict(TypedDict, total=False):
|
|
5034
|
-
"""Sources used to generate the place answer.
|
|
5050
|
+
"""Sources used to generate the place answer.
|
|
5051
|
+
|
|
5052
|
+
This data type is not supported in Gemini API.
|
|
5053
|
+
"""
|
|
5035
5054
|
|
|
5036
5055
|
flag_content_uri: Optional[str]
|
|
5037
5056
|
"""A link where users can flag a problem with the generated answer."""
|
|
@@ -5049,7 +5068,7 @@ GroundingChunkMapsPlaceAnswerSourcesOrDict = Union[
|
|
|
5049
5068
|
|
|
5050
5069
|
|
|
5051
5070
|
class GroundingChunkMaps(_common.BaseModel):
|
|
5052
|
-
"""Chunk from Google Maps."""
|
|
5071
|
+
"""Chunk from Google Maps. This data type is not supported in Gemini API."""
|
|
5053
5072
|
|
|
5054
5073
|
place_answer_sources: Optional[GroundingChunkMapsPlaceAnswerSources] = Field(
|
|
5055
5074
|
default=None,
|
|
@@ -5071,7 +5090,7 @@ class GroundingChunkMaps(_common.BaseModel):
|
|
|
5071
5090
|
|
|
5072
5091
|
|
|
5073
5092
|
class GroundingChunkMapsDict(TypedDict, total=False):
|
|
5074
|
-
"""Chunk from Google Maps."""
|
|
5093
|
+
"""Chunk from Google Maps. This data type is not supported in Gemini API."""
|
|
5075
5094
|
|
|
5076
5095
|
place_answer_sources: Optional[GroundingChunkMapsPlaceAnswerSourcesDict]
|
|
5077
5096
|
"""Sources used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as uris to flag content."""
|
|
@@ -5093,7 +5112,10 @@ GroundingChunkMapsOrDict = Union[GroundingChunkMaps, GroundingChunkMapsDict]
|
|
|
5093
5112
|
|
|
5094
5113
|
|
|
5095
5114
|
class RagChunkPageSpan(_common.BaseModel):
|
|
5096
|
-
"""Represents where the chunk starts and ends in the document.
|
|
5115
|
+
"""Represents where the chunk starts and ends in the document.
|
|
5116
|
+
|
|
5117
|
+
This data type is not supported in Gemini API.
|
|
5118
|
+
"""
|
|
5097
5119
|
|
|
5098
5120
|
first_page: Optional[int] = Field(
|
|
5099
5121
|
default=None,
|
|
@@ -5106,7 +5128,10 @@ class RagChunkPageSpan(_common.BaseModel):
|
|
|
5106
5128
|
|
|
5107
5129
|
|
|
5108
5130
|
class RagChunkPageSpanDict(TypedDict, total=False):
|
|
5109
|
-
"""Represents where the chunk starts and ends in the document.
|
|
5131
|
+
"""Represents where the chunk starts and ends in the document.
|
|
5132
|
+
|
|
5133
|
+
This data type is not supported in Gemini API.
|
|
5134
|
+
"""
|
|
5110
5135
|
|
|
5111
5136
|
first_page: Optional[int]
|
|
5112
5137
|
"""Page where chunk starts in the document. Inclusive. 1-indexed."""
|
|
@@ -5119,7 +5144,10 @@ RagChunkPageSpanOrDict = Union[RagChunkPageSpan, RagChunkPageSpanDict]
|
|
|
5119
5144
|
|
|
5120
5145
|
|
|
5121
5146
|
class RagChunk(_common.BaseModel):
|
|
5122
|
-
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5147
|
+
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5148
|
+
|
|
5149
|
+
This data type is not supported in Gemini API.
|
|
5150
|
+
"""
|
|
5123
5151
|
|
|
5124
5152
|
page_span: Optional[RagChunkPageSpan] = Field(
|
|
5125
5153
|
default=None,
|
|
@@ -5131,7 +5159,10 @@ class RagChunk(_common.BaseModel):
|
|
|
5131
5159
|
|
|
5132
5160
|
|
|
5133
5161
|
class RagChunkDict(TypedDict, total=False):
|
|
5134
|
-
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5162
|
+
"""A RagChunk includes the content of a chunk of a RagFile, and associated metadata.
|
|
5163
|
+
|
|
5164
|
+
This data type is not supported in Gemini API.
|
|
5165
|
+
"""
|
|
5135
5166
|
|
|
5136
5167
|
page_span: Optional[RagChunkPageSpanDict]
|
|
5137
5168
|
"""If populated, represents where the chunk starts and ends in the document."""
|
|
@@ -5144,7 +5175,10 @@ RagChunkOrDict = Union[RagChunk, RagChunkDict]
|
|
|
5144
5175
|
|
|
5145
5176
|
|
|
5146
5177
|
class GroundingChunkRetrievedContext(_common.BaseModel):
|
|
5147
|
-
"""Chunk from context retrieved by the retrieval tools.
|
|
5178
|
+
"""Chunk from context retrieved by the retrieval tools.
|
|
5179
|
+
|
|
5180
|
+
This data type is not supported in Gemini API.
|
|
5181
|
+
"""
|
|
5148
5182
|
|
|
5149
5183
|
document_name: Optional[str] = Field(
|
|
5150
5184
|
default=None,
|
|
@@ -5166,7 +5200,10 @@ class GroundingChunkRetrievedContext(_common.BaseModel):
|
|
|
5166
5200
|
|
|
5167
5201
|
|
|
5168
5202
|
class GroundingChunkRetrievedContextDict(TypedDict, total=False):
|
|
5169
|
-
"""Chunk from context retrieved by the retrieval tools.
|
|
5203
|
+
"""Chunk from context retrieved by the retrieval tools.
|
|
5204
|
+
|
|
5205
|
+
This data type is not supported in Gemini API.
|
|
5206
|
+
"""
|
|
5170
5207
|
|
|
5171
5208
|
document_name: Optional[str]
|
|
5172
5209
|
"""Output only. The full document name for the referenced Vertex AI Search document."""
|
|
@@ -5193,7 +5230,8 @@ class GroundingChunkWeb(_common.BaseModel):
|
|
|
5193
5230
|
"""Chunk from the web."""
|
|
5194
5231
|
|
|
5195
5232
|
domain: Optional[str] = Field(
|
|
5196
|
-
default=None,
|
|
5233
|
+
default=None,
|
|
5234
|
+
description="""Domain of the (original) URI. This field is not supported in Gemini API.""",
|
|
5197
5235
|
)
|
|
5198
5236
|
title: Optional[str] = Field(
|
|
5199
5237
|
default=None, description="""Title of the chunk."""
|
|
@@ -5207,7 +5245,7 @@ class GroundingChunkWebDict(TypedDict, total=False):
|
|
|
5207
5245
|
"""Chunk from the web."""
|
|
5208
5246
|
|
|
5209
5247
|
domain: Optional[str]
|
|
5210
|
-
"""Domain of the (original) URI."""
|
|
5248
|
+
"""Domain of the (original) URI. This field is not supported in Gemini API."""
|
|
5211
5249
|
|
|
5212
5250
|
title: Optional[str]
|
|
5213
5251
|
"""Title of the chunk."""
|
|
@@ -5223,11 +5261,12 @@ class GroundingChunk(_common.BaseModel):
|
|
|
5223
5261
|
"""Grounding chunk."""
|
|
5224
5262
|
|
|
5225
5263
|
maps: Optional[GroundingChunkMaps] = Field(
|
|
5226
|
-
default=None,
|
|
5264
|
+
default=None,
|
|
5265
|
+
description="""Grounding chunk from Google Maps. This field is not supported in Gemini API.""",
|
|
5227
5266
|
)
|
|
5228
5267
|
retrieved_context: Optional[GroundingChunkRetrievedContext] = Field(
|
|
5229
5268
|
default=None,
|
|
5230
|
-
description="""Grounding chunk from context retrieved by the retrieval tools.""",
|
|
5269
|
+
description="""Grounding chunk from context retrieved by the retrieval tools. This field is not supported in Gemini API.""",
|
|
5231
5270
|
)
|
|
5232
5271
|
web: Optional[GroundingChunkWeb] = Field(
|
|
5233
5272
|
default=None, description="""Grounding chunk from the web."""
|
|
@@ -5238,10 +5277,10 @@ class GroundingChunkDict(TypedDict, total=False):
|
|
|
5238
5277
|
"""Grounding chunk."""
|
|
5239
5278
|
|
|
5240
5279
|
maps: Optional[GroundingChunkMapsDict]
|
|
5241
|
-
"""Grounding chunk from Google Maps."""
|
|
5280
|
+
"""Grounding chunk from Google Maps. This field is not supported in Gemini API."""
|
|
5242
5281
|
|
|
5243
5282
|
retrieved_context: Optional[GroundingChunkRetrievedContextDict]
|
|
5244
|
-
"""Grounding chunk from context retrieved by the retrieval tools."""
|
|
5283
|
+
"""Grounding chunk from context retrieved by the retrieval tools. This field is not supported in Gemini API."""
|
|
5245
5284
|
|
|
5246
5285
|
web: Optional[GroundingChunkWebDict]
|
|
5247
5286
|
"""Grounding chunk from the web."""
|
|
@@ -5371,7 +5410,8 @@ SearchEntryPointOrDict = Union[SearchEntryPoint, SearchEntryPointDict]
|
|
|
5371
5410
|
class GroundingMetadataSourceFlaggingUri(_common.BaseModel):
|
|
5372
5411
|
"""Source content flagging uri for a place or review.
|
|
5373
5412
|
|
|
5374
|
-
This is currently populated only for Google Maps grounding.
|
|
5413
|
+
This is currently populated only for Google Maps grounding. This data type is
|
|
5414
|
+
not supported in Gemini API.
|
|
5375
5415
|
"""
|
|
5376
5416
|
|
|
5377
5417
|
flag_content_uri: Optional[str] = Field(
|
|
@@ -5386,7 +5426,8 @@ class GroundingMetadataSourceFlaggingUri(_common.BaseModel):
|
|
|
5386
5426
|
class GroundingMetadataSourceFlaggingUriDict(TypedDict, total=False):
|
|
5387
5427
|
"""Source content flagging uri for a place or review.
|
|
5388
5428
|
|
|
5389
|
-
This is currently populated only for Google Maps grounding.
|
|
5429
|
+
This is currently populated only for Google Maps grounding. This data type is
|
|
5430
|
+
not supported in Gemini API.
|
|
5390
5431
|
"""
|
|
5391
5432
|
|
|
5392
5433
|
flag_content_uri: Optional[str]
|
|
@@ -5406,7 +5447,7 @@ class GroundingMetadata(_common.BaseModel):
|
|
|
5406
5447
|
|
|
5407
5448
|
google_maps_widget_context_token: Optional[str] = Field(
|
|
5408
5449
|
default=None,
|
|
5409
|
-
description="""Optional. Output only. Resource name of the Google Maps widget context token to be used with the PlacesContextElement widget to render contextual data. This is populated only for Google Maps grounding.""",
|
|
5450
|
+
description="""Optional. Output only. Resource name of the Google Maps widget context token to be used with the PlacesContextElement widget to render contextual data. This is populated only for Google Maps grounding. This field is not supported in Gemini API.""",
|
|
5410
5451
|
)
|
|
5411
5452
|
grounding_chunks: Optional[list[GroundingChunk]] = Field(
|
|
5412
5453
|
default=None,
|
|
@@ -5420,7 +5461,7 @@ class GroundingMetadata(_common.BaseModel):
|
|
|
5420
5461
|
)
|
|
5421
5462
|
retrieval_queries: Optional[list[str]] = Field(
|
|
5422
5463
|
default=None,
|
|
5423
|
-
description="""Optional. Queries executed by the retrieval tools.""",
|
|
5464
|
+
description="""Optional. Queries executed by the retrieval tools. This field is not supported in Gemini API.""",
|
|
5424
5465
|
)
|
|
5425
5466
|
search_entry_point: Optional[SearchEntryPoint] = Field(
|
|
5426
5467
|
default=None,
|
|
@@ -5429,7 +5470,7 @@ class GroundingMetadata(_common.BaseModel):
|
|
|
5429
5470
|
source_flagging_uris: Optional[list[GroundingMetadataSourceFlaggingUri]] = (
|
|
5430
5471
|
Field(
|
|
5431
5472
|
default=None,
|
|
5432
|
-
description="""Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding.""",
|
|
5473
|
+
description="""Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding. This field is not supported in Gemini API.""",
|
|
5433
5474
|
)
|
|
5434
5475
|
)
|
|
5435
5476
|
web_search_queries: Optional[list[str]] = Field(
|
|
@@ -5442,7 +5483,7 @@ class GroundingMetadataDict(TypedDict, total=False):
|
|
|
5442
5483
|
"""Metadata returned to client when grounding is enabled."""
|
|
5443
5484
|
|
|
5444
5485
|
google_maps_widget_context_token: Optional[str]
|
|
5445
|
-
"""Optional. Output only. Resource name of the Google Maps widget context token to be used with the PlacesContextElement widget to render contextual data. This is populated only for Google Maps grounding."""
|
|
5486
|
+
"""Optional. Output only. Resource name of the Google Maps widget context token to be used with the PlacesContextElement widget to render contextual data. This is populated only for Google Maps grounding. This field is not supported in Gemini API."""
|
|
5446
5487
|
|
|
5447
5488
|
grounding_chunks: Optional[list[GroundingChunkDict]]
|
|
5448
5489
|
"""List of supporting references retrieved from specified grounding source."""
|
|
@@ -5454,13 +5495,13 @@ class GroundingMetadataDict(TypedDict, total=False):
|
|
|
5454
5495
|
"""Optional. Output only. Retrieval metadata."""
|
|
5455
5496
|
|
|
5456
5497
|
retrieval_queries: Optional[list[str]]
|
|
5457
|
-
"""Optional. Queries executed by the retrieval tools."""
|
|
5498
|
+
"""Optional. Queries executed by the retrieval tools. This field is not supported in Gemini API."""
|
|
5458
5499
|
|
|
5459
5500
|
search_entry_point: Optional[SearchEntryPointDict]
|
|
5460
5501
|
"""Optional. Google search entry for the following-up web searches."""
|
|
5461
5502
|
|
|
5462
5503
|
source_flagging_uris: Optional[list[GroundingMetadataSourceFlaggingUriDict]]
|
|
5463
|
-
"""Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding."""
|
|
5504
|
+
"""Optional. Output only. List of source flagging uris. This is currently populated only for Google Maps grounding. This field is not supported in Gemini API."""
|
|
5464
5505
|
|
|
5465
5506
|
web_search_queries: Optional[list[str]]
|
|
5466
5507
|
"""Optional. Web search queries for the following-up web search."""
|
|
@@ -5559,21 +5600,23 @@ class SafetyRating(_common.BaseModel):
|
|
|
5559
5600
|
)
|
|
5560
5601
|
overwritten_threshold: Optional[HarmBlockThreshold] = Field(
|
|
5561
5602
|
default=None,
|
|
5562
|
-
description="""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.""",
|
|
5603
|
+
description="""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API.""",
|
|
5563
5604
|
)
|
|
5564
5605
|
probability: Optional[HarmProbability] = Field(
|
|
5565
5606
|
default=None,
|
|
5566
5607
|
description="""Output only. Harm probability levels in the content.""",
|
|
5567
5608
|
)
|
|
5568
5609
|
probability_score: Optional[float] = Field(
|
|
5569
|
-
default=None,
|
|
5610
|
+
default=None,
|
|
5611
|
+
description="""Output only. Harm probability score. This field is not supported in Gemini API.""",
|
|
5570
5612
|
)
|
|
5571
5613
|
severity: Optional[HarmSeverity] = Field(
|
|
5572
5614
|
default=None,
|
|
5573
|
-
description="""Output only. Harm severity levels in the content.""",
|
|
5615
|
+
description="""Output only. Harm severity levels in the content. This field is not supported in Gemini API.""",
|
|
5574
5616
|
)
|
|
5575
5617
|
severity_score: Optional[float] = Field(
|
|
5576
|
-
default=None,
|
|
5618
|
+
default=None,
|
|
5619
|
+
description="""Output only. Harm severity score. This field is not supported in Gemini API.""",
|
|
5577
5620
|
)
|
|
5578
5621
|
|
|
5579
5622
|
|
|
@@ -5587,24 +5630,66 @@ class SafetyRatingDict(TypedDict, total=False):
|
|
|
5587
5630
|
"""Output only. Harm category."""
|
|
5588
5631
|
|
|
5589
5632
|
overwritten_threshold: Optional[HarmBlockThreshold]
|
|
5590
|
-
"""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold."""
|
|
5633
|
+
"""Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold. This field is not supported in Gemini API."""
|
|
5591
5634
|
|
|
5592
5635
|
probability: Optional[HarmProbability]
|
|
5593
5636
|
"""Output only. Harm probability levels in the content."""
|
|
5594
5637
|
|
|
5595
5638
|
probability_score: Optional[float]
|
|
5596
|
-
"""Output only. Harm probability score."""
|
|
5639
|
+
"""Output only. Harm probability score. This field is not supported in Gemini API."""
|
|
5597
5640
|
|
|
5598
5641
|
severity: Optional[HarmSeverity]
|
|
5599
|
-
"""Output only. Harm severity levels in the content."""
|
|
5642
|
+
"""Output only. Harm severity levels in the content. This field is not supported in Gemini API."""
|
|
5600
5643
|
|
|
5601
5644
|
severity_score: Optional[float]
|
|
5602
|
-
"""Output only. Harm severity score."""
|
|
5645
|
+
"""Output only. Harm severity score. This field is not supported in Gemini API."""
|
|
5603
5646
|
|
|
5604
5647
|
|
|
5605
5648
|
SafetyRatingOrDict = Union[SafetyRating, SafetyRatingDict]
|
|
5606
5649
|
|
|
5607
5650
|
|
|
5651
|
+
class UrlMetadata(_common.BaseModel):
|
|
5652
|
+
"""Context of the a single url retrieval."""
|
|
5653
|
+
|
|
5654
|
+
retrieved_url: Optional[str] = Field(
|
|
5655
|
+
default=None, description="""Retrieved url by the tool."""
|
|
5656
|
+
)
|
|
5657
|
+
url_retrieval_status: Optional[UrlRetrievalStatus] = Field(
|
|
5658
|
+
default=None, description="""Status of the url retrieval."""
|
|
5659
|
+
)
|
|
5660
|
+
|
|
5661
|
+
|
|
5662
|
+
class UrlMetadataDict(TypedDict, total=False):
|
|
5663
|
+
"""Context of the a single url retrieval."""
|
|
5664
|
+
|
|
5665
|
+
retrieved_url: Optional[str]
|
|
5666
|
+
"""Retrieved url by the tool."""
|
|
5667
|
+
|
|
5668
|
+
url_retrieval_status: Optional[UrlRetrievalStatus]
|
|
5669
|
+
"""Status of the url retrieval."""
|
|
5670
|
+
|
|
5671
|
+
|
|
5672
|
+
UrlMetadataOrDict = Union[UrlMetadata, UrlMetadataDict]
|
|
5673
|
+
|
|
5674
|
+
|
|
5675
|
+
class UrlContextMetadata(_common.BaseModel):
|
|
5676
|
+
"""Metadata related to url context retrieval tool."""
|
|
5677
|
+
|
|
5678
|
+
url_metadata: Optional[list[UrlMetadata]] = Field(
|
|
5679
|
+
default=None, description="""Output only. List of url context."""
|
|
5680
|
+
)
|
|
5681
|
+
|
|
5682
|
+
|
|
5683
|
+
class UrlContextMetadataDict(TypedDict, total=False):
|
|
5684
|
+
"""Metadata related to url context retrieval tool."""
|
|
5685
|
+
|
|
5686
|
+
url_metadata: Optional[list[UrlMetadataDict]]
|
|
5687
|
+
"""Output only. List of url context."""
|
|
5688
|
+
|
|
5689
|
+
|
|
5690
|
+
UrlContextMetadataOrDict = Union[UrlContextMetadata, UrlContextMetadataDict]
|
|
5691
|
+
|
|
5692
|
+
|
|
5608
5693
|
class Candidate(_common.BaseModel):
|
|
5609
5694
|
"""A response candidate generated from the model."""
|
|
5610
5695
|
|
|
@@ -5634,10 +5719,6 @@ class Candidate(_common.BaseModel):
|
|
|
5634
5719
|
If empty, the model has not stopped generating the tokens.
|
|
5635
5720
|
""",
|
|
5636
5721
|
)
|
|
5637
|
-
url_context_metadata: Optional[UrlContextMetadata] = Field(
|
|
5638
|
-
default=None,
|
|
5639
|
-
description="""Metadata related to url context retrieval tool.""",
|
|
5640
|
-
)
|
|
5641
5722
|
avg_logprobs: Optional[float] = Field(
|
|
5642
5723
|
default=None,
|
|
5643
5724
|
description="""Output only. Average log probability score of the candidate.""",
|
|
@@ -5657,6 +5738,10 @@ class Candidate(_common.BaseModel):
|
|
|
5657
5738
|
default=None,
|
|
5658
5739
|
description="""Output only. List of ratings for the safety of a response candidate. There is at most one rating per category.""",
|
|
5659
5740
|
)
|
|
5741
|
+
url_context_metadata: Optional[UrlContextMetadata] = Field(
|
|
5742
|
+
default=None,
|
|
5743
|
+
description="""Output only. Metadata related to url context retrieval tool.""",
|
|
5744
|
+
)
|
|
5660
5745
|
|
|
5661
5746
|
|
|
5662
5747
|
class CandidateDict(TypedDict, total=False):
|
|
@@ -5683,9 +5768,6 @@ class CandidateDict(TypedDict, total=False):
|
|
|
5683
5768
|
If empty, the model has not stopped generating the tokens.
|
|
5684
5769
|
"""
|
|
5685
5770
|
|
|
5686
|
-
url_context_metadata: Optional[UrlContextMetadataDict]
|
|
5687
|
-
"""Metadata related to url context retrieval tool."""
|
|
5688
|
-
|
|
5689
5771
|
avg_logprobs: Optional[float]
|
|
5690
5772
|
"""Output only. Average log probability score of the candidate."""
|
|
5691
5773
|
|
|
@@ -5701,36 +5783,49 @@ class CandidateDict(TypedDict, total=False):
|
|
|
5701
5783
|
safety_ratings: Optional[list[SafetyRatingDict]]
|
|
5702
5784
|
"""Output only. List of ratings for the safety of a response candidate. There is at most one rating per category."""
|
|
5703
5785
|
|
|
5786
|
+
url_context_metadata: Optional[UrlContextMetadataDict]
|
|
5787
|
+
"""Output only. Metadata related to url context retrieval tool."""
|
|
5788
|
+
|
|
5704
5789
|
|
|
5705
5790
|
CandidateOrDict = Union[Candidate, CandidateDict]
|
|
5706
5791
|
|
|
5707
5792
|
|
|
5708
5793
|
class GenerateContentResponsePromptFeedback(_common.BaseModel):
|
|
5709
|
-
"""Content filter results for a prompt sent in the request.
|
|
5794
|
+
"""Content filter results for a prompt sent in the request.
|
|
5795
|
+
|
|
5796
|
+
Note: This is sent only in the first stream chunk and only if no candidates
|
|
5797
|
+
were generated due to content violations.
|
|
5798
|
+
"""
|
|
5710
5799
|
|
|
5711
5800
|
block_reason: Optional[BlockedReason] = Field(
|
|
5712
|
-
default=None,
|
|
5801
|
+
default=None,
|
|
5802
|
+
description="""Output only. The reason why the prompt was blocked.""",
|
|
5713
5803
|
)
|
|
5714
5804
|
block_reason_message: Optional[str] = Field(
|
|
5715
5805
|
default=None,
|
|
5716
|
-
description="""Output only. A readable
|
|
5806
|
+
description="""Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API.""",
|
|
5717
5807
|
)
|
|
5718
5808
|
safety_ratings: Optional[list[SafetyRating]] = Field(
|
|
5719
|
-
default=None,
|
|
5809
|
+
default=None,
|
|
5810
|
+
description="""Output only. A list of safety ratings for the prompt. There is one rating per category.""",
|
|
5720
5811
|
)
|
|
5721
5812
|
|
|
5722
5813
|
|
|
5723
5814
|
class GenerateContentResponsePromptFeedbackDict(TypedDict, total=False):
|
|
5724
|
-
"""Content filter results for a prompt sent in the request.
|
|
5815
|
+
"""Content filter results for a prompt sent in the request.
|
|
5816
|
+
|
|
5817
|
+
Note: This is sent only in the first stream chunk and only if no candidates
|
|
5818
|
+
were generated due to content violations.
|
|
5819
|
+
"""
|
|
5725
5820
|
|
|
5726
5821
|
block_reason: Optional[BlockedReason]
|
|
5727
|
-
"""Output only.
|
|
5822
|
+
"""Output only. The reason why the prompt was blocked."""
|
|
5728
5823
|
|
|
5729
5824
|
block_reason_message: Optional[str]
|
|
5730
|
-
"""Output only. A readable
|
|
5825
|
+
"""Output only. A readable message that explains the reason why the prompt was blocked. This field is not supported in Gemini API."""
|
|
5731
5826
|
|
|
5732
5827
|
safety_ratings: Optional[list[SafetyRatingDict]]
|
|
5733
|
-
"""Output only.
|
|
5828
|
+
"""Output only. A list of safety ratings for the prompt. There is one rating per category."""
|
|
5734
5829
|
|
|
5735
5830
|
|
|
5736
5831
|
GenerateContentResponsePromptFeedbackOrDict = Union[
|
|
@@ -5765,7 +5860,10 @@ ModalityTokenCountOrDict = Union[ModalityTokenCount, ModalityTokenCountDict]
|
|
|
5765
5860
|
|
|
5766
5861
|
|
|
5767
5862
|
class GenerateContentResponseUsageMetadata(_common.BaseModel):
|
|
5768
|
-
"""Usage metadata about response(s).
|
|
5863
|
+
"""Usage metadata about response(s).
|
|
5864
|
+
|
|
5865
|
+
This data type is not supported in Gemini API.
|
|
5866
|
+
"""
|
|
5769
5867
|
|
|
5770
5868
|
cache_tokens_details: Optional[list[ModalityTokenCount]] = Field(
|
|
5771
5869
|
default=None,
|
|
@@ -5813,7 +5911,10 @@ class GenerateContentResponseUsageMetadata(_common.BaseModel):
|
|
|
5813
5911
|
|
|
5814
5912
|
|
|
5815
5913
|
class GenerateContentResponseUsageMetadataDict(TypedDict, total=False):
|
|
5816
|
-
"""Usage metadata about response(s).
|
|
5914
|
+
"""Usage metadata about response(s).
|
|
5915
|
+
|
|
5916
|
+
This data type is not supported in Gemini API.
|
|
5917
|
+
"""
|
|
5817
5918
|
|
|
5818
5919
|
cache_tokens_details: Optional[list[ModalityTokenCountDict]]
|
|
5819
5920
|
"""Output only. List of modalities of the cached content in the request input."""
|
|
@@ -7285,6 +7386,12 @@ class _UpscaleImageAPIConfig(_common.BaseModel):
|
|
|
7285
7386
|
default=None,
|
|
7286
7387
|
description="""Cloud Storage URI used to store the generated images.""",
|
|
7287
7388
|
)
|
|
7389
|
+
safety_filter_level: Optional[SafetyFilterLevel] = Field(
|
|
7390
|
+
default=None, description="""Filter level for safety filtering."""
|
|
7391
|
+
)
|
|
7392
|
+
person_generation: Optional[PersonGeneration] = Field(
|
|
7393
|
+
default=None, description="""Allows generation of people by the model."""
|
|
7394
|
+
)
|
|
7288
7395
|
include_rai_reason: Optional[bool] = Field(
|
|
7289
7396
|
default=None,
|
|
7290
7397
|
description="""Whether to include a reason for filtered-out images in the
|
|
@@ -7330,8 +7437,14 @@ class _UpscaleImageAPIConfigDict(TypedDict, total=False):
|
|
|
7330
7437
|
http_options: Optional[HttpOptionsDict]
|
|
7331
7438
|
"""Used to override HTTP request options."""
|
|
7332
7439
|
|
|
7333
|
-
output_gcs_uri: Optional[str]
|
|
7334
|
-
"""Cloud Storage URI used to store the generated images."""
|
|
7440
|
+
output_gcs_uri: Optional[str]
|
|
7441
|
+
"""Cloud Storage URI used to store the generated images."""
|
|
7442
|
+
|
|
7443
|
+
safety_filter_level: Optional[SafetyFilterLevel]
|
|
7444
|
+
"""Filter level for safety filtering."""
|
|
7445
|
+
|
|
7446
|
+
person_generation: Optional[PersonGeneration]
|
|
7447
|
+
"""Allows generation of people by the model."""
|
|
7335
7448
|
|
|
7336
7449
|
include_rai_reason: Optional[bool]
|
|
7337
7450
|
"""Whether to include a reason for filtered-out images in the
|
|
@@ -8304,31 +8417,98 @@ class DeleteModelResponseDict(TypedDict, total=False):
|
|
|
8304
8417
|
DeleteModelResponseOrDict = Union[DeleteModelResponse, DeleteModelResponseDict]
|
|
8305
8418
|
|
|
8306
8419
|
|
|
8307
|
-
class
|
|
8308
|
-
"""
|
|
8420
|
+
class PrebuiltVoiceConfig(_common.BaseModel):
|
|
8421
|
+
"""The configuration for the prebuilt speaker to use."""
|
|
8309
8422
|
|
|
8310
|
-
|
|
8423
|
+
voice_name: Optional[str] = Field(
|
|
8424
|
+
default=None, description="""The name of the preset voice to use."""
|
|
8425
|
+
)
|
|
8426
|
+
|
|
8427
|
+
|
|
8428
|
+
class PrebuiltVoiceConfigDict(TypedDict, total=False):
|
|
8429
|
+
"""The configuration for the prebuilt speaker to use."""
|
|
8430
|
+
|
|
8431
|
+
voice_name: Optional[str]
|
|
8432
|
+
"""The name of the preset voice to use."""
|
|
8433
|
+
|
|
8434
|
+
|
|
8435
|
+
PrebuiltVoiceConfigOrDict = Union[PrebuiltVoiceConfig, PrebuiltVoiceConfigDict]
|
|
8436
|
+
|
|
8437
|
+
|
|
8438
|
+
class VoiceConfig(_common.BaseModel):
|
|
8439
|
+
"""The configuration for the voice to use."""
|
|
8440
|
+
|
|
8441
|
+
prebuilt_voice_config: Optional[PrebuiltVoiceConfig] = Field(
|
|
8311
8442
|
default=None,
|
|
8312
|
-
description="""
|
|
8443
|
+
description="""The configuration for the prebuilt voice to use.""",
|
|
8313
8444
|
)
|
|
8314
|
-
|
|
8445
|
+
|
|
8446
|
+
|
|
8447
|
+
class VoiceConfigDict(TypedDict, total=False):
|
|
8448
|
+
"""The configuration for the voice to use."""
|
|
8449
|
+
|
|
8450
|
+
prebuilt_voice_config: Optional[PrebuiltVoiceConfigDict]
|
|
8451
|
+
"""The configuration for the prebuilt voice to use."""
|
|
8452
|
+
|
|
8453
|
+
|
|
8454
|
+
VoiceConfigOrDict = Union[VoiceConfig, VoiceConfigDict]
|
|
8455
|
+
|
|
8456
|
+
|
|
8457
|
+
class SpeakerVoiceConfig(_common.BaseModel):
|
|
8458
|
+
"""The configuration for a single speaker in a multi speaker setup.
|
|
8459
|
+
|
|
8460
|
+
This data type is not supported in Vertex AI.
|
|
8461
|
+
"""
|
|
8462
|
+
|
|
8463
|
+
speaker: Optional[str] = Field(
|
|
8464
|
+
default=None,
|
|
8465
|
+
description="""Required. The name of the speaker to use. Should be the same as in the prompt.""",
|
|
8466
|
+
)
|
|
8467
|
+
voice_config: Optional[VoiceConfig] = Field(
|
|
8315
8468
|
default=None,
|
|
8316
|
-
description="""
|
|
8469
|
+
description="""Required. The configuration for the voice to use.""",
|
|
8317
8470
|
)
|
|
8318
8471
|
|
|
8319
8472
|
|
|
8320
|
-
class
|
|
8321
|
-
"""
|
|
8473
|
+
class SpeakerVoiceConfigDict(TypedDict, total=False):
|
|
8474
|
+
"""The configuration for a single speaker in a multi speaker setup.
|
|
8322
8475
|
|
|
8323
|
-
|
|
8324
|
-
"""
|
|
8476
|
+
This data type is not supported in Vertex AI.
|
|
8477
|
+
"""
|
|
8325
8478
|
|
|
8326
|
-
|
|
8327
|
-
"""
|
|
8479
|
+
speaker: Optional[str]
|
|
8480
|
+
"""Required. The name of the speaker to use. Should be the same as in the prompt."""
|
|
8328
8481
|
|
|
8482
|
+
voice_config: Optional[VoiceConfigDict]
|
|
8483
|
+
"""Required. The configuration for the voice to use."""
|
|
8329
8484
|
|
|
8330
|
-
|
|
8331
|
-
|
|
8485
|
+
|
|
8486
|
+
SpeakerVoiceConfigOrDict = Union[SpeakerVoiceConfig, SpeakerVoiceConfigDict]
|
|
8487
|
+
|
|
8488
|
+
|
|
8489
|
+
class MultiSpeakerVoiceConfig(_common.BaseModel):
|
|
8490
|
+
"""The configuration for the multi-speaker setup.
|
|
8491
|
+
|
|
8492
|
+
This data type is not supported in Vertex AI.
|
|
8493
|
+
"""
|
|
8494
|
+
|
|
8495
|
+
speaker_voice_configs: Optional[list[SpeakerVoiceConfig]] = Field(
|
|
8496
|
+
default=None, description="""Required. All the enabled speaker voices."""
|
|
8497
|
+
)
|
|
8498
|
+
|
|
8499
|
+
|
|
8500
|
+
class MultiSpeakerVoiceConfigDict(TypedDict, total=False):
|
|
8501
|
+
"""The configuration for the multi-speaker setup.
|
|
8502
|
+
|
|
8503
|
+
This data type is not supported in Vertex AI.
|
|
8504
|
+
"""
|
|
8505
|
+
|
|
8506
|
+
speaker_voice_configs: Optional[list[SpeakerVoiceConfigDict]]
|
|
8507
|
+
"""Required. All the enabled speaker voices."""
|
|
8508
|
+
|
|
8509
|
+
|
|
8510
|
+
MultiSpeakerVoiceConfigOrDict = Union[
|
|
8511
|
+
MultiSpeakerVoiceConfig, MultiSpeakerVoiceConfigDict
|
|
8332
8512
|
]
|
|
8333
8513
|
|
|
8334
8514
|
|
|
@@ -8340,7 +8520,7 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8340
8520
|
)
|
|
8341
8521
|
audio_timestamp: Optional[bool] = Field(
|
|
8342
8522
|
default=None,
|
|
8343
|
-
description="""Optional. If enabled, audio timestamp will be included in the request to the model.""",
|
|
8523
|
+
description="""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API.""",
|
|
8344
8524
|
)
|
|
8345
8525
|
candidate_count: Optional[int] = Field(
|
|
8346
8526
|
default=None,
|
|
@@ -8348,7 +8528,7 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8348
8528
|
)
|
|
8349
8529
|
enable_affective_dialog: Optional[bool] = Field(
|
|
8350
8530
|
default=None,
|
|
8351
|
-
description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly.""",
|
|
8531
|
+
description="""Optional. If enabled, the model will detect emotions and adapt its responses accordingly. This field is not supported in Gemini API.""",
|
|
8352
8532
|
)
|
|
8353
8533
|
frequency_penalty: Optional[float] = Field(
|
|
8354
8534
|
default=None, description="""Optional. Frequency penalties."""
|
|
@@ -8387,7 +8567,8 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8387
8567
|
description="""Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response.""",
|
|
8388
8568
|
)
|
|
8389
8569
|
routing_config: Optional[GenerationConfigRoutingConfig] = Field(
|
|
8390
|
-
default=None,
|
|
8570
|
+
default=None,
|
|
8571
|
+
description="""Optional. Routing configuration. This field is not supported in Gemini API.""",
|
|
8391
8572
|
)
|
|
8392
8573
|
seed: Optional[int] = Field(default=None, description="""Optional. Seed.""")
|
|
8393
8574
|
speech_config: Optional[SpeechConfig] = Field(
|
|
@@ -8400,7 +8581,7 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8400
8581
|
default=None,
|
|
8401
8582
|
description="""Optional. Controls the randomness of predictions.""",
|
|
8402
8583
|
)
|
|
8403
|
-
thinking_config: Optional[
|
|
8584
|
+
thinking_config: Optional[ThinkingConfig] = Field(
|
|
8404
8585
|
default=None,
|
|
8405
8586
|
description="""Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking.""",
|
|
8406
8587
|
)
|
|
@@ -8412,6 +8593,10 @@ class GenerationConfig(_common.BaseModel):
|
|
|
8412
8593
|
default=None,
|
|
8413
8594
|
description="""Optional. If specified, nucleus sampling will be used.""",
|
|
8414
8595
|
)
|
|
8596
|
+
enable_enhanced_civic_answers: Optional[bool] = Field(
|
|
8597
|
+
default=None,
|
|
8598
|
+
description="""Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI.""",
|
|
8599
|
+
)
|
|
8415
8600
|
|
|
8416
8601
|
|
|
8417
8602
|
class GenerationConfigDict(TypedDict, total=False):
|
|
@@ -8421,13 +8606,13 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8421
8606
|
"""Optional. Config for model selection."""
|
|
8422
8607
|
|
|
8423
8608
|
audio_timestamp: Optional[bool]
|
|
8424
|
-
"""Optional. If enabled, audio timestamp will be included in the request to the model."""
|
|
8609
|
+
"""Optional. If enabled, audio timestamp will be included in the request to the model. This field is not supported in Gemini API."""
|
|
8425
8610
|
|
|
8426
8611
|
candidate_count: Optional[int]
|
|
8427
8612
|
"""Optional. Number of candidates to generate."""
|
|
8428
8613
|
|
|
8429
8614
|
enable_affective_dialog: Optional[bool]
|
|
8430
|
-
"""Optional. If enabled, the model will detect emotions and adapt its responses accordingly."""
|
|
8615
|
+
"""Optional. If enabled, the model will detect emotions and adapt its responses accordingly. This field is not supported in Gemini API."""
|
|
8431
8616
|
|
|
8432
8617
|
frequency_penalty: Optional[float]
|
|
8433
8618
|
"""Optional. Frequency penalties."""
|
|
@@ -8460,7 +8645,7 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8460
8645
|
"""Optional. The `Schema` object allows the definition of input and output data types. These types can be objects, but also primitives and arrays. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema). If set, a compatible response_mime_type must also be set. Compatible mimetypes: `application/json`: Schema for JSON response."""
|
|
8461
8646
|
|
|
8462
8647
|
routing_config: Optional[GenerationConfigRoutingConfigDict]
|
|
8463
|
-
"""Optional. Routing configuration."""
|
|
8648
|
+
"""Optional. Routing configuration. This field is not supported in Gemini API."""
|
|
8464
8649
|
|
|
8465
8650
|
seed: Optional[int]
|
|
8466
8651
|
"""Optional. Seed."""
|
|
@@ -8474,7 +8659,7 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8474
8659
|
temperature: Optional[float]
|
|
8475
8660
|
"""Optional. Controls the randomness of predictions."""
|
|
8476
8661
|
|
|
8477
|
-
thinking_config: Optional[
|
|
8662
|
+
thinking_config: Optional[ThinkingConfigDict]
|
|
8478
8663
|
"""Optional. Config for thinking features. An error will be returned if this field is set for models that don't support thinking."""
|
|
8479
8664
|
|
|
8480
8665
|
top_k: Optional[float]
|
|
@@ -8483,6 +8668,9 @@ class GenerationConfigDict(TypedDict, total=False):
|
|
|
8483
8668
|
top_p: Optional[float]
|
|
8484
8669
|
"""Optional. If specified, nucleus sampling will be used."""
|
|
8485
8670
|
|
|
8671
|
+
enable_enhanced_civic_answers: Optional[bool]
|
|
8672
|
+
"""Optional. Enables enhanced civic answers. It may not be available for all models. This field is not supported in Vertex AI."""
|
|
8673
|
+
|
|
8486
8674
|
|
|
8487
8675
|
GenerationConfigOrDict = Union[GenerationConfig, GenerationConfigDict]
|
|
8488
8676
|
|
|
@@ -9297,76 +9485,271 @@ class TunedModelCheckpoint(_common.BaseModel):
|
|
|
9297
9485
|
)
|
|
9298
9486
|
step: Optional[int] = Field(
|
|
9299
9487
|
default=None,
|
|
9300
|
-
description="""The step of the checkpoint.
|
|
9301
|
-
""",
|
|
9488
|
+
description="""The step of the checkpoint.
|
|
9489
|
+
""",
|
|
9490
|
+
)
|
|
9491
|
+
endpoint: Optional[str] = Field(
|
|
9492
|
+
default=None,
|
|
9493
|
+
description="""The Endpoint resource name that the checkpoint is deployed to.
|
|
9494
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9495
|
+
""",
|
|
9496
|
+
)
|
|
9497
|
+
|
|
9498
|
+
|
|
9499
|
+
class TunedModelCheckpointDict(TypedDict, total=False):
|
|
9500
|
+
"""TunedModelCheckpoint for the Tuned Model of a Tuning Job."""
|
|
9501
|
+
|
|
9502
|
+
checkpoint_id: Optional[str]
|
|
9503
|
+
"""The ID of the checkpoint.
|
|
9504
|
+
"""
|
|
9505
|
+
|
|
9506
|
+
epoch: Optional[int]
|
|
9507
|
+
"""The epoch of the checkpoint.
|
|
9508
|
+
"""
|
|
9509
|
+
|
|
9510
|
+
step: Optional[int]
|
|
9511
|
+
"""The step of the checkpoint.
|
|
9512
|
+
"""
|
|
9513
|
+
|
|
9514
|
+
endpoint: Optional[str]
|
|
9515
|
+
"""The Endpoint resource name that the checkpoint is deployed to.
|
|
9516
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9517
|
+
"""
|
|
9518
|
+
|
|
9519
|
+
|
|
9520
|
+
TunedModelCheckpointOrDict = Union[
|
|
9521
|
+
TunedModelCheckpoint, TunedModelCheckpointDict
|
|
9522
|
+
]
|
|
9523
|
+
|
|
9524
|
+
|
|
9525
|
+
class TunedModel(_common.BaseModel):
|
|
9526
|
+
"""TunedModel for the Tuned Model of a Tuning Job."""
|
|
9527
|
+
|
|
9528
|
+
model: Optional[str] = Field(
|
|
9529
|
+
default=None,
|
|
9530
|
+
description="""Output only. The resource name of the TunedModel.
|
|
9531
|
+
Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
|
|
9532
|
+
When tuning from a base model, the version_id will be 1.
|
|
9533
|
+
For continuous tuning, the version id will be incremented by 1 from the
|
|
9534
|
+
last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
|
|
9535
|
+
""",
|
|
9536
|
+
)
|
|
9537
|
+
endpoint: Optional[str] = Field(
|
|
9538
|
+
default=None,
|
|
9539
|
+
description="""Output only. A resource name of an Endpoint.
|
|
9540
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9541
|
+
""",
|
|
9542
|
+
)
|
|
9543
|
+
checkpoints: Optional[list[TunedModelCheckpoint]] = Field(
|
|
9544
|
+
default=None,
|
|
9545
|
+
description="""The checkpoints associated with this TunedModel.
|
|
9546
|
+
This field is only populated for tuning jobs that enable intermediate
|
|
9547
|
+
checkpoints.""",
|
|
9548
|
+
)
|
|
9549
|
+
|
|
9550
|
+
|
|
9551
|
+
class TunedModelDict(TypedDict, total=False):
|
|
9552
|
+
"""TunedModel for the Tuned Model of a Tuning Job."""
|
|
9553
|
+
|
|
9554
|
+
model: Optional[str]
|
|
9555
|
+
"""Output only. The resource name of the TunedModel.
|
|
9556
|
+
Format: `projects/{project}/locations/{location}/models/{model}@{version_id}`
|
|
9557
|
+
When tuning from a base model, the version_id will be 1.
|
|
9558
|
+
For continuous tuning, the version id will be incremented by 1 from the
|
|
9559
|
+
last version id in the parent model. E.g., `projects/{project}/locations/{location}/models/{model}@{last_version_id + 1}`
|
|
9560
|
+
"""
|
|
9561
|
+
|
|
9562
|
+
endpoint: Optional[str]
|
|
9563
|
+
"""Output only. A resource name of an Endpoint.
|
|
9564
|
+
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9565
|
+
"""
|
|
9566
|
+
|
|
9567
|
+
checkpoints: Optional[list[TunedModelCheckpointDict]]
|
|
9568
|
+
"""The checkpoints associated with this TunedModel.
|
|
9569
|
+
This field is only populated for tuning jobs that enable intermediate
|
|
9570
|
+
checkpoints."""
|
|
9571
|
+
|
|
9572
|
+
|
|
9573
|
+
TunedModelOrDict = Union[TunedModel, TunedModelDict]
|
|
9574
|
+
|
|
9575
|
+
|
|
9576
|
+
class SupervisedHyperParameters(_common.BaseModel):
|
|
9577
|
+
"""Hyperparameters for SFT. This data type is not supported in Gemini API."""
|
|
9578
|
+
|
|
9579
|
+
adapter_size: Optional[AdapterSize] = Field(
|
|
9580
|
+
default=None, description="""Optional. Adapter size for tuning."""
|
|
9581
|
+
)
|
|
9582
|
+
batch_size: Optional[int] = Field(
|
|
9583
|
+
default=None,
|
|
9584
|
+
description="""Optional. Batch size for tuning. This feature is only available for open source models.""",
|
|
9585
|
+
)
|
|
9586
|
+
epoch_count: Optional[int] = Field(
|
|
9587
|
+
default=None,
|
|
9588
|
+
description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
|
|
9589
|
+
)
|
|
9590
|
+
learning_rate: Optional[float] = Field(
|
|
9591
|
+
default=None,
|
|
9592
|
+
description="""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models.""",
|
|
9593
|
+
)
|
|
9594
|
+
learning_rate_multiplier: Optional[float] = Field(
|
|
9595
|
+
default=None,
|
|
9596
|
+
description="""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models.""",
|
|
9597
|
+
)
|
|
9598
|
+
|
|
9599
|
+
|
|
9600
|
+
class SupervisedHyperParametersDict(TypedDict, total=False):
|
|
9601
|
+
"""Hyperparameters for SFT. This data type is not supported in Gemini API."""
|
|
9602
|
+
|
|
9603
|
+
adapter_size: Optional[AdapterSize]
|
|
9604
|
+
"""Optional. Adapter size for tuning."""
|
|
9605
|
+
|
|
9606
|
+
batch_size: Optional[int]
|
|
9607
|
+
"""Optional. Batch size for tuning. This feature is only available for open source models."""
|
|
9608
|
+
|
|
9609
|
+
epoch_count: Optional[int]
|
|
9610
|
+
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
|
9611
|
+
|
|
9612
|
+
learning_rate: Optional[float]
|
|
9613
|
+
"""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models."""
|
|
9614
|
+
|
|
9615
|
+
learning_rate_multiplier: Optional[float]
|
|
9616
|
+
"""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models."""
|
|
9617
|
+
|
|
9618
|
+
|
|
9619
|
+
SupervisedHyperParametersOrDict = Union[
|
|
9620
|
+
SupervisedHyperParameters, SupervisedHyperParametersDict
|
|
9621
|
+
]
|
|
9622
|
+
|
|
9623
|
+
|
|
9624
|
+
class SupervisedTuningSpec(_common.BaseModel):
|
|
9625
|
+
"""Supervised tuning spec for tuning."""
|
|
9626
|
+
|
|
9627
|
+
export_last_checkpoint_only: Optional[bool] = Field(
|
|
9628
|
+
default=None,
|
|
9629
|
+
description="""Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false.""",
|
|
9630
|
+
)
|
|
9631
|
+
hyper_parameters: Optional[SupervisedHyperParameters] = Field(
|
|
9632
|
+
default=None, description="""Optional. Hyperparameters for SFT."""
|
|
9633
|
+
)
|
|
9634
|
+
training_dataset_uri: Optional[str] = Field(
|
|
9635
|
+
default=None,
|
|
9636
|
+
description="""Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.""",
|
|
9637
|
+
)
|
|
9638
|
+
tuning_mode: Optional[TuningMode] = Field(
|
|
9639
|
+
default=None, description="""Tuning mode."""
|
|
9640
|
+
)
|
|
9641
|
+
validation_dataset_uri: Optional[str] = Field(
|
|
9642
|
+
default=None,
|
|
9643
|
+
description="""Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset.""",
|
|
9644
|
+
)
|
|
9645
|
+
|
|
9646
|
+
|
|
9647
|
+
class SupervisedTuningSpecDict(TypedDict, total=False):
|
|
9648
|
+
"""Supervised tuning spec for tuning."""
|
|
9649
|
+
|
|
9650
|
+
export_last_checkpoint_only: Optional[bool]
|
|
9651
|
+
"""Optional. If set to true, disable intermediate checkpoints for SFT and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints for SFT. Default is false."""
|
|
9652
|
+
|
|
9653
|
+
hyper_parameters: Optional[SupervisedHyperParametersDict]
|
|
9654
|
+
"""Optional. Hyperparameters for SFT."""
|
|
9655
|
+
|
|
9656
|
+
training_dataset_uri: Optional[str]
|
|
9657
|
+
"""Required. Training dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset."""
|
|
9658
|
+
|
|
9659
|
+
tuning_mode: Optional[TuningMode]
|
|
9660
|
+
"""Tuning mode."""
|
|
9661
|
+
|
|
9662
|
+
validation_dataset_uri: Optional[str]
|
|
9663
|
+
"""Optional. Validation dataset used for tuning. The dataset can be specified as either a Cloud Storage path to a JSONL file or as the resource name of a Vertex Multimodal Dataset."""
|
|
9664
|
+
|
|
9665
|
+
|
|
9666
|
+
SupervisedTuningSpecOrDict = Union[
|
|
9667
|
+
SupervisedTuningSpec, SupervisedTuningSpecDict
|
|
9668
|
+
]
|
|
9669
|
+
|
|
9670
|
+
|
|
9671
|
+
class PreferenceOptimizationHyperParameters(_common.BaseModel):
|
|
9672
|
+
"""Hyperparameters for Preference Optimization.
|
|
9673
|
+
|
|
9674
|
+
This data type is not supported in Gemini API.
|
|
9675
|
+
"""
|
|
9676
|
+
|
|
9677
|
+
adapter_size: Optional[AdapterSize] = Field(
|
|
9678
|
+
default=None,
|
|
9679
|
+
description="""Optional. Adapter size for preference optimization.""",
|
|
9680
|
+
)
|
|
9681
|
+
beta: Optional[float] = Field(
|
|
9682
|
+
default=None,
|
|
9683
|
+
description="""Optional. Weight for KL Divergence regularization.""",
|
|
9684
|
+
)
|
|
9685
|
+
epoch_count: Optional[int] = Field(
|
|
9686
|
+
default=None,
|
|
9687
|
+
description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
|
|
9302
9688
|
)
|
|
9303
|
-
|
|
9689
|
+
learning_rate_multiplier: Optional[float] = Field(
|
|
9304
9690
|
default=None,
|
|
9305
|
-
description="""
|
|
9306
|
-
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9307
|
-
""",
|
|
9691
|
+
description="""Optional. Multiplier for adjusting the default learning rate.""",
|
|
9308
9692
|
)
|
|
9309
9693
|
|
|
9310
9694
|
|
|
9311
|
-
class
|
|
9312
|
-
"""
|
|
9695
|
+
class PreferenceOptimizationHyperParametersDict(TypedDict, total=False):
|
|
9696
|
+
"""Hyperparameters for Preference Optimization.
|
|
9313
9697
|
|
|
9314
|
-
|
|
9315
|
-
"""
|
|
9316
|
-
"""
|
|
9698
|
+
This data type is not supported in Gemini API.
|
|
9699
|
+
"""
|
|
9317
9700
|
|
|
9318
|
-
|
|
9319
|
-
"""
|
|
9320
|
-
"""
|
|
9701
|
+
adapter_size: Optional[AdapterSize]
|
|
9702
|
+
"""Optional. Adapter size for preference optimization."""
|
|
9321
9703
|
|
|
9322
|
-
|
|
9323
|
-
"""
|
|
9324
|
-
"""
|
|
9704
|
+
beta: Optional[float]
|
|
9705
|
+
"""Optional. Weight for KL Divergence regularization."""
|
|
9325
9706
|
|
|
9326
|
-
|
|
9327
|
-
"""
|
|
9328
|
-
Format: `projects/{project}/locations/{location}/endpoints/{endpoint}`.
|
|
9329
|
-
"""
|
|
9707
|
+
epoch_count: Optional[int]
|
|
9708
|
+
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
|
9330
9709
|
|
|
9710
|
+
learning_rate_multiplier: Optional[float]
|
|
9711
|
+
"""Optional. Multiplier for adjusting the default learning rate."""
|
|
9331
9712
|
|
|
9332
|
-
|
|
9333
|
-
|
|
9713
|
+
|
|
9714
|
+
PreferenceOptimizationHyperParametersOrDict = Union[
|
|
9715
|
+
PreferenceOptimizationHyperParameters,
|
|
9716
|
+
PreferenceOptimizationHyperParametersDict,
|
|
9334
9717
|
]
|
|
9335
9718
|
|
|
9336
9719
|
|
|
9337
|
-
class
|
|
9720
|
+
class PreferenceOptimizationSpec(_common.BaseModel):
|
|
9721
|
+
"""Preference optimization tuning spec for tuning."""
|
|
9338
9722
|
|
|
9339
|
-
|
|
9723
|
+
hyper_parameters: Optional[PreferenceOptimizationHyperParameters] = Field(
|
|
9340
9724
|
default=None,
|
|
9341
|
-
description="""
|
|
9725
|
+
description="""Optional. Hyperparameters for Preference Optimization.""",
|
|
9342
9726
|
)
|
|
9343
|
-
|
|
9727
|
+
training_dataset_uri: Optional[str] = Field(
|
|
9344
9728
|
default=None,
|
|
9345
|
-
description="""
|
|
9729
|
+
description="""Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file.""",
|
|
9346
9730
|
)
|
|
9347
|
-
|
|
9731
|
+
validation_dataset_uri: Optional[str] = Field(
|
|
9348
9732
|
default=None,
|
|
9349
|
-
description="""The
|
|
9350
|
-
This field is only populated for tuning jobs that enable intermediate
|
|
9351
|
-
checkpoints.""",
|
|
9733
|
+
description="""Optional. Cloud Storage path to file containing validation dataset for preference optimization tuning. The dataset must be formatted as a JSONL file.""",
|
|
9352
9734
|
)
|
|
9353
9735
|
|
|
9354
9736
|
|
|
9355
|
-
class
|
|
9737
|
+
class PreferenceOptimizationSpecDict(TypedDict, total=False):
|
|
9738
|
+
"""Preference optimization tuning spec for tuning."""
|
|
9356
9739
|
|
|
9357
|
-
|
|
9358
|
-
"""
|
|
9740
|
+
hyper_parameters: Optional[PreferenceOptimizationHyperParametersDict]
|
|
9741
|
+
"""Optional. Hyperparameters for Preference Optimization."""
|
|
9359
9742
|
|
|
9360
|
-
|
|
9361
|
-
"""
|
|
9743
|
+
training_dataset_uri: Optional[str]
|
|
9744
|
+
"""Required. Cloud Storage path to file containing training dataset for preference optimization tuning. The dataset must be formatted as a JSONL file."""
|
|
9362
9745
|
|
|
9363
|
-
|
|
9364
|
-
"""The
|
|
9365
|
-
This field is only populated for tuning jobs that enable intermediate
|
|
9366
|
-
checkpoints."""
|
|
9746
|
+
validation_dataset_uri: Optional[str]
|
|
9747
|
+
"""Optional. Cloud Storage path to file containing validation dataset for preference optimization tuning. The dataset must be formatted as a JSONL file."""
|
|
9367
9748
|
|
|
9368
9749
|
|
|
9369
|
-
|
|
9750
|
+
PreferenceOptimizationSpecOrDict = Union[
|
|
9751
|
+
PreferenceOptimizationSpec, PreferenceOptimizationSpecDict
|
|
9752
|
+
]
|
|
9370
9753
|
|
|
9371
9754
|
|
|
9372
9755
|
class GcsDestination(_common.BaseModel):
|
|
@@ -9643,7 +10026,8 @@ class GoogleRpcStatus(_common.BaseModel):
|
|
|
9643
10026
|
It is used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
9644
10027
|
three pieces of data: error code, error message, and error details. You can
|
|
9645
10028
|
find out more about this error model and how to work with it in the [API
|
|
9646
|
-
Design Guide](https://cloud.google.com/apis/design/errors).
|
|
10029
|
+
Design Guide](https://cloud.google.com/apis/design/errors). This data type is
|
|
10030
|
+
not supported in Gemini API.
|
|
9647
10031
|
"""
|
|
9648
10032
|
|
|
9649
10033
|
code: Optional[int] = Field(
|
|
@@ -9666,7 +10050,8 @@ class GoogleRpcStatusDict(TypedDict, total=False):
|
|
|
9666
10050
|
It is used by [gRPC](https://github.com/grpc). Each `Status` message contains
|
|
9667
10051
|
three pieces of data: error code, error message, and error details. You can
|
|
9668
10052
|
find out more about this error model and how to work with it in the [API
|
|
9669
|
-
Design Guide](https://cloud.google.com/apis/design/errors).
|
|
10053
|
+
Design Guide](https://cloud.google.com/apis/design/errors). This data type is
|
|
10054
|
+
not supported in Gemini API.
|
|
9670
10055
|
"""
|
|
9671
10056
|
|
|
9672
10057
|
code: Optional[int]
|
|
@@ -9683,7 +10068,10 @@ GoogleRpcStatusOrDict = Union[GoogleRpcStatus, GoogleRpcStatusDict]
|
|
|
9683
10068
|
|
|
9684
10069
|
|
|
9685
10070
|
class PreTunedModel(_common.BaseModel):
|
|
9686
|
-
"""A pre-tuned model for continuous tuning.
|
|
10071
|
+
"""A pre-tuned model for continuous tuning.
|
|
10072
|
+
|
|
10073
|
+
This data type is not supported in Gemini API.
|
|
10074
|
+
"""
|
|
9687
10075
|
|
|
9688
10076
|
base_model: Optional[str] = Field(
|
|
9689
10077
|
default=None,
|
|
@@ -9700,7 +10088,10 @@ class PreTunedModel(_common.BaseModel):
|
|
|
9700
10088
|
|
|
9701
10089
|
|
|
9702
10090
|
class PreTunedModelDict(TypedDict, total=False):
|
|
9703
|
-
"""A pre-tuned model for continuous tuning.
|
|
10091
|
+
"""A pre-tuned model for continuous tuning.
|
|
10092
|
+
|
|
10093
|
+
This data type is not supported in Gemini API.
|
|
10094
|
+
"""
|
|
9704
10095
|
|
|
9705
10096
|
base_model: Optional[str]
|
|
9706
10097
|
"""Output only. The name of the base model this PreTunedModel was tuned from."""
|
|
@@ -9715,103 +10106,11 @@ class PreTunedModelDict(TypedDict, total=False):
|
|
|
9715
10106
|
PreTunedModelOrDict = Union[PreTunedModel, PreTunedModelDict]
|
|
9716
10107
|
|
|
9717
10108
|
|
|
9718
|
-
class SupervisedHyperParameters(_common.BaseModel):
|
|
9719
|
-
"""Hyperparameters for SFT."""
|
|
9720
|
-
|
|
9721
|
-
adapter_size: Optional[AdapterSize] = Field(
|
|
9722
|
-
default=None, description="""Optional. Adapter size for tuning."""
|
|
9723
|
-
)
|
|
9724
|
-
batch_size: Optional[int] = Field(
|
|
9725
|
-
default=None,
|
|
9726
|
-
description="""Optional. Batch size for tuning. This feature is only available for open source models.""",
|
|
9727
|
-
)
|
|
9728
|
-
epoch_count: Optional[int] = Field(
|
|
9729
|
-
default=None,
|
|
9730
|
-
description="""Optional. Number of complete passes the model makes over the entire training dataset during training.""",
|
|
9731
|
-
)
|
|
9732
|
-
learning_rate: Optional[float] = Field(
|
|
9733
|
-
default=None,
|
|
9734
|
-
description="""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models.""",
|
|
9735
|
-
)
|
|
9736
|
-
learning_rate_multiplier: Optional[float] = Field(
|
|
9737
|
-
default=None,
|
|
9738
|
-
description="""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models.""",
|
|
9739
|
-
)
|
|
9740
|
-
|
|
9741
|
-
|
|
9742
|
-
class SupervisedHyperParametersDict(TypedDict, total=False):
|
|
9743
|
-
"""Hyperparameters for SFT."""
|
|
9744
|
-
|
|
9745
|
-
adapter_size: Optional[AdapterSize]
|
|
9746
|
-
"""Optional. Adapter size for tuning."""
|
|
9747
|
-
|
|
9748
|
-
batch_size: Optional[int]
|
|
9749
|
-
"""Optional. Batch size for tuning. This feature is only available for open source models."""
|
|
9750
|
-
|
|
9751
|
-
epoch_count: Optional[int]
|
|
9752
|
-
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
|
9753
|
-
|
|
9754
|
-
learning_rate: Optional[float]
|
|
9755
|
-
"""Optional. Learning rate for tuning. Mutually exclusive with `learning_rate_multiplier`. This feature is only available for open source models."""
|
|
9756
|
-
|
|
9757
|
-
learning_rate_multiplier: Optional[float]
|
|
9758
|
-
"""Optional. Multiplier for adjusting the default learning rate. Mutually exclusive with `learning_rate`. This feature is only available for 1P models."""
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
SupervisedHyperParametersOrDict = Union[
|
|
9762
|
-
SupervisedHyperParameters, SupervisedHyperParametersDict
|
|
9763
|
-
]
|
|
9764
|
-
|
|
9765
|
-
|
|
9766
|
-
class SupervisedTuningSpec(_common.BaseModel):
|
|
9767
|
-
"""Tuning Spec for Supervised Tuning for first party models."""
|
|
9768
|
-
|
|
9769
|
-
export_last_checkpoint_only: Optional[bool] = Field(
|
|
9770
|
-
default=None,
|
|
9771
|
-
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.""",
|
|
9772
|
-
)
|
|
9773
|
-
hyper_parameters: Optional[SupervisedHyperParameters] = Field(
|
|
9774
|
-
default=None, description="""Optional. Hyperparameters for SFT."""
|
|
9775
|
-
)
|
|
9776
|
-
training_dataset_uri: Optional[str] = Field(
|
|
9777
|
-
default=None,
|
|
9778
|
-
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.""",
|
|
9779
|
-
)
|
|
9780
|
-
tuning_mode: Optional[TuningMode] = Field(
|
|
9781
|
-
default=None, description="""Tuning mode."""
|
|
9782
|
-
)
|
|
9783
|
-
validation_dataset_uri: Optional[str] = Field(
|
|
9784
|
-
default=None,
|
|
9785
|
-
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.""",
|
|
9786
|
-
)
|
|
9787
|
-
|
|
9788
|
-
|
|
9789
|
-
class SupervisedTuningSpecDict(TypedDict, total=False):
|
|
9790
|
-
"""Tuning Spec for Supervised Tuning for first party models."""
|
|
9791
|
-
|
|
9792
|
-
export_last_checkpoint_only: Optional[bool]
|
|
9793
|
-
"""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."""
|
|
9794
|
-
|
|
9795
|
-
hyper_parameters: Optional[SupervisedHyperParametersDict]
|
|
9796
|
-
"""Optional. Hyperparameters for SFT."""
|
|
9797
|
-
|
|
9798
|
-
training_dataset_uri: Optional[str]
|
|
9799
|
-
"""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."""
|
|
9800
|
-
|
|
9801
|
-
tuning_mode: Optional[TuningMode]
|
|
9802
|
-
"""Tuning mode."""
|
|
9803
|
-
|
|
9804
|
-
validation_dataset_uri: Optional[str]
|
|
9805
|
-
"""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."""
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
SupervisedTuningSpecOrDict = Union[
|
|
9809
|
-
SupervisedTuningSpec, SupervisedTuningSpecDict
|
|
9810
|
-
]
|
|
9811
|
-
|
|
9812
|
-
|
|
9813
10109
|
class DatasetDistributionDistributionBucket(_common.BaseModel):
|
|
9814
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10110
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10111
|
+
|
|
10112
|
+
This data type is not supported in Gemini API.
|
|
10113
|
+
"""
|
|
9815
10114
|
|
|
9816
10115
|
count: Optional[int] = Field(
|
|
9817
10116
|
default=None,
|
|
@@ -9826,7 +10125,10 @@ class DatasetDistributionDistributionBucket(_common.BaseModel):
|
|
|
9826
10125
|
|
|
9827
10126
|
|
|
9828
10127
|
class DatasetDistributionDistributionBucketDict(TypedDict, total=False):
|
|
9829
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10128
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10129
|
+
|
|
10130
|
+
This data type is not supported in Gemini API.
|
|
10131
|
+
"""
|
|
9830
10132
|
|
|
9831
10133
|
count: Optional[int]
|
|
9832
10134
|
"""Output only. Number of values in the bucket."""
|
|
@@ -9845,7 +10147,10 @@ DatasetDistributionDistributionBucketOrDict = Union[
|
|
|
9845
10147
|
|
|
9846
10148
|
|
|
9847
10149
|
class DatasetDistribution(_common.BaseModel):
|
|
9848
|
-
"""Distribution computed over a tuning dataset.
|
|
10150
|
+
"""Distribution computed over a tuning dataset.
|
|
10151
|
+
|
|
10152
|
+
This data type is not supported in Gemini API.
|
|
10153
|
+
"""
|
|
9849
10154
|
|
|
9850
10155
|
buckets: Optional[list[DatasetDistributionDistributionBucket]] = Field(
|
|
9851
10156
|
default=None, description="""Output only. Defines the histogram bucket."""
|
|
@@ -9881,7 +10186,10 @@ class DatasetDistribution(_common.BaseModel):
|
|
|
9881
10186
|
|
|
9882
10187
|
|
|
9883
10188
|
class DatasetDistributionDict(TypedDict, total=False):
|
|
9884
|
-
"""Distribution computed over a tuning dataset.
|
|
10189
|
+
"""Distribution computed over a tuning dataset.
|
|
10190
|
+
|
|
10191
|
+
This data type is not supported in Gemini API.
|
|
10192
|
+
"""
|
|
9885
10193
|
|
|
9886
10194
|
buckets: Optional[list[DatasetDistributionDistributionBucketDict]]
|
|
9887
10195
|
"""Output only. Defines the histogram bucket."""
|
|
@@ -9912,7 +10220,10 @@ DatasetDistributionOrDict = Union[DatasetDistribution, DatasetDistributionDict]
|
|
|
9912
10220
|
|
|
9913
10221
|
|
|
9914
10222
|
class DatasetStats(_common.BaseModel):
|
|
9915
|
-
"""Statistics computed over a tuning dataset.
|
|
10223
|
+
"""Statistics computed over a tuning dataset.
|
|
10224
|
+
|
|
10225
|
+
This data type is not supported in Gemini API.
|
|
10226
|
+
"""
|
|
9916
10227
|
|
|
9917
10228
|
total_billable_character_count: Optional[int] = Field(
|
|
9918
10229
|
default=None,
|
|
@@ -9949,7 +10260,10 @@ class DatasetStats(_common.BaseModel):
|
|
|
9949
10260
|
|
|
9950
10261
|
|
|
9951
10262
|
class DatasetStatsDict(TypedDict, total=False):
|
|
9952
|
-
"""Statistics computed over a tuning dataset.
|
|
10263
|
+
"""Statistics computed over a tuning dataset.
|
|
10264
|
+
|
|
10265
|
+
This data type is not supported in Gemini API.
|
|
10266
|
+
"""
|
|
9953
10267
|
|
|
9954
10268
|
total_billable_character_count: Optional[int]
|
|
9955
10269
|
"""Output only. Number of billable characters in the tuning dataset."""
|
|
@@ -9980,7 +10294,10 @@ DatasetStatsOrDict = Union[DatasetStats, DatasetStatsDict]
|
|
|
9980
10294
|
|
|
9981
10295
|
|
|
9982
10296
|
class DistillationDataStats(_common.BaseModel):
|
|
9983
|
-
"""Statistics computed for datasets used for distillation.
|
|
10297
|
+
"""Statistics computed for datasets used for distillation.
|
|
10298
|
+
|
|
10299
|
+
This data type is not supported in Gemini API.
|
|
10300
|
+
"""
|
|
9984
10301
|
|
|
9985
10302
|
training_dataset_stats: Optional[DatasetStats] = Field(
|
|
9986
10303
|
default=None,
|
|
@@ -9989,7 +10306,10 @@ class DistillationDataStats(_common.BaseModel):
|
|
|
9989
10306
|
|
|
9990
10307
|
|
|
9991
10308
|
class DistillationDataStatsDict(TypedDict, total=False):
|
|
9992
|
-
"""Statistics computed for datasets used for distillation.
|
|
10309
|
+
"""Statistics computed for datasets used for distillation.
|
|
10310
|
+
|
|
10311
|
+
This data type is not supported in Gemini API.
|
|
10312
|
+
"""
|
|
9993
10313
|
|
|
9994
10314
|
training_dataset_stats: Optional[DatasetStatsDict]
|
|
9995
10315
|
"""Output only. Statistics computed for the training dataset."""
|
|
@@ -10001,7 +10321,10 @@ DistillationDataStatsOrDict = Union[
|
|
|
10001
10321
|
|
|
10002
10322
|
|
|
10003
10323
|
class GeminiPreferenceExampleCompletion(_common.BaseModel):
|
|
10004
|
-
"""Completion and its preference score.
|
|
10324
|
+
"""Completion and its preference score.
|
|
10325
|
+
|
|
10326
|
+
This data type is not supported in Gemini API.
|
|
10327
|
+
"""
|
|
10005
10328
|
|
|
10006
10329
|
completion: Optional[Content] = Field(
|
|
10007
10330
|
default=None,
|
|
@@ -10013,7 +10336,10 @@ class GeminiPreferenceExampleCompletion(_common.BaseModel):
|
|
|
10013
10336
|
|
|
10014
10337
|
|
|
10015
10338
|
class GeminiPreferenceExampleCompletionDict(TypedDict, total=False):
|
|
10016
|
-
"""Completion and its preference score.
|
|
10339
|
+
"""Completion and its preference score.
|
|
10340
|
+
|
|
10341
|
+
This data type is not supported in Gemini API.
|
|
10342
|
+
"""
|
|
10017
10343
|
|
|
10018
10344
|
completion: Optional[ContentDict]
|
|
10019
10345
|
"""Single turn completion for the given prompt."""
|
|
@@ -10028,7 +10354,10 @@ GeminiPreferenceExampleCompletionOrDict = Union[
|
|
|
10028
10354
|
|
|
10029
10355
|
|
|
10030
10356
|
class GeminiPreferenceExample(_common.BaseModel):
|
|
10031
|
-
"""Input example for preference optimization.
|
|
10357
|
+
"""Input example for preference optimization.
|
|
10358
|
+
|
|
10359
|
+
This data type is not supported in Gemini API.
|
|
10360
|
+
"""
|
|
10032
10361
|
|
|
10033
10362
|
completions: Optional[list[GeminiPreferenceExampleCompletion]] = Field(
|
|
10034
10363
|
default=None, description="""List of completions for a given prompt."""
|
|
@@ -10040,7 +10369,10 @@ class GeminiPreferenceExample(_common.BaseModel):
|
|
|
10040
10369
|
|
|
10041
10370
|
|
|
10042
10371
|
class GeminiPreferenceExampleDict(TypedDict, total=False):
|
|
10043
|
-
"""Input example for preference optimization.
|
|
10372
|
+
"""Input example for preference optimization.
|
|
10373
|
+
|
|
10374
|
+
This data type is not supported in Gemini API.
|
|
10375
|
+
"""
|
|
10044
10376
|
|
|
10045
10377
|
completions: Optional[list[GeminiPreferenceExampleCompletionDict]]
|
|
10046
10378
|
"""List of completions for a given prompt."""
|
|
@@ -10055,7 +10387,10 @@ GeminiPreferenceExampleOrDict = Union[
|
|
|
10055
10387
|
|
|
10056
10388
|
|
|
10057
10389
|
class PreferenceOptimizationDataStats(_common.BaseModel):
|
|
10058
|
-
"""Statistics computed for datasets used for preference optimization.
|
|
10390
|
+
"""Statistics computed for datasets used for preference optimization.
|
|
10391
|
+
|
|
10392
|
+
This data type is not supported in Gemini API.
|
|
10393
|
+
"""
|
|
10059
10394
|
|
|
10060
10395
|
score_variance_per_example_distribution: Optional[DatasetDistribution] = (
|
|
10061
10396
|
Field(
|
|
@@ -10094,7 +10429,10 @@ class PreferenceOptimizationDataStats(_common.BaseModel):
|
|
|
10094
10429
|
|
|
10095
10430
|
|
|
10096
10431
|
class PreferenceOptimizationDataStatsDict(TypedDict, total=False):
|
|
10097
|
-
"""Statistics computed for datasets used for preference optimization.
|
|
10432
|
+
"""Statistics computed for datasets used for preference optimization.
|
|
10433
|
+
|
|
10434
|
+
This data type is not supported in Gemini API.
|
|
10435
|
+
"""
|
|
10098
10436
|
|
|
10099
10437
|
score_variance_per_example_distribution: Optional[DatasetDistributionDict]
|
|
10100
10438
|
"""Output only. Dataset distributions for scores variance per example."""
|
|
@@ -10127,7 +10465,10 @@ PreferenceOptimizationDataStatsOrDict = Union[
|
|
|
10127
10465
|
|
|
10128
10466
|
|
|
10129
10467
|
class SupervisedTuningDatasetDistributionDatasetBucket(_common.BaseModel):
|
|
10130
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10468
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10469
|
+
|
|
10470
|
+
This data type is not supported in Gemini API.
|
|
10471
|
+
"""
|
|
10131
10472
|
|
|
10132
10473
|
count: Optional[float] = Field(
|
|
10133
10474
|
default=None,
|
|
@@ -10144,7 +10485,10 @@ class SupervisedTuningDatasetDistributionDatasetBucket(_common.BaseModel):
|
|
|
10144
10485
|
class SupervisedTuningDatasetDistributionDatasetBucketDict(
|
|
10145
10486
|
TypedDict, total=False
|
|
10146
10487
|
):
|
|
10147
|
-
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10488
|
+
"""Dataset bucket used to create a histogram for the distribution given a population of values.
|
|
10489
|
+
|
|
10490
|
+
This data type is not supported in Gemini API.
|
|
10491
|
+
"""
|
|
10148
10492
|
|
|
10149
10493
|
count: Optional[float]
|
|
10150
10494
|
"""Output only. Number of values in the bucket."""
|
|
@@ -10163,7 +10507,10 @@ SupervisedTuningDatasetDistributionDatasetBucketOrDict = Union[
|
|
|
10163
10507
|
|
|
10164
10508
|
|
|
10165
10509
|
class SupervisedTuningDatasetDistribution(_common.BaseModel):
|
|
10166
|
-
"""Dataset distribution for Supervised Tuning.
|
|
10510
|
+
"""Dataset distribution for Supervised Tuning.
|
|
10511
|
+
|
|
10512
|
+
This data type is not supported in Gemini API.
|
|
10513
|
+
"""
|
|
10167
10514
|
|
|
10168
10515
|
billable_sum: Optional[int] = Field(
|
|
10169
10516
|
default=None,
|
|
@@ -10206,7 +10553,10 @@ class SupervisedTuningDatasetDistribution(_common.BaseModel):
|
|
|
10206
10553
|
|
|
10207
10554
|
|
|
10208
10555
|
class SupervisedTuningDatasetDistributionDict(TypedDict, total=False):
|
|
10209
|
-
"""Dataset distribution for Supervised Tuning.
|
|
10556
|
+
"""Dataset distribution for Supervised Tuning.
|
|
10557
|
+
|
|
10558
|
+
This data type is not supported in Gemini API.
|
|
10559
|
+
"""
|
|
10210
10560
|
|
|
10211
10561
|
billable_sum: Optional[int]
|
|
10212
10562
|
"""Output only. Sum of a given population of values that are billable."""
|
|
@@ -10242,7 +10592,10 @@ SupervisedTuningDatasetDistributionOrDict = Union[
|
|
|
10242
10592
|
|
|
10243
10593
|
|
|
10244
10594
|
class SupervisedTuningDataStats(_common.BaseModel):
|
|
10245
|
-
"""Tuning data statistics for Supervised Tuning.
|
|
10595
|
+
"""Tuning data statistics for Supervised Tuning.
|
|
10596
|
+
|
|
10597
|
+
This data type is not supported in Gemini API.
|
|
10598
|
+
"""
|
|
10246
10599
|
|
|
10247
10600
|
dropped_example_reasons: Optional[list[str]] = Field(
|
|
10248
10601
|
default=None,
|
|
@@ -10301,7 +10654,10 @@ class SupervisedTuningDataStats(_common.BaseModel):
|
|
|
10301
10654
|
|
|
10302
10655
|
|
|
10303
10656
|
class SupervisedTuningDataStatsDict(TypedDict, total=False):
|
|
10304
|
-
"""Tuning data statistics for Supervised Tuning.
|
|
10657
|
+
"""Tuning data statistics for Supervised Tuning.
|
|
10658
|
+
|
|
10659
|
+
This data type is not supported in Gemini API.
|
|
10660
|
+
"""
|
|
10305
10661
|
|
|
10306
10662
|
dropped_example_reasons: Optional[list[str]]
|
|
10307
10663
|
"""Output only. For each index in `truncated_example_indices`, the user-facing reason why the example was dropped."""
|
|
@@ -10352,7 +10708,10 @@ SupervisedTuningDataStatsOrDict = Union[
|
|
|
10352
10708
|
|
|
10353
10709
|
|
|
10354
10710
|
class TuningDataStats(_common.BaseModel):
|
|
10355
|
-
"""The tuning data statistic values for TuningJob.
|
|
10711
|
+
"""The tuning data statistic values for TuningJob.
|
|
10712
|
+
|
|
10713
|
+
This data type is not supported in Gemini API.
|
|
10714
|
+
"""
|
|
10356
10715
|
|
|
10357
10716
|
distillation_data_stats: Optional[DistillationDataStats] = Field(
|
|
10358
10717
|
default=None, description="""Output only. Statistics for distillation."""
|
|
@@ -10369,7 +10728,10 @@ class TuningDataStats(_common.BaseModel):
|
|
|
10369
10728
|
|
|
10370
10729
|
|
|
10371
10730
|
class TuningDataStatsDict(TypedDict, total=False):
|
|
10372
|
-
"""The tuning data statistic values for TuningJob.
|
|
10731
|
+
"""The tuning data statistic values for TuningJob.
|
|
10732
|
+
|
|
10733
|
+
This data type is not supported in Gemini API.
|
|
10734
|
+
"""
|
|
10373
10735
|
|
|
10374
10736
|
distillation_data_stats: Optional[DistillationDataStatsDict]
|
|
10375
10737
|
"""Output only. Statistics for distillation."""
|
|
@@ -10387,7 +10749,10 @@ TuningDataStatsOrDict = Union[TuningDataStats, TuningDataStatsDict]
|
|
|
10387
10749
|
|
|
10388
10750
|
|
|
10389
10751
|
class EncryptionSpec(_common.BaseModel):
|
|
10390
|
-
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10752
|
+
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10753
|
+
|
|
10754
|
+
This data type is not supported in Gemini API.
|
|
10755
|
+
"""
|
|
10391
10756
|
|
|
10392
10757
|
kms_key_name: Optional[str] = Field(
|
|
10393
10758
|
default=None,
|
|
@@ -10396,7 +10761,10 @@ class EncryptionSpec(_common.BaseModel):
|
|
|
10396
10761
|
|
|
10397
10762
|
|
|
10398
10763
|
class EncryptionSpecDict(TypedDict, total=False):
|
|
10399
|
-
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10764
|
+
"""Represents a customer-managed encryption key spec that can be applied to a top-level resource.
|
|
10765
|
+
|
|
10766
|
+
This data type is not supported in Gemini API.
|
|
10767
|
+
"""
|
|
10400
10768
|
|
|
10401
10769
|
kms_key_name: Optional[str]
|
|
10402
10770
|
"""Required. The Cloud KMS resource identifier of the customer managed encryption key used to protect a resource. Has the form: `projects/my-project/locations/my-region/keyRings/my-kr/cryptoKeys/my-key`. The key needs to be in the same region as where the compute resource is created."""
|
|
@@ -10406,7 +10774,10 @@ EncryptionSpecOrDict = Union[EncryptionSpec, EncryptionSpecDict]
|
|
|
10406
10774
|
|
|
10407
10775
|
|
|
10408
10776
|
class PartnerModelTuningSpec(_common.BaseModel):
|
|
10409
|
-
"""Tuning spec for Partner models.
|
|
10777
|
+
"""Tuning spec for Partner models.
|
|
10778
|
+
|
|
10779
|
+
This data type is not supported in Gemini API.
|
|
10780
|
+
"""
|
|
10410
10781
|
|
|
10411
10782
|
hyper_parameters: Optional[dict[str, Any]] = Field(
|
|
10412
10783
|
default=None,
|
|
@@ -10423,7 +10794,10 @@ class PartnerModelTuningSpec(_common.BaseModel):
|
|
|
10423
10794
|
|
|
10424
10795
|
|
|
10425
10796
|
class PartnerModelTuningSpecDict(TypedDict, total=False):
|
|
10426
|
-
"""Tuning spec for Partner models.
|
|
10797
|
+
"""Tuning spec for Partner models.
|
|
10798
|
+
|
|
10799
|
+
This data type is not supported in Gemini API.
|
|
10800
|
+
"""
|
|
10427
10801
|
|
|
10428
10802
|
hyper_parameters: Optional[dict[str, Any]]
|
|
10429
10803
|
"""Hyperparameters for tuning. The accepted hyper_parameters and their valid range of values will differ depending on the base model."""
|
|
@@ -10441,7 +10815,7 @@ PartnerModelTuningSpecOrDict = Union[
|
|
|
10441
10815
|
|
|
10442
10816
|
|
|
10443
10817
|
class VeoHyperParameters(_common.BaseModel):
|
|
10444
|
-
"""Hyperparameters for Veo."""
|
|
10818
|
+
"""Hyperparameters for Veo. This data type is not supported in Gemini API."""
|
|
10445
10819
|
|
|
10446
10820
|
epoch_count: Optional[int] = Field(
|
|
10447
10821
|
default=None,
|
|
@@ -10458,7 +10832,7 @@ class VeoHyperParameters(_common.BaseModel):
|
|
|
10458
10832
|
|
|
10459
10833
|
|
|
10460
10834
|
class VeoHyperParametersDict(TypedDict, total=False):
|
|
10461
|
-
"""Hyperparameters for Veo."""
|
|
10835
|
+
"""Hyperparameters for Veo. This data type is not supported in Gemini API."""
|
|
10462
10836
|
|
|
10463
10837
|
epoch_count: Optional[int]
|
|
10464
10838
|
"""Optional. Number of complete passes the model makes over the entire training dataset during training."""
|
|
@@ -10474,7 +10848,10 @@ VeoHyperParametersOrDict = Union[VeoHyperParameters, VeoHyperParametersDict]
|
|
|
10474
10848
|
|
|
10475
10849
|
|
|
10476
10850
|
class VeoTuningSpec(_common.BaseModel):
|
|
10477
|
-
"""Tuning Spec for Veo Model Tuning.
|
|
10851
|
+
"""Tuning Spec for Veo Model Tuning.
|
|
10852
|
+
|
|
10853
|
+
This data type is not supported in Gemini API.
|
|
10854
|
+
"""
|
|
10478
10855
|
|
|
10479
10856
|
hyper_parameters: Optional[VeoHyperParameters] = Field(
|
|
10480
10857
|
default=None, description="""Optional. Hyperparameters for Veo."""
|
|
@@ -10490,7 +10867,10 @@ class VeoTuningSpec(_common.BaseModel):
|
|
|
10490
10867
|
|
|
10491
10868
|
|
|
10492
10869
|
class VeoTuningSpecDict(TypedDict, total=False):
|
|
10493
|
-
"""Tuning Spec for Veo Model Tuning.
|
|
10870
|
+
"""Tuning Spec for Veo Model Tuning.
|
|
10871
|
+
|
|
10872
|
+
This data type is not supported in Gemini API.
|
|
10873
|
+
"""
|
|
10494
10874
|
|
|
10495
10875
|
hyper_parameters: Optional[VeoHyperParametersDict]
|
|
10496
10876
|
"""Optional. Hyperparameters for Veo."""
|
|
@@ -10557,6 +10937,9 @@ class TuningJob(_common.BaseModel):
|
|
|
10557
10937
|
supervised_tuning_spec: Optional[SupervisedTuningSpec] = Field(
|
|
10558
10938
|
default=None, description="""Tuning Spec for Supervised Fine Tuning."""
|
|
10559
10939
|
)
|
|
10940
|
+
preference_optimization_spec: Optional[PreferenceOptimizationSpec] = Field(
|
|
10941
|
+
default=None, description="""Tuning Spec for Preference Optimization."""
|
|
10942
|
+
)
|
|
10560
10943
|
tuning_data_stats: Optional[TuningDataStats] = Field(
|
|
10561
10944
|
default=None,
|
|
10562
10945
|
description="""Output only. The tuning data statistics associated with this TuningJob.""",
|
|
@@ -10657,6 +11040,9 @@ class TuningJobDict(TypedDict, total=False):
|
|
|
10657
11040
|
supervised_tuning_spec: Optional[SupervisedTuningSpecDict]
|
|
10658
11041
|
"""Tuning Spec for Supervised Fine Tuning."""
|
|
10659
11042
|
|
|
11043
|
+
preference_optimization_spec: Optional[PreferenceOptimizationSpecDict]
|
|
11044
|
+
"""Tuning Spec for Preference Optimization."""
|
|
11045
|
+
|
|
10660
11046
|
tuning_data_stats: Optional[TuningDataStatsDict]
|
|
10661
11047
|
"""Output only. The tuning data statistics associated with this TuningJob."""
|
|
10662
11048
|
|
|
@@ -10829,22 +11215,30 @@ _CancelTuningJobParametersOrDict = Union[
|
|
|
10829
11215
|
|
|
10830
11216
|
|
|
10831
11217
|
class TuningExample(_common.BaseModel):
|
|
11218
|
+
"""A single example for tuning.
|
|
11219
|
+
|
|
11220
|
+
This data type is not supported in Vertex AI.
|
|
11221
|
+
"""
|
|
10832
11222
|
|
|
10833
|
-
text_input: Optional[str] = Field(
|
|
10834
|
-
default=None, description="""Text model input."""
|
|
10835
|
-
)
|
|
10836
11223
|
output: Optional[str] = Field(
|
|
10837
|
-
default=None, description="""The expected model output."""
|
|
11224
|
+
default=None, description="""Required. The expected model output."""
|
|
11225
|
+
)
|
|
11226
|
+
text_input: Optional[str] = Field(
|
|
11227
|
+
default=None, description="""Optional. Text model input."""
|
|
10838
11228
|
)
|
|
10839
11229
|
|
|
10840
11230
|
|
|
10841
11231
|
class TuningExampleDict(TypedDict, total=False):
|
|
11232
|
+
"""A single example for tuning.
|
|
10842
11233
|
|
|
10843
|
-
|
|
10844
|
-
"""
|
|
11234
|
+
This data type is not supported in Vertex AI.
|
|
11235
|
+
"""
|
|
10845
11236
|
|
|
10846
11237
|
output: Optional[str]
|
|
10847
|
-
"""The expected model output."""
|
|
11238
|
+
"""Required. The expected model output."""
|
|
11239
|
+
|
|
11240
|
+
text_input: Optional[str]
|
|
11241
|
+
"""Optional. Text model input."""
|
|
10848
11242
|
|
|
10849
11243
|
|
|
10850
11244
|
TuningExampleOrDict = Union[TuningExample, TuningExampleDict]
|
|
@@ -10891,7 +11285,7 @@ class TuningValidationDataset(_common.BaseModel):
|
|
|
10891
11285
|
)
|
|
10892
11286
|
vertex_dataset_resource: Optional[str] = Field(
|
|
10893
11287
|
default=None,
|
|
10894
|
-
description="""The resource name of the Vertex Multimodal Dataset that is used as
|
|
11288
|
+
description="""The resource name of the Vertex Multimodal Dataset that is used as validation dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'.""",
|
|
10895
11289
|
)
|
|
10896
11290
|
|
|
10897
11291
|
|
|
@@ -10901,7 +11295,7 @@ class TuningValidationDatasetDict(TypedDict, total=False):
|
|
|
10901
11295
|
"""GCS URI of the file containing validation dataset in JSONL format."""
|
|
10902
11296
|
|
|
10903
11297
|
vertex_dataset_resource: Optional[str]
|
|
10904
|
-
"""The resource name of the Vertex Multimodal Dataset that is used as
|
|
11298
|
+
"""The resource name of the Vertex Multimodal Dataset that is used as validation dataset. Example: 'projects/my-project-id-or-number/locations/my-location/datasets/my-dataset-id'."""
|
|
10905
11299
|
|
|
10906
11300
|
|
|
10907
11301
|
TuningValidationDatasetOrDict = Union[
|
|
@@ -10910,14 +11304,18 @@ TuningValidationDatasetOrDict = Union[
|
|
|
10910
11304
|
|
|
10911
11305
|
|
|
10912
11306
|
class CreateTuningJobConfig(_common.BaseModel):
|
|
10913
|
-
"""
|
|
11307
|
+
"""Fine-tuning job creation request - optional fields."""
|
|
10914
11308
|
|
|
10915
11309
|
http_options: Optional[HttpOptions] = Field(
|
|
10916
11310
|
default=None, description="""Used to override HTTP request options."""
|
|
10917
11311
|
)
|
|
11312
|
+
method: Optional[TuningMethod] = Field(
|
|
11313
|
+
default=None,
|
|
11314
|
+
description="""The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING). If not set, the default method (SFT) will be used.""",
|
|
11315
|
+
)
|
|
10918
11316
|
validation_dataset: Optional[TuningValidationDataset] = Field(
|
|
10919
11317
|
default=None,
|
|
10920
|
-
description="""
|
|
11318
|
+
description="""Validation dataset for tuning. The dataset must be formatted as a JSONL file.""",
|
|
10921
11319
|
)
|
|
10922
11320
|
tuned_model_display_name: Optional[str] = Field(
|
|
10923
11321
|
default=None,
|
|
@@ -10936,7 +11334,7 @@ class CreateTuningJobConfig(_common.BaseModel):
|
|
|
10936
11334
|
)
|
|
10937
11335
|
export_last_checkpoint_only: Optional[bool] = Field(
|
|
10938
11336
|
default=None,
|
|
10939
|
-
description="""If set to true, disable intermediate checkpoints
|
|
11337
|
+
description="""If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints.""",
|
|
10940
11338
|
)
|
|
10941
11339
|
pre_tuned_model_checkpoint_id: Optional[str] = Field(
|
|
10942
11340
|
default=None,
|
|
@@ -10960,16 +11358,23 @@ class CreateTuningJobConfig(_common.BaseModel):
|
|
|
10960
11358
|
default=None,
|
|
10961
11359
|
description="""Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels.""",
|
|
10962
11360
|
)
|
|
11361
|
+
beta: Optional[float] = Field(
|
|
11362
|
+
default=None,
|
|
11363
|
+
description="""Weight for KL Divergence regularization, Preference Optimization tuning only.""",
|
|
11364
|
+
)
|
|
10963
11365
|
|
|
10964
11366
|
|
|
10965
11367
|
class CreateTuningJobConfigDict(TypedDict, total=False):
|
|
10966
|
-
"""
|
|
11368
|
+
"""Fine-tuning job creation request - optional fields."""
|
|
10967
11369
|
|
|
10968
11370
|
http_options: Optional[HttpOptionsDict]
|
|
10969
11371
|
"""Used to override HTTP request options."""
|
|
10970
11372
|
|
|
11373
|
+
method: Optional[TuningMethod]
|
|
11374
|
+
"""The method to use for tuning (SUPERVISED_FINE_TUNING or PREFERENCE_TUNING). If not set, the default method (SFT) will be used."""
|
|
11375
|
+
|
|
10971
11376
|
validation_dataset: Optional[TuningValidationDatasetDict]
|
|
10972
|
-
"""
|
|
11377
|
+
"""Validation dataset for tuning. The dataset must be formatted as a JSONL file."""
|
|
10973
11378
|
|
|
10974
11379
|
tuned_model_display_name: Optional[str]
|
|
10975
11380
|
"""The display name of the tuned Model. The name can be up to 128 characters long and can consist of any UTF-8 characters."""
|
|
@@ -10984,7 +11389,7 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
|
|
|
10984
11389
|
"""Multiplier for adjusting the default learning rate."""
|
|
10985
11390
|
|
|
10986
11391
|
export_last_checkpoint_only: Optional[bool]
|
|
10987
|
-
"""If set to true, disable intermediate checkpoints
|
|
11392
|
+
"""If set to true, disable intermediate checkpoints and only the last checkpoint will be exported. Otherwise, enable intermediate checkpoints."""
|
|
10988
11393
|
|
|
10989
11394
|
pre_tuned_model_checkpoint_id: Optional[str]
|
|
10990
11395
|
"""The optional checkpoint id of the pre-tuned model to use for tuning, if applicable."""
|
|
@@ -11004,6 +11409,9 @@ class CreateTuningJobConfigDict(TypedDict, total=False):
|
|
|
11004
11409
|
labels: Optional[dict[str, str]]
|
|
11005
11410
|
"""Optional. The labels with user-defined metadata to organize TuningJob and generated resources such as Model and Endpoint. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels."""
|
|
11006
11411
|
|
|
11412
|
+
beta: Optional[float]
|
|
11413
|
+
"""Weight for KL Divergence regularization, Preference Optimization tuning only."""
|
|
11414
|
+
|
|
11007
11415
|
|
|
11008
11416
|
CreateTuningJobConfigOrDict = Union[
|
|
11009
11417
|
CreateTuningJobConfig, CreateTuningJobConfigDict
|
|
@@ -11011,7 +11419,7 @@ CreateTuningJobConfigOrDict = Union[
|
|
|
11011
11419
|
|
|
11012
11420
|
|
|
11013
11421
|
class _CreateTuningJobParametersPrivate(_common.BaseModel):
|
|
11014
|
-
"""
|
|
11422
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
11015
11423
|
|
|
11016
11424
|
base_model: Optional[str] = Field(
|
|
11017
11425
|
default=None,
|
|
@@ -11030,7 +11438,7 @@ class _CreateTuningJobParametersPrivate(_common.BaseModel):
|
|
|
11030
11438
|
|
|
11031
11439
|
|
|
11032
11440
|
class _CreateTuningJobParametersPrivateDict(TypedDict, total=False):
|
|
11033
|
-
"""
|
|
11441
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
11034
11442
|
|
|
11035
11443
|
base_model: Optional[str]
|
|
11036
11444
|
"""The base model that is being tuned, e.g., "gemini-2.5-flash"."""
|
|
@@ -11232,20 +11640,24 @@ class CachedContentUsageMetadata(_common.BaseModel):
|
|
|
11232
11640
|
"""Metadata on the usage of the cached content."""
|
|
11233
11641
|
|
|
11234
11642
|
audio_duration_seconds: Optional[int] = Field(
|
|
11235
|
-
default=None,
|
|
11643
|
+
default=None,
|
|
11644
|
+
description="""Duration of audio in seconds. This field is not supported in Gemini API.""",
|
|
11236
11645
|
)
|
|
11237
11646
|
image_count: Optional[int] = Field(
|
|
11238
|
-
default=None,
|
|
11647
|
+
default=None,
|
|
11648
|
+
description="""Number of images. This field is not supported in Gemini API.""",
|
|
11239
11649
|
)
|
|
11240
11650
|
text_count: Optional[int] = Field(
|
|
11241
|
-
default=None,
|
|
11651
|
+
default=None,
|
|
11652
|
+
description="""Number of text characters. This field is not supported in Gemini API.""",
|
|
11242
11653
|
)
|
|
11243
11654
|
total_token_count: Optional[int] = Field(
|
|
11244
11655
|
default=None,
|
|
11245
11656
|
description="""Total number of tokens that the cached content consumes.""",
|
|
11246
11657
|
)
|
|
11247
11658
|
video_duration_seconds: Optional[int] = Field(
|
|
11248
|
-
default=None,
|
|
11659
|
+
default=None,
|
|
11660
|
+
description="""Duration of video in seconds. This field is not supported in Gemini API.""",
|
|
11249
11661
|
)
|
|
11250
11662
|
|
|
11251
11663
|
|
|
@@ -11253,19 +11665,19 @@ class CachedContentUsageMetadataDict(TypedDict, total=False):
|
|
|
11253
11665
|
"""Metadata on the usage of the cached content."""
|
|
11254
11666
|
|
|
11255
11667
|
audio_duration_seconds: Optional[int]
|
|
11256
|
-
"""Duration of audio in seconds."""
|
|
11668
|
+
"""Duration of audio in seconds. This field is not supported in Gemini API."""
|
|
11257
11669
|
|
|
11258
11670
|
image_count: Optional[int]
|
|
11259
|
-
"""Number of images."""
|
|
11671
|
+
"""Number of images. This field is not supported in Gemini API."""
|
|
11260
11672
|
|
|
11261
11673
|
text_count: Optional[int]
|
|
11262
|
-
"""Number of text characters."""
|
|
11674
|
+
"""Number of text characters. This field is not supported in Gemini API."""
|
|
11263
11675
|
|
|
11264
11676
|
total_token_count: Optional[int]
|
|
11265
11677
|
"""Total number of tokens that the cached content consumes."""
|
|
11266
11678
|
|
|
11267
11679
|
video_duration_seconds: Optional[int]
|
|
11268
|
-
"""Duration of video in seconds."""
|
|
11680
|
+
"""Duration of video in seconds. This field is not supported in Gemini API."""
|
|
11269
11681
|
|
|
11270
11682
|
|
|
11271
11683
|
CachedContentUsageMetadataOrDict = Union[
|
|
@@ -11656,10 +12068,11 @@ class ListFilesResponse(_common.BaseModel):
|
|
|
11656
12068
|
default=None, description="""Used to retain the full HTTP response."""
|
|
11657
12069
|
)
|
|
11658
12070
|
next_page_token: Optional[str] = Field(
|
|
11659
|
-
default=None,
|
|
12071
|
+
default=None,
|
|
12072
|
+
description="""A token that can be sent as a `page_token` into a subsequent `ListFiles` call.""",
|
|
11660
12073
|
)
|
|
11661
12074
|
files: Optional[list[File]] = Field(
|
|
11662
|
-
default=None, description="""The list of
|
|
12075
|
+
default=None, description="""The list of `File`s."""
|
|
11663
12076
|
)
|
|
11664
12077
|
|
|
11665
12078
|
|
|
@@ -11670,10 +12083,10 @@ class ListFilesResponseDict(TypedDict, total=False):
|
|
|
11670
12083
|
"""Used to retain the full HTTP response."""
|
|
11671
12084
|
|
|
11672
12085
|
next_page_token: Optional[str]
|
|
11673
|
-
"""A token
|
|
12086
|
+
"""A token that can be sent as a `page_token` into a subsequent `ListFiles` call."""
|
|
11674
12087
|
|
|
11675
12088
|
files: Optional[list[FileDict]]
|
|
11676
|
-
"""The list of
|
|
12089
|
+
"""The list of `File`s."""
|
|
11677
12090
|
|
|
11678
12091
|
|
|
11679
12092
|
ListFilesResponseOrDict = Union[ListFilesResponse, ListFilesResponseDict]
|
|
@@ -12351,6 +12764,25 @@ class BatchJob(_common.BaseModel):
|
|
|
12351
12764
|
return self.state.name in JOB_STATES_ENDED
|
|
12352
12765
|
|
|
12353
12766
|
|
|
12767
|
+
class GenerationConfigThinkingConfig(ThinkingConfig):
|
|
12768
|
+
"""Config for thinking feature.
|
|
12769
|
+
|
|
12770
|
+
This class will be deprecated. Please use `ThinkingConfig` instead.
|
|
12771
|
+
"""
|
|
12772
|
+
|
|
12773
|
+
|
|
12774
|
+
class GenerationConfigThinkingConfigDict(ThinkingConfigDict):
|
|
12775
|
+
"""Config for thinking feature.
|
|
12776
|
+
|
|
12777
|
+
This class will be deprecated. Please use `ThinkingConfig` instead.
|
|
12778
|
+
"""
|
|
12779
|
+
|
|
12780
|
+
|
|
12781
|
+
GenerationConfigThinkingConfigOrDict = Union[
|
|
12782
|
+
GenerationConfigThinkingConfig, GenerationConfigThinkingConfigDict
|
|
12783
|
+
]
|
|
12784
|
+
|
|
12785
|
+
|
|
12354
12786
|
class BatchJobDict(TypedDict, total=False):
|
|
12355
12787
|
"""Config for batches.create return value."""
|
|
12356
12788
|
|
|
@@ -13232,6 +13664,12 @@ class UpscaleImageConfig(_common.BaseModel):
|
|
|
13232
13664
|
default=None,
|
|
13233
13665
|
description="""Cloud Storage URI used to store the generated images.""",
|
|
13234
13666
|
)
|
|
13667
|
+
safety_filter_level: Optional[SafetyFilterLevel] = Field(
|
|
13668
|
+
default=None, description="""Filter level for safety filtering."""
|
|
13669
|
+
)
|
|
13670
|
+
person_generation: Optional[PersonGeneration] = Field(
|
|
13671
|
+
default=None, description="""Allows generation of people by the model."""
|
|
13672
|
+
)
|
|
13235
13673
|
include_rai_reason: Optional[bool] = Field(
|
|
13236
13674
|
default=None,
|
|
13237
13675
|
description="""Whether to include a reason for filtered-out images in the
|
|
@@ -13279,6 +13717,12 @@ class UpscaleImageConfigDict(TypedDict, total=False):
|
|
|
13279
13717
|
output_gcs_uri: Optional[str]
|
|
13280
13718
|
"""Cloud Storage URI used to store the generated images."""
|
|
13281
13719
|
|
|
13720
|
+
safety_filter_level: Optional[SafetyFilterLevel]
|
|
13721
|
+
"""Filter level for safety filtering."""
|
|
13722
|
+
|
|
13723
|
+
person_generation: Optional[PersonGeneration]
|
|
13724
|
+
"""Allows generation of people by the model."""
|
|
13725
|
+
|
|
13282
13726
|
include_rai_reason: Optional[bool]
|
|
13283
13727
|
"""Whether to include a reason for filtered-out images in the
|
|
13284
13728
|
response."""
|
|
@@ -15817,7 +16261,7 @@ ComputeTokensResultOrDict = Union[ComputeTokensResult, ComputeTokensResultDict]
|
|
|
15817
16261
|
|
|
15818
16262
|
|
|
15819
16263
|
class CreateTuningJobParameters(_common.BaseModel):
|
|
15820
|
-
"""
|
|
16264
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
15821
16265
|
|
|
15822
16266
|
base_model: Optional[str] = Field(
|
|
15823
16267
|
default=None,
|
|
@@ -15833,7 +16277,7 @@ class CreateTuningJobParameters(_common.BaseModel):
|
|
|
15833
16277
|
|
|
15834
16278
|
|
|
15835
16279
|
class CreateTuningJobParametersDict(TypedDict, total=False):
|
|
15836
|
-
"""
|
|
16280
|
+
"""Fine-tuning job creation parameters - optional fields."""
|
|
15837
16281
|
|
|
15838
16282
|
base_model: Optional[str]
|
|
15839
16283
|
"""The base model that is being tuned, e.g., "gemini-2.5-flash"."""
|