google-genai 1.12.1__py3-none-any.whl → 1.14.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 +59 -17
- google/genai/_base_url.py +50 -0
- google/genai/_live_converters.py +231 -203
- google/genai/_transformers.py +2 -2
- google/genai/batches.py +2 -2
- google/genai/caches.py +236 -198
- google/genai/chats.py +4 -4
- google/genai/client.py +21 -9
- google/genai/live.py +9 -6
- google/genai/models.py +260 -230
- google/genai/types.py +1380 -1045
- google/genai/version.py +1 -1
- {google_genai-1.12.1.dist-info → google_genai-1.14.0.dist-info}/METADATA +8 -6
- google_genai-1.14.0.dist-info/RECORD +30 -0
- {google_genai-1.12.1.dist-info → google_genai-1.14.0.dist-info}/WHEEL +1 -1
- google_genai-1.12.1.dist-info/RECORD +0 -29
- {google_genai-1.12.1.dist-info → google_genai-1.14.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.12.1.dist-info → google_genai-1.14.0.dist-info}/top_level.txt +0 -0
google/genai/_live_converters.py
CHANGED
@@ -154,213 +154,115 @@ def _Content_to_vertex(
|
|
154
154
|
return to_object
|
155
155
|
|
156
156
|
|
157
|
-
def
|
157
|
+
def _GoogleSearch_to_mldev(
|
158
158
|
api_client: BaseApiClient,
|
159
159
|
from_object: Union[dict[str, Any], object],
|
160
160
|
parent_object: Optional[dict[str, Any]] = None,
|
161
161
|
) -> dict[str, Any]:
|
162
162
|
to_object: dict[str, Any] = {}
|
163
|
-
if getv(from_object, ['example']) is not None:
|
164
|
-
raise ValueError('example parameter is not supported in Gemini API.')
|
165
|
-
|
166
|
-
if getv(from_object, ['pattern']) is not None:
|
167
|
-
raise ValueError('pattern parameter is not supported in Gemini API.')
|
168
|
-
|
169
|
-
if getv(from_object, ['default']) is not None:
|
170
|
-
raise ValueError('default parameter is not supported in Gemini API.')
|
171
|
-
|
172
|
-
if getv(from_object, ['max_length']) is not None:
|
173
|
-
raise ValueError('max_length parameter is not supported in Gemini API.')
|
174
|
-
|
175
|
-
if getv(from_object, ['min_length']) is not None:
|
176
|
-
raise ValueError('min_length parameter is not supported in Gemini API.')
|
177
|
-
|
178
|
-
if getv(from_object, ['min_properties']) is not None:
|
179
|
-
raise ValueError('min_properties parameter is not supported in Gemini API.')
|
180
|
-
|
181
|
-
if getv(from_object, ['max_properties']) is not None:
|
182
|
-
raise ValueError('max_properties parameter is not supported in Gemini API.')
|
183
|
-
|
184
|
-
if getv(from_object, ['any_of']) is not None:
|
185
|
-
setv(to_object, ['anyOf'], getv(from_object, ['any_of']))
|
186
163
|
|
187
|
-
|
188
|
-
setv(to_object, ['description'], getv(from_object, ['description']))
|
189
|
-
|
190
|
-
if getv(from_object, ['enum']) is not None:
|
191
|
-
setv(to_object, ['enum'], getv(from_object, ['enum']))
|
192
|
-
|
193
|
-
if getv(from_object, ['format']) is not None:
|
194
|
-
setv(to_object, ['format'], getv(from_object, ['format']))
|
195
|
-
|
196
|
-
if getv(from_object, ['items']) is not None:
|
197
|
-
setv(to_object, ['items'], getv(from_object, ['items']))
|
198
|
-
|
199
|
-
if getv(from_object, ['max_items']) is not None:
|
200
|
-
setv(to_object, ['maxItems'], getv(from_object, ['max_items']))
|
164
|
+
return to_object
|
201
165
|
|
202
|
-
if getv(from_object, ['maximum']) is not None:
|
203
|
-
setv(to_object, ['maximum'], getv(from_object, ['maximum']))
|
204
166
|
|
205
|
-
|
206
|
-
|
167
|
+
def _GoogleSearch_to_vertex(
|
168
|
+
api_client: BaseApiClient,
|
169
|
+
from_object: Union[dict[str, Any], object],
|
170
|
+
parent_object: Optional[dict[str, Any]] = None,
|
171
|
+
) -> dict[str, Any]:
|
172
|
+
to_object: dict[str, Any] = {}
|
207
173
|
|
208
|
-
|
209
|
-
setv(to_object, ['minimum'], getv(from_object, ['minimum']))
|
174
|
+
return to_object
|
210
175
|
|
211
|
-
if getv(from_object, ['nullable']) is not None:
|
212
|
-
setv(to_object, ['nullable'], getv(from_object, ['nullable']))
|
213
176
|
|
214
|
-
|
215
|
-
|
177
|
+
def _DynamicRetrievalConfig_to_mldev(
|
178
|
+
api_client: BaseApiClient,
|
179
|
+
from_object: Union[dict[str, Any], object],
|
180
|
+
parent_object: Optional[dict[str, Any]] = None,
|
181
|
+
) -> dict[str, Any]:
|
182
|
+
to_object: dict[str, Any] = {}
|
183
|
+
if getv(from_object, ['mode']) is not None:
|
184
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
216
185
|
|
217
|
-
if getv(from_object, ['
|
186
|
+
if getv(from_object, ['dynamic_threshold']) is not None:
|
218
187
|
setv(
|
219
188
|
to_object,
|
220
|
-
['
|
221
|
-
getv(from_object, ['
|
189
|
+
['dynamicThreshold'],
|
190
|
+
getv(from_object, ['dynamic_threshold']),
|
222
191
|
)
|
223
192
|
|
224
|
-
if getv(from_object, ['required']) is not None:
|
225
|
-
setv(to_object, ['required'], getv(from_object, ['required']))
|
226
|
-
|
227
|
-
if getv(from_object, ['title']) is not None:
|
228
|
-
setv(to_object, ['title'], getv(from_object, ['title']))
|
229
|
-
|
230
|
-
if getv(from_object, ['type']) is not None:
|
231
|
-
setv(to_object, ['type'], getv(from_object, ['type']))
|
232
|
-
|
233
193
|
return to_object
|
234
194
|
|
235
195
|
|
236
|
-
def
|
196
|
+
def _DynamicRetrievalConfig_to_vertex(
|
237
197
|
api_client: BaseApiClient,
|
238
198
|
from_object: Union[dict[str, Any], object],
|
239
199
|
parent_object: Optional[dict[str, Any]] = None,
|
240
200
|
) -> dict[str, Any]:
|
241
201
|
to_object: dict[str, Any] = {}
|
242
|
-
if getv(from_object, ['
|
243
|
-
setv(to_object, ['
|
244
|
-
|
245
|
-
if getv(from_object, ['pattern']) is not None:
|
246
|
-
setv(to_object, ['pattern'], getv(from_object, ['pattern']))
|
247
|
-
|
248
|
-
if getv(from_object, ['default']) is not None:
|
249
|
-
setv(to_object, ['default'], getv(from_object, ['default']))
|
250
|
-
|
251
|
-
if getv(from_object, ['max_length']) is not None:
|
252
|
-
setv(to_object, ['maxLength'], getv(from_object, ['max_length']))
|
253
|
-
|
254
|
-
if getv(from_object, ['min_length']) is not None:
|
255
|
-
setv(to_object, ['minLength'], getv(from_object, ['min_length']))
|
256
|
-
|
257
|
-
if getv(from_object, ['min_properties']) is not None:
|
258
|
-
setv(to_object, ['minProperties'], getv(from_object, ['min_properties']))
|
259
|
-
|
260
|
-
if getv(from_object, ['max_properties']) is not None:
|
261
|
-
setv(to_object, ['maxProperties'], getv(from_object, ['max_properties']))
|
262
|
-
|
263
|
-
if getv(from_object, ['any_of']) is not None:
|
264
|
-
setv(to_object, ['anyOf'], getv(from_object, ['any_of']))
|
265
|
-
|
266
|
-
if getv(from_object, ['description']) is not None:
|
267
|
-
setv(to_object, ['description'], getv(from_object, ['description']))
|
268
|
-
|
269
|
-
if getv(from_object, ['enum']) is not None:
|
270
|
-
setv(to_object, ['enum'], getv(from_object, ['enum']))
|
271
|
-
|
272
|
-
if getv(from_object, ['format']) is not None:
|
273
|
-
setv(to_object, ['format'], getv(from_object, ['format']))
|
274
|
-
|
275
|
-
if getv(from_object, ['items']) is not None:
|
276
|
-
setv(to_object, ['items'], getv(from_object, ['items']))
|
277
|
-
|
278
|
-
if getv(from_object, ['max_items']) is not None:
|
279
|
-
setv(to_object, ['maxItems'], getv(from_object, ['max_items']))
|
280
|
-
|
281
|
-
if getv(from_object, ['maximum']) is not None:
|
282
|
-
setv(to_object, ['maximum'], getv(from_object, ['maximum']))
|
283
|
-
|
284
|
-
if getv(from_object, ['min_items']) is not None:
|
285
|
-
setv(to_object, ['minItems'], getv(from_object, ['min_items']))
|
286
|
-
|
287
|
-
if getv(from_object, ['minimum']) is not None:
|
288
|
-
setv(to_object, ['minimum'], getv(from_object, ['minimum']))
|
289
|
-
|
290
|
-
if getv(from_object, ['nullable']) is not None:
|
291
|
-
setv(to_object, ['nullable'], getv(from_object, ['nullable']))
|
292
|
-
|
293
|
-
if getv(from_object, ['properties']) is not None:
|
294
|
-
setv(to_object, ['properties'], getv(from_object, ['properties']))
|
202
|
+
if getv(from_object, ['mode']) is not None:
|
203
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
295
204
|
|
296
|
-
if getv(from_object, ['
|
205
|
+
if getv(from_object, ['dynamic_threshold']) is not None:
|
297
206
|
setv(
|
298
207
|
to_object,
|
299
|
-
['
|
300
|
-
getv(from_object, ['
|
208
|
+
['dynamicThreshold'],
|
209
|
+
getv(from_object, ['dynamic_threshold']),
|
301
210
|
)
|
302
211
|
|
303
|
-
if getv(from_object, ['required']) is not None:
|
304
|
-
setv(to_object, ['required'], getv(from_object, ['required']))
|
305
|
-
|
306
|
-
if getv(from_object, ['title']) is not None:
|
307
|
-
setv(to_object, ['title'], getv(from_object, ['title']))
|
308
|
-
|
309
|
-
if getv(from_object, ['type']) is not None:
|
310
|
-
setv(to_object, ['type'], getv(from_object, ['type']))
|
311
|
-
|
312
212
|
return to_object
|
313
213
|
|
314
214
|
|
315
|
-
def
|
215
|
+
def _GoogleSearchRetrieval_to_mldev(
|
316
216
|
api_client: BaseApiClient,
|
317
217
|
from_object: Union[dict[str, Any], object],
|
318
218
|
parent_object: Optional[dict[str, Any]] = None,
|
319
219
|
) -> dict[str, Any]:
|
320
220
|
to_object: dict[str, Any] = {}
|
321
|
-
if getv(from_object, ['
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
setv(to_object, ['parameters'], getv(from_object, ['parameters']))
|
221
|
+
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
222
|
+
setv(
|
223
|
+
to_object,
|
224
|
+
['dynamicRetrievalConfig'],
|
225
|
+
_DynamicRetrievalConfig_to_mldev(
|
226
|
+
api_client,
|
227
|
+
getv(from_object, ['dynamic_retrieval_config']),
|
228
|
+
to_object,
|
229
|
+
),
|
230
|
+
)
|
332
231
|
|
333
232
|
return to_object
|
334
233
|
|
335
234
|
|
336
|
-
def
|
235
|
+
def _GoogleSearchRetrieval_to_vertex(
|
337
236
|
api_client: BaseApiClient,
|
338
237
|
from_object: Union[dict[str, Any], object],
|
339
238
|
parent_object: Optional[dict[str, Any]] = None,
|
340
239
|
) -> dict[str, Any]:
|
341
240
|
to_object: dict[str, Any] = {}
|
342
|
-
if getv(from_object, ['
|
241
|
+
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
343
242
|
setv(
|
344
243
|
to_object,
|
345
|
-
['
|
346
|
-
|
347
|
-
api_client,
|
244
|
+
['dynamicRetrievalConfig'],
|
245
|
+
_DynamicRetrievalConfig_to_vertex(
|
246
|
+
api_client,
|
247
|
+
getv(from_object, ['dynamic_retrieval_config']),
|
248
|
+
to_object,
|
348
249
|
),
|
349
250
|
)
|
350
251
|
|
351
|
-
|
352
|
-
setv(to_object, ['description'], getv(from_object, ['description']))
|
252
|
+
return to_object
|
353
253
|
|
354
|
-
if getv(from_object, ['name']) is not None:
|
355
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
356
254
|
|
357
|
-
|
358
|
-
|
255
|
+
def _EnterpriseWebSearch_to_mldev(
|
256
|
+
api_client: BaseApiClient,
|
257
|
+
from_object: Union[dict[str, Any], object],
|
258
|
+
parent_object: Optional[dict[str, Any]] = None,
|
259
|
+
) -> dict[str, Any]:
|
260
|
+
to_object: dict[str, Any] = {}
|
359
261
|
|
360
262
|
return to_object
|
361
263
|
|
362
264
|
|
363
|
-
def
|
265
|
+
def _EnterpriseWebSearch_to_vertex(
|
364
266
|
api_client: BaseApiClient,
|
365
267
|
from_object: Union[dict[str, Any], object],
|
366
268
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -370,88 +272,130 @@ def _GoogleSearch_to_mldev(
|
|
370
272
|
return to_object
|
371
273
|
|
372
274
|
|
373
|
-
def
|
275
|
+
def _ApiKeyConfig_to_mldev(
|
374
276
|
api_client: BaseApiClient,
|
375
277
|
from_object: Union[dict[str, Any], object],
|
376
278
|
parent_object: Optional[dict[str, Any]] = None,
|
377
279
|
) -> dict[str, Any]:
|
378
280
|
to_object: dict[str, Any] = {}
|
281
|
+
if getv(from_object, ['api_key_string']) is not None:
|
282
|
+
raise ValueError('api_key_string parameter is not supported in Gemini API.')
|
379
283
|
|
380
284
|
return to_object
|
381
285
|
|
382
286
|
|
383
|
-
def
|
287
|
+
def _ApiKeyConfig_to_vertex(
|
384
288
|
api_client: BaseApiClient,
|
385
289
|
from_object: Union[dict[str, Any], object],
|
386
290
|
parent_object: Optional[dict[str, Any]] = None,
|
387
291
|
) -> dict[str, Any]:
|
388
292
|
to_object: dict[str, Any] = {}
|
389
|
-
if getv(from_object, ['
|
390
|
-
setv(to_object, ['
|
391
|
-
|
392
|
-
if getv(from_object, ['dynamic_threshold']) is not None:
|
393
|
-
setv(
|
394
|
-
to_object,
|
395
|
-
['dynamicThreshold'],
|
396
|
-
getv(from_object, ['dynamic_threshold']),
|
397
|
-
)
|
293
|
+
if getv(from_object, ['api_key_string']) is not None:
|
294
|
+
setv(to_object, ['apiKeyString'], getv(from_object, ['api_key_string']))
|
398
295
|
|
399
296
|
return to_object
|
400
297
|
|
401
298
|
|
402
|
-
def
|
299
|
+
def _AuthConfig_to_mldev(
|
403
300
|
api_client: BaseApiClient,
|
404
301
|
from_object: Union[dict[str, Any], object],
|
405
302
|
parent_object: Optional[dict[str, Any]] = None,
|
406
303
|
) -> dict[str, Any]:
|
407
304
|
to_object: dict[str, Any] = {}
|
408
|
-
if getv(from_object, ['
|
409
|
-
|
305
|
+
if getv(from_object, ['api_key_config']) is not None:
|
306
|
+
raise ValueError('api_key_config parameter is not supported in Gemini API.')
|
410
307
|
|
411
|
-
if getv(from_object, ['
|
308
|
+
if getv(from_object, ['auth_type']) is not None:
|
309
|
+
setv(to_object, ['authType'], getv(from_object, ['auth_type']))
|
310
|
+
|
311
|
+
if getv(from_object, ['google_service_account_config']) is not None:
|
412
312
|
setv(
|
413
313
|
to_object,
|
414
|
-
['
|
415
|
-
getv(from_object, ['
|
314
|
+
['googleServiceAccountConfig'],
|
315
|
+
getv(from_object, ['google_service_account_config']),
|
316
|
+
)
|
317
|
+
|
318
|
+
if getv(from_object, ['http_basic_auth_config']) is not None:
|
319
|
+
setv(
|
320
|
+
to_object,
|
321
|
+
['httpBasicAuthConfig'],
|
322
|
+
getv(from_object, ['http_basic_auth_config']),
|
416
323
|
)
|
417
324
|
|
325
|
+
if getv(from_object, ['oauth_config']) is not None:
|
326
|
+
setv(to_object, ['oauthConfig'], getv(from_object, ['oauth_config']))
|
327
|
+
|
328
|
+
if getv(from_object, ['oidc_config']) is not None:
|
329
|
+
setv(to_object, ['oidcConfig'], getv(from_object, ['oidc_config']))
|
330
|
+
|
418
331
|
return to_object
|
419
332
|
|
420
333
|
|
421
|
-
def
|
334
|
+
def _AuthConfig_to_vertex(
|
422
335
|
api_client: BaseApiClient,
|
423
336
|
from_object: Union[dict[str, Any], object],
|
424
337
|
parent_object: Optional[dict[str, Any]] = None,
|
425
338
|
) -> dict[str, Any]:
|
426
339
|
to_object: dict[str, Any] = {}
|
427
|
-
if getv(from_object, ['
|
340
|
+
if getv(from_object, ['api_key_config']) is not None:
|
428
341
|
setv(
|
429
342
|
to_object,
|
430
|
-
['
|
431
|
-
|
432
|
-
api_client,
|
433
|
-
getv(from_object, ['dynamic_retrieval_config']),
|
434
|
-
to_object,
|
343
|
+
['apiKeyConfig'],
|
344
|
+
_ApiKeyConfig_to_vertex(
|
345
|
+
api_client, getv(from_object, ['api_key_config']), to_object
|
435
346
|
),
|
436
347
|
)
|
437
348
|
|
349
|
+
if getv(from_object, ['auth_type']) is not None:
|
350
|
+
setv(to_object, ['authType'], getv(from_object, ['auth_type']))
|
351
|
+
|
352
|
+
if getv(from_object, ['google_service_account_config']) is not None:
|
353
|
+
setv(
|
354
|
+
to_object,
|
355
|
+
['googleServiceAccountConfig'],
|
356
|
+
getv(from_object, ['google_service_account_config']),
|
357
|
+
)
|
358
|
+
|
359
|
+
if getv(from_object, ['http_basic_auth_config']) is not None:
|
360
|
+
setv(
|
361
|
+
to_object,
|
362
|
+
['httpBasicAuthConfig'],
|
363
|
+
getv(from_object, ['http_basic_auth_config']),
|
364
|
+
)
|
365
|
+
|
366
|
+
if getv(from_object, ['oauth_config']) is not None:
|
367
|
+
setv(to_object, ['oauthConfig'], getv(from_object, ['oauth_config']))
|
368
|
+
|
369
|
+
if getv(from_object, ['oidc_config']) is not None:
|
370
|
+
setv(to_object, ['oidcConfig'], getv(from_object, ['oidc_config']))
|
371
|
+
|
438
372
|
return to_object
|
439
373
|
|
440
374
|
|
441
|
-
def
|
375
|
+
def _GoogleMaps_to_mldev(
|
442
376
|
api_client: BaseApiClient,
|
443
377
|
from_object: Union[dict[str, Any], object],
|
444
378
|
parent_object: Optional[dict[str, Any]] = None,
|
445
379
|
) -> dict[str, Any]:
|
446
380
|
to_object: dict[str, Any] = {}
|
447
|
-
if getv(from_object, ['
|
381
|
+
if getv(from_object, ['auth_config']) is not None:
|
382
|
+
raise ValueError('auth_config parameter is not supported in Gemini API.')
|
383
|
+
|
384
|
+
return to_object
|
385
|
+
|
386
|
+
|
387
|
+
def _GoogleMaps_to_vertex(
|
388
|
+
api_client: BaseApiClient,
|
389
|
+
from_object: Union[dict[str, Any], object],
|
390
|
+
parent_object: Optional[dict[str, Any]] = None,
|
391
|
+
) -> dict[str, Any]:
|
392
|
+
to_object: dict[str, Any] = {}
|
393
|
+
if getv(from_object, ['auth_config']) is not None:
|
448
394
|
setv(
|
449
395
|
to_object,
|
450
|
-
['
|
451
|
-
|
452
|
-
api_client,
|
453
|
-
getv(from_object, ['dynamic_retrieval_config']),
|
454
|
-
to_object,
|
396
|
+
['authConfig'],
|
397
|
+
_AuthConfig_to_vertex(
|
398
|
+
api_client, getv(from_object, ['auth_config']), to_object
|
455
399
|
),
|
456
400
|
)
|
457
401
|
|
@@ -464,16 +408,6 @@ def _Tool_to_mldev(
|
|
464
408
|
parent_object: Optional[dict[str, Any]] = None,
|
465
409
|
) -> dict[str, Any]:
|
466
410
|
to_object: dict[str, Any] = {}
|
467
|
-
if getv(from_object, ['function_declarations']) is not None:
|
468
|
-
setv(
|
469
|
-
to_object,
|
470
|
-
['functionDeclarations'],
|
471
|
-
[
|
472
|
-
_FunctionDeclaration_to_mldev(api_client, item, to_object)
|
473
|
-
for item in getv(from_object, ['function_declarations'])
|
474
|
-
],
|
475
|
-
)
|
476
|
-
|
477
411
|
if getv(from_object, ['retrieval']) is not None:
|
478
412
|
raise ValueError('retrieval parameter is not supported in Gemini API.')
|
479
413
|
|
@@ -497,9 +431,24 @@ def _Tool_to_mldev(
|
|
497
431
|
),
|
498
432
|
)
|
499
433
|
|
434
|
+
if getv(from_object, ['enterprise_web_search']) is not None:
|
435
|
+
raise ValueError(
|
436
|
+
'enterprise_web_search parameter is not supported in Gemini API.'
|
437
|
+
)
|
438
|
+
|
439
|
+
if getv(from_object, ['google_maps']) is not None:
|
440
|
+
raise ValueError('google_maps parameter is not supported in Gemini API.')
|
441
|
+
|
500
442
|
if getv(from_object, ['code_execution']) is not None:
|
501
443
|
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
502
444
|
|
445
|
+
if getv(from_object, ['function_declarations']) is not None:
|
446
|
+
setv(
|
447
|
+
to_object,
|
448
|
+
['functionDeclarations'],
|
449
|
+
getv(from_object, ['function_declarations']),
|
450
|
+
)
|
451
|
+
|
503
452
|
return to_object
|
504
453
|
|
505
454
|
|
@@ -509,16 +458,6 @@ def _Tool_to_vertex(
|
|
509
458
|
parent_object: Optional[dict[str, Any]] = None,
|
510
459
|
) -> dict[str, Any]:
|
511
460
|
to_object: dict[str, Any] = {}
|
512
|
-
if getv(from_object, ['function_declarations']) is not None:
|
513
|
-
setv(
|
514
|
-
to_object,
|
515
|
-
['functionDeclarations'],
|
516
|
-
[
|
517
|
-
_FunctionDeclaration_to_vertex(api_client, item, to_object)
|
518
|
-
for item in getv(from_object, ['function_declarations'])
|
519
|
-
],
|
520
|
-
)
|
521
|
-
|
522
461
|
if getv(from_object, ['retrieval']) is not None:
|
523
462
|
setv(to_object, ['retrieval'], getv(from_object, ['retrieval']))
|
524
463
|
|
@@ -542,9 +481,34 @@ def _Tool_to_vertex(
|
|
542
481
|
),
|
543
482
|
)
|
544
483
|
|
484
|
+
if getv(from_object, ['enterprise_web_search']) is not None:
|
485
|
+
setv(
|
486
|
+
to_object,
|
487
|
+
['enterpriseWebSearch'],
|
488
|
+
_EnterpriseWebSearch_to_vertex(
|
489
|
+
api_client, getv(from_object, ['enterprise_web_search']), to_object
|
490
|
+
),
|
491
|
+
)
|
492
|
+
|
493
|
+
if getv(from_object, ['google_maps']) is not None:
|
494
|
+
setv(
|
495
|
+
to_object,
|
496
|
+
['googleMaps'],
|
497
|
+
_GoogleMaps_to_vertex(
|
498
|
+
api_client, getv(from_object, ['google_maps']), to_object
|
499
|
+
),
|
500
|
+
)
|
501
|
+
|
545
502
|
if getv(from_object, ['code_execution']) is not None:
|
546
503
|
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
547
504
|
|
505
|
+
if getv(from_object, ['function_declarations']) is not None:
|
506
|
+
setv(
|
507
|
+
to_object,
|
508
|
+
['functionDeclarations'],
|
509
|
+
getv(from_object, ['function_declarations']),
|
510
|
+
)
|
511
|
+
|
548
512
|
return to_object
|
549
513
|
|
550
514
|
|
@@ -900,8 +864,14 @@ def _LiveConnectConfig_to_mldev(
|
|
900
864
|
)
|
901
865
|
|
902
866
|
if getv(from_object, ['input_audio_transcription']) is not None:
|
903
|
-
|
904
|
-
|
867
|
+
setv(
|
868
|
+
parent_object,
|
869
|
+
['setup', 'inputAudioTranscription'],
|
870
|
+
_AudioTranscriptionConfig_to_mldev(
|
871
|
+
api_client,
|
872
|
+
getv(from_object, ['input_audio_transcription']),
|
873
|
+
to_object,
|
874
|
+
),
|
905
875
|
)
|
906
876
|
|
907
877
|
if getv(from_object, ['output_audio_transcription']) is not None:
|
@@ -1329,6 +1299,28 @@ def _LiveClientSetup_to_mldev(
|
|
1329
1299
|
),
|
1330
1300
|
)
|
1331
1301
|
|
1302
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
1303
|
+
setv(
|
1304
|
+
to_object,
|
1305
|
+
['inputAudioTranscription'],
|
1306
|
+
_AudioTranscriptionConfig_to_mldev(
|
1307
|
+
api_client,
|
1308
|
+
getv(from_object, ['input_audio_transcription']),
|
1309
|
+
to_object,
|
1310
|
+
),
|
1311
|
+
)
|
1312
|
+
|
1313
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
1314
|
+
setv(
|
1315
|
+
to_object,
|
1316
|
+
['outputAudioTranscription'],
|
1317
|
+
_AudioTranscriptionConfig_to_mldev(
|
1318
|
+
api_client,
|
1319
|
+
getv(from_object, ['output_audio_transcription']),
|
1320
|
+
to_object,
|
1321
|
+
),
|
1322
|
+
)
|
1323
|
+
|
1332
1324
|
return to_object
|
1333
1325
|
|
1334
1326
|
|
@@ -1389,6 +1381,28 @@ def _LiveClientSetup_to_vertex(
|
|
1389
1381
|
),
|
1390
1382
|
)
|
1391
1383
|
|
1384
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
1385
|
+
setv(
|
1386
|
+
to_object,
|
1387
|
+
['inputAudioTranscription'],
|
1388
|
+
_AudioTranscriptionConfig_to_vertex(
|
1389
|
+
api_client,
|
1390
|
+
getv(from_object, ['input_audio_transcription']),
|
1391
|
+
to_object,
|
1392
|
+
),
|
1393
|
+
)
|
1394
|
+
|
1395
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
1396
|
+
setv(
|
1397
|
+
to_object,
|
1398
|
+
['outputAudioTranscription'],
|
1399
|
+
_AudioTranscriptionConfig_to_vertex(
|
1400
|
+
api_client,
|
1401
|
+
getv(from_object, ['output_audio_transcription']),
|
1402
|
+
to_object,
|
1403
|
+
),
|
1404
|
+
)
|
1405
|
+
|
1392
1406
|
return to_object
|
1393
1407
|
|
1394
1408
|
|
@@ -1887,6 +1901,13 @@ def _LiveServerContent_from_mldev(
|
|
1887
1901
|
if getv(from_object, ['interrupted']) is not None:
|
1888
1902
|
setv(to_object, ['interrupted'], getv(from_object, ['interrupted']))
|
1889
1903
|
|
1904
|
+
if getv(from_object, ['groundingMetadata']) is not None:
|
1905
|
+
setv(
|
1906
|
+
to_object,
|
1907
|
+
['grounding_metadata'],
|
1908
|
+
getv(from_object, ['groundingMetadata']),
|
1909
|
+
)
|
1910
|
+
|
1890
1911
|
if getv(from_object, ['generationComplete']) is not None:
|
1891
1912
|
setv(
|
1892
1913
|
to_object,
|
@@ -1936,6 +1957,13 @@ def _LiveServerContent_from_vertex(
|
|
1936
1957
|
if getv(from_object, ['interrupted']) is not None:
|
1937
1958
|
setv(to_object, ['interrupted'], getv(from_object, ['interrupted']))
|
1938
1959
|
|
1960
|
+
if getv(from_object, ['groundingMetadata']) is not None:
|
1961
|
+
setv(
|
1962
|
+
to_object,
|
1963
|
+
['grounding_metadata'],
|
1964
|
+
getv(from_object, ['groundingMetadata']),
|
1965
|
+
)
|
1966
|
+
|
1939
1967
|
if getv(from_object, ['generationComplete']) is not None:
|
1940
1968
|
setv(
|
1941
1969
|
to_object,
|
google/genai/_transformers.py
CHANGED
@@ -790,7 +790,7 @@ def t_schema(
|
|
790
790
|
if not origin:
|
791
791
|
return None
|
792
792
|
if isinstance(origin, dict) and _is_type_dict_str_any(origin):
|
793
|
-
process_schema(origin, client
|
793
|
+
process_schema(origin, client)
|
794
794
|
return types.Schema.model_validate(origin)
|
795
795
|
if isinstance(origin, EnumMeta):
|
796
796
|
return _process_enum(origin, client)
|
@@ -799,7 +799,7 @@ def t_schema(
|
|
799
799
|
# response_schema value was coerced to an empty Schema instance because it did not adhere to the Schema field annotation
|
800
800
|
raise ValueError(f'Unsupported schema type.')
|
801
801
|
schema = origin.model_dump(exclude_unset=True)
|
802
|
-
process_schema(schema, client
|
802
|
+
process_schema(schema, client)
|
803
803
|
return types.Schema.model_validate(schema)
|
804
804
|
|
805
805
|
if (
|
google/genai/batches.py
CHANGED
@@ -743,7 +743,7 @@ class Batches(_api_module.BaseModule):
|
|
743
743
|
.. code-block:: python
|
744
744
|
|
745
745
|
batch_job = client.batches.create(
|
746
|
-
model="gemini-
|
746
|
+
model="gemini-2.0-flash-001",
|
747
747
|
src="gs://path/to/input/data",
|
748
748
|
)
|
749
749
|
print(batch_job.state)
|
@@ -1113,7 +1113,7 @@ class AsyncBatches(_api_module.BaseModule):
|
|
1113
1113
|
.. code-block:: python
|
1114
1114
|
|
1115
1115
|
batch_job = await client.aio.batches.create(
|
1116
|
-
model="gemini-
|
1116
|
+
model="gemini-2.0-flash-001",
|
1117
1117
|
src="gs://path/to/input/data",
|
1118
1118
|
)
|
1119
1119
|
"""
|