google-genai 1.41.0__py3-none-any.whl → 1.42.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 +2 -1
- google/genai/_common.py +213 -77
- google/genai/_live_converters.py +720 -3119
- google/genai/_replay_api_client.py +8 -4
- google/genai/_tokens_converters.py +14 -443
- google/genai/_transformers.py +42 -12
- google/genai/batches.py +113 -1063
- google/genai/caches.py +67 -863
- google/genai/errors.py +9 -2
- google/genai/files.py +12 -171
- google/genai/live.py +10 -11
- google/genai/live_music.py +24 -27
- google/genai/models.py +322 -1835
- google/genai/operations.py +6 -32
- google/genai/tokens.py +2 -12
- google/genai/tunings.py +18 -197
- google/genai/types.py +86 -3
- google/genai/version.py +1 -1
- {google_genai-1.41.0.dist-info → google_genai-1.42.0.dist-info}/METADATA +40 -38
- google_genai-1.42.0.dist-info/RECORD +39 -0
- google_genai-1.41.0.dist-info/RECORD +0 -39
- {google_genai-1.41.0.dist-info → google_genai-1.42.0.dist-info}/WHEEL +0 -0
- {google_genai-1.41.0.dist-info → google_genai-1.42.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.41.0.dist-info → google_genai-1.42.0.dist-info}/top_level.txt +0 -0
@@ -395,6 +395,8 @@ class ReplayApiClient(BaseApiClient):
|
|
395
395
|
http_request: HttpRequest,
|
396
396
|
interaction: ReplayInteraction,
|
397
397
|
) -> None:
|
398
|
+
_debug_print(f'http_request.url: {http_request.url}')
|
399
|
+
_debug_print(f'interaction.request.url: {interaction.request.url}')
|
398
400
|
assert http_request.url == interaction.request.url
|
399
401
|
assert http_request.headers == interaction.request.headers, (
|
400
402
|
'Request headers mismatch:\n'
|
@@ -467,7 +469,9 @@ class ReplayApiClient(BaseApiClient):
|
|
467
469
|
|
468
470
|
if isinstance(response_model, list):
|
469
471
|
response_model = response_model[0]
|
470
|
-
|
472
|
+
_debug_print(
|
473
|
+
f'response_model: {response_model.model_dump(exclude_none=True)}'
|
474
|
+
)
|
471
475
|
actual = response_model.model_dump(exclude_none=True, mode='json')
|
472
476
|
expected = interaction.response.sdk_response_segments[
|
473
477
|
self._sdk_response_index
|
@@ -480,8 +484,8 @@ class ReplayApiClient(BaseApiClient):
|
|
480
484
|
):
|
481
485
|
if 'body' in expected['sdk_http_response']:
|
482
486
|
raw_body = expected['sdk_http_response']['body']
|
483
|
-
|
484
|
-
|
487
|
+
_debug_print(f'raw_body length: {len(raw_body)}')
|
488
|
+
_debug_print(f'raw_body: {raw_body}')
|
485
489
|
if isinstance(raw_body, str) and raw_body != '':
|
486
490
|
raw_body = json.loads(raw_body)
|
487
491
|
raw_body = json.dumps(raw_body)
|
@@ -491,7 +495,7 @@ class ReplayApiClient(BaseApiClient):
|
|
491
495
|
actual == expected
|
492
496
|
), f'SDK response mismatch:\nActual: {actual}\nExpected: {expected}'
|
493
497
|
else:
|
494
|
-
|
498
|
+
_debug_print(f'Expected SDK response mismatch:\nActual: {actual}\nExpected: {expected}')
|
495
499
|
self._sdk_response_index += 1
|
496
500
|
|
497
501
|
def _request(
|
@@ -23,72 +23,6 @@ from ._common import get_value_by_path as getv
|
|
23
23
|
from ._common import set_value_by_path as setv
|
24
24
|
|
25
25
|
|
26
|
-
def _AudioTranscriptionConfig_to_mldev(
|
27
|
-
from_object: Union[dict[str, Any], object],
|
28
|
-
parent_object: Optional[dict[str, Any]] = None,
|
29
|
-
) -> dict[str, Any]:
|
30
|
-
to_object: dict[str, Any] = {}
|
31
|
-
|
32
|
-
return to_object
|
33
|
-
|
34
|
-
|
35
|
-
def _AuthToken_from_mldev(
|
36
|
-
from_object: Union[dict[str, Any], object],
|
37
|
-
parent_object: Optional[dict[str, Any]] = None,
|
38
|
-
) -> dict[str, Any]:
|
39
|
-
to_object: dict[str, Any] = {}
|
40
|
-
if getv(from_object, ['name']) is not None:
|
41
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
42
|
-
|
43
|
-
return to_object
|
44
|
-
|
45
|
-
|
46
|
-
def _AuthToken_from_vertex(
|
47
|
-
from_object: Union[dict[str, Any], object],
|
48
|
-
parent_object: Optional[dict[str, Any]] = None,
|
49
|
-
) -> dict[str, Any]:
|
50
|
-
to_object: dict[str, Any] = {}
|
51
|
-
|
52
|
-
return to_object
|
53
|
-
|
54
|
-
|
55
|
-
def _AutomaticActivityDetection_to_mldev(
|
56
|
-
from_object: Union[dict[str, Any], object],
|
57
|
-
parent_object: Optional[dict[str, Any]] = None,
|
58
|
-
) -> dict[str, Any]:
|
59
|
-
to_object: dict[str, Any] = {}
|
60
|
-
if getv(from_object, ['disabled']) is not None:
|
61
|
-
setv(to_object, ['disabled'], getv(from_object, ['disabled']))
|
62
|
-
|
63
|
-
if getv(from_object, ['start_of_speech_sensitivity']) is not None:
|
64
|
-
setv(
|
65
|
-
to_object,
|
66
|
-
['startOfSpeechSensitivity'],
|
67
|
-
getv(from_object, ['start_of_speech_sensitivity']),
|
68
|
-
)
|
69
|
-
|
70
|
-
if getv(from_object, ['end_of_speech_sensitivity']) is not None:
|
71
|
-
setv(
|
72
|
-
to_object,
|
73
|
-
['endOfSpeechSensitivity'],
|
74
|
-
getv(from_object, ['end_of_speech_sensitivity']),
|
75
|
-
)
|
76
|
-
|
77
|
-
if getv(from_object, ['prefix_padding_ms']) is not None:
|
78
|
-
setv(
|
79
|
-
to_object, ['prefixPaddingMs'], getv(from_object, ['prefix_padding_ms'])
|
80
|
-
)
|
81
|
-
|
82
|
-
if getv(from_object, ['silence_duration_ms']) is not None:
|
83
|
-
setv(
|
84
|
-
to_object,
|
85
|
-
['silenceDurationMs'],
|
86
|
-
getv(from_object, ['silence_duration_ms']),
|
87
|
-
)
|
88
|
-
|
89
|
-
return to_object
|
90
|
-
|
91
|
-
|
92
26
|
def _Blob_to_mldev(
|
93
27
|
from_object: Union[dict[str, Any], object],
|
94
28
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -106,24 +40,6 @@ def _Blob_to_mldev(
|
|
106
40
|
return to_object
|
107
41
|
|
108
42
|
|
109
|
-
def _ComputerUse_to_mldev(
|
110
|
-
from_object: Union[dict[str, Any], object],
|
111
|
-
parent_object: Optional[dict[str, Any]] = None,
|
112
|
-
) -> dict[str, Any]:
|
113
|
-
to_object: dict[str, Any] = {}
|
114
|
-
if getv(from_object, ['environment']) is not None:
|
115
|
-
setv(to_object, ['environment'], getv(from_object, ['environment']))
|
116
|
-
|
117
|
-
if getv(from_object, ['excluded_predefined_functions']) is not None:
|
118
|
-
setv(
|
119
|
-
to_object,
|
120
|
-
['excludedPredefinedFunctions'],
|
121
|
-
getv(from_object, ['excluded_predefined_functions']),
|
122
|
-
)
|
123
|
-
|
124
|
-
return to_object
|
125
|
-
|
126
|
-
|
127
43
|
def _Content_to_mldev(
|
128
44
|
from_object: Union[dict[str, Any], object],
|
129
45
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -145,26 +61,6 @@ def _Content_to_mldev(
|
|
145
61
|
return to_object
|
146
62
|
|
147
63
|
|
148
|
-
def _ContextWindowCompressionConfig_to_mldev(
|
149
|
-
from_object: Union[dict[str, Any], object],
|
150
|
-
parent_object: Optional[dict[str, Any]] = None,
|
151
|
-
) -> dict[str, Any]:
|
152
|
-
to_object: dict[str, Any] = {}
|
153
|
-
if getv(from_object, ['trigger_tokens']) is not None:
|
154
|
-
setv(to_object, ['triggerTokens'], getv(from_object, ['trigger_tokens']))
|
155
|
-
|
156
|
-
if getv(from_object, ['sliding_window']) is not None:
|
157
|
-
setv(
|
158
|
-
to_object,
|
159
|
-
['slidingWindow'],
|
160
|
-
_SlidingWindow_to_mldev(
|
161
|
-
getv(from_object, ['sliding_window']), to_object
|
162
|
-
),
|
163
|
-
)
|
164
|
-
|
165
|
-
return to_object
|
166
|
-
|
167
|
-
|
168
64
|
def _CreateAuthTokenConfig_to_mldev(
|
169
65
|
api_client: BaseApiClient,
|
170
66
|
from_object: Union[dict[str, Any], object],
|
@@ -235,24 +131,6 @@ def _CreateAuthTokenParameters_to_vertex(
|
|
235
131
|
return to_object
|
236
132
|
|
237
133
|
|
238
|
-
def _DynamicRetrievalConfig_to_mldev(
|
239
|
-
from_object: Union[dict[str, Any], object],
|
240
|
-
parent_object: Optional[dict[str, Any]] = None,
|
241
|
-
) -> dict[str, Any]:
|
242
|
-
to_object: dict[str, Any] = {}
|
243
|
-
if getv(from_object, ['mode']) is not None:
|
244
|
-
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
245
|
-
|
246
|
-
if getv(from_object, ['dynamic_threshold']) is not None:
|
247
|
-
setv(
|
248
|
-
to_object,
|
249
|
-
['dynamicThreshold'],
|
250
|
-
getv(from_object, ['dynamic_threshold']),
|
251
|
-
)
|
252
|
-
|
253
|
-
return to_object
|
254
|
-
|
255
|
-
|
256
134
|
def _FileData_to_mldev(
|
257
135
|
from_object: Union[dict[str, Any], object],
|
258
136
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -270,77 +148,6 @@ def _FileData_to_mldev(
|
|
270
148
|
return to_object
|
271
149
|
|
272
150
|
|
273
|
-
def _FunctionCall_to_mldev(
|
274
|
-
from_object: Union[dict[str, Any], object],
|
275
|
-
parent_object: Optional[dict[str, Any]] = None,
|
276
|
-
) -> dict[str, Any]:
|
277
|
-
to_object: dict[str, Any] = {}
|
278
|
-
if getv(from_object, ['id']) is not None:
|
279
|
-
setv(to_object, ['id'], getv(from_object, ['id']))
|
280
|
-
|
281
|
-
if getv(from_object, ['args']) is not None:
|
282
|
-
setv(to_object, ['args'], getv(from_object, ['args']))
|
283
|
-
|
284
|
-
if getv(from_object, ['name']) is not None:
|
285
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
286
|
-
|
287
|
-
return to_object
|
288
|
-
|
289
|
-
|
290
|
-
def _FunctionDeclaration_to_mldev(
|
291
|
-
from_object: Union[dict[str, Any], object],
|
292
|
-
parent_object: Optional[dict[str, Any]] = None,
|
293
|
-
) -> dict[str, Any]:
|
294
|
-
to_object: dict[str, Any] = {}
|
295
|
-
if getv(from_object, ['behavior']) is not None:
|
296
|
-
setv(to_object, ['behavior'], getv(from_object, ['behavior']))
|
297
|
-
|
298
|
-
if getv(from_object, ['description']) is not None:
|
299
|
-
setv(to_object, ['description'], getv(from_object, ['description']))
|
300
|
-
|
301
|
-
if getv(from_object, ['name']) is not None:
|
302
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
303
|
-
|
304
|
-
if getv(from_object, ['parameters']) is not None:
|
305
|
-
setv(to_object, ['parameters'], getv(from_object, ['parameters']))
|
306
|
-
|
307
|
-
if getv(from_object, ['parameters_json_schema']) is not None:
|
308
|
-
setv(
|
309
|
-
to_object,
|
310
|
-
['parametersJsonSchema'],
|
311
|
-
getv(from_object, ['parameters_json_schema']),
|
312
|
-
)
|
313
|
-
|
314
|
-
if getv(from_object, ['response']) is not None:
|
315
|
-
setv(to_object, ['response'], getv(from_object, ['response']))
|
316
|
-
|
317
|
-
if getv(from_object, ['response_json_schema']) is not None:
|
318
|
-
setv(
|
319
|
-
to_object,
|
320
|
-
['responseJsonSchema'],
|
321
|
-
getv(from_object, ['response_json_schema']),
|
322
|
-
)
|
323
|
-
|
324
|
-
return to_object
|
325
|
-
|
326
|
-
|
327
|
-
def _GoogleSearchRetrieval_to_mldev(
|
328
|
-
from_object: Union[dict[str, Any], object],
|
329
|
-
parent_object: Optional[dict[str, Any]] = None,
|
330
|
-
) -> dict[str, Any]:
|
331
|
-
to_object: dict[str, Any] = {}
|
332
|
-
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
333
|
-
setv(
|
334
|
-
to_object,
|
335
|
-
['dynamicRetrievalConfig'],
|
336
|
-
_DynamicRetrievalConfig_to_mldev(
|
337
|
-
getv(from_object, ['dynamic_retrieval_config']), to_object
|
338
|
-
),
|
339
|
-
)
|
340
|
-
|
341
|
-
return to_object
|
342
|
-
|
343
|
-
|
344
151
|
def _GoogleSearch_to_mldev(
|
345
152
|
from_object: Union[dict[str, Any], object],
|
346
153
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -348,9 +155,7 @@ def _GoogleSearch_to_mldev(
|
|
348
155
|
to_object: dict[str, Any] = {}
|
349
156
|
if getv(from_object, ['time_range_filter']) is not None:
|
350
157
|
setv(
|
351
|
-
to_object,
|
352
|
-
['timeRangeFilter'],
|
353
|
-
_Interval_to_mldev(getv(from_object, ['time_range_filter']), to_object),
|
158
|
+
to_object, ['timeRangeFilter'], getv(from_object, ['time_range_filter'])
|
354
159
|
)
|
355
160
|
|
356
161
|
if getv(from_object, ['exclude_domains']) is not None:
|
@@ -361,20 +166,6 @@ def _GoogleSearch_to_mldev(
|
|
361
166
|
return to_object
|
362
167
|
|
363
168
|
|
364
|
-
def _Interval_to_mldev(
|
365
|
-
from_object: Union[dict[str, Any], object],
|
366
|
-
parent_object: Optional[dict[str, Any]] = None,
|
367
|
-
) -> dict[str, Any]:
|
368
|
-
to_object: dict[str, Any] = {}
|
369
|
-
if getv(from_object, ['start_time']) is not None:
|
370
|
-
setv(to_object, ['startTime'], getv(from_object, ['start_time']))
|
371
|
-
|
372
|
-
if getv(from_object, ['end_time']) is not None:
|
373
|
-
setv(to_object, ['endTime'], getv(from_object, ['end_time']))
|
374
|
-
|
375
|
-
return to_object
|
376
|
-
|
377
|
-
|
378
169
|
def _LiveConnectConfig_to_mldev(
|
379
170
|
api_client: BaseApiClient,
|
380
171
|
from_object: Union[dict[str, Any], object],
|
@@ -442,19 +233,14 @@ def _LiveConnectConfig_to_mldev(
|
|
442
233
|
setv(
|
443
234
|
parent_object,
|
444
235
|
['setup', 'generationConfig', 'speechConfig'],
|
445
|
-
|
446
|
-
t.t_live_speech_config(getv(from_object, ['speech_config'])),
|
447
|
-
to_object,
|
448
|
-
),
|
236
|
+
t.t_live_speech_config(getv(from_object, ['speech_config'])),
|
449
237
|
)
|
450
238
|
|
451
239
|
if getv(from_object, ['thinking_config']) is not None:
|
452
240
|
setv(
|
453
241
|
parent_object,
|
454
242
|
['setup', 'generationConfig', 'thinkingConfig'],
|
455
|
-
|
456
|
-
getv(from_object, ['thinking_config']), to_object
|
457
|
-
),
|
243
|
+
getv(from_object, ['thinking_config']),
|
458
244
|
)
|
459
245
|
|
460
246
|
if getv(from_object, ['enable_affective_dialog']) is not None:
|
@@ -496,45 +282,35 @@ def _LiveConnectConfig_to_mldev(
|
|
496
282
|
setv(
|
497
283
|
parent_object,
|
498
284
|
['setup', 'inputAudioTranscription'],
|
499
|
-
|
500
|
-
getv(from_object, ['input_audio_transcription']), to_object
|
501
|
-
),
|
285
|
+
getv(from_object, ['input_audio_transcription']),
|
502
286
|
)
|
503
287
|
|
504
288
|
if getv(from_object, ['output_audio_transcription']) is not None:
|
505
289
|
setv(
|
506
290
|
parent_object,
|
507
291
|
['setup', 'outputAudioTranscription'],
|
508
|
-
|
509
|
-
getv(from_object, ['output_audio_transcription']), to_object
|
510
|
-
),
|
292
|
+
getv(from_object, ['output_audio_transcription']),
|
511
293
|
)
|
512
294
|
|
513
295
|
if getv(from_object, ['realtime_input_config']) is not None:
|
514
296
|
setv(
|
515
297
|
parent_object,
|
516
298
|
['setup', 'realtimeInputConfig'],
|
517
|
-
|
518
|
-
getv(from_object, ['realtime_input_config']), to_object
|
519
|
-
),
|
299
|
+
getv(from_object, ['realtime_input_config']),
|
520
300
|
)
|
521
301
|
|
522
302
|
if getv(from_object, ['context_window_compression']) is not None:
|
523
303
|
setv(
|
524
304
|
parent_object,
|
525
305
|
['setup', 'contextWindowCompression'],
|
526
|
-
|
527
|
-
getv(from_object, ['context_window_compression']), to_object
|
528
|
-
),
|
306
|
+
getv(from_object, ['context_window_compression']),
|
529
307
|
)
|
530
308
|
|
531
309
|
if getv(from_object, ['proactivity']) is not None:
|
532
310
|
setv(
|
533
311
|
parent_object,
|
534
312
|
['setup', 'proactivity'],
|
535
|
-
|
536
|
-
getv(from_object, ['proactivity']), to_object
|
537
|
-
),
|
313
|
+
getv(from_object, ['proactivity']),
|
538
314
|
)
|
539
315
|
|
540
316
|
return to_object
|
@@ -565,37 +341,13 @@ def _LiveConnectConstraints_to_mldev(
|
|
565
341
|
return to_object
|
566
342
|
|
567
343
|
|
568
|
-
def _MultiSpeakerVoiceConfig_to_mldev(
|
569
|
-
from_object: Union[dict[str, Any], object],
|
570
|
-
parent_object: Optional[dict[str, Any]] = None,
|
571
|
-
) -> dict[str, Any]:
|
572
|
-
to_object: dict[str, Any] = {}
|
573
|
-
if getv(from_object, ['speaker_voice_configs']) is not None:
|
574
|
-
setv(
|
575
|
-
to_object,
|
576
|
-
['speakerVoiceConfigs'],
|
577
|
-
[
|
578
|
-
_SpeakerVoiceConfig_to_mldev(item, to_object)
|
579
|
-
for item in getv(from_object, ['speaker_voice_configs'])
|
580
|
-
],
|
581
|
-
)
|
582
|
-
|
583
|
-
return to_object
|
584
|
-
|
585
|
-
|
586
344
|
def _Part_to_mldev(
|
587
345
|
from_object: Union[dict[str, Any], object],
|
588
346
|
parent_object: Optional[dict[str, Any]] = None,
|
589
347
|
) -> dict[str, Any]:
|
590
348
|
to_object: dict[str, Any] = {}
|
591
349
|
if getv(from_object, ['video_metadata']) is not None:
|
592
|
-
setv(
|
593
|
-
to_object,
|
594
|
-
['videoMetadata'],
|
595
|
-
_VideoMetadata_to_mldev(
|
596
|
-
getv(from_object, ['video_metadata']), to_object
|
597
|
-
),
|
598
|
-
)
|
350
|
+
setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
|
599
351
|
|
600
352
|
if getv(from_object, ['thought']) is not None:
|
601
353
|
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
@@ -622,11 +374,7 @@ def _Part_to_mldev(
|
|
622
374
|
)
|
623
375
|
|
624
376
|
if getv(from_object, ['function_call']) is not None:
|
625
|
-
setv(
|
626
|
-
to_object,
|
627
|
-
['functionCall'],
|
628
|
-
_FunctionCall_to_mldev(getv(from_object, ['function_call']), to_object),
|
629
|
-
)
|
377
|
+
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
630
378
|
|
631
379
|
if getv(from_object, ['code_execution_result']) is not None:
|
632
380
|
setv(
|
@@ -651,55 +399,6 @@ def _Part_to_mldev(
|
|
651
399
|
return to_object
|
652
400
|
|
653
401
|
|
654
|
-
def _PrebuiltVoiceConfig_to_mldev(
|
655
|
-
from_object: Union[dict[str, Any], object],
|
656
|
-
parent_object: Optional[dict[str, Any]] = None,
|
657
|
-
) -> dict[str, Any]:
|
658
|
-
to_object: dict[str, Any] = {}
|
659
|
-
if getv(from_object, ['voice_name']) is not None:
|
660
|
-
setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
|
661
|
-
|
662
|
-
return to_object
|
663
|
-
|
664
|
-
|
665
|
-
def _ProactivityConfig_to_mldev(
|
666
|
-
from_object: Union[dict[str, Any], object],
|
667
|
-
parent_object: Optional[dict[str, Any]] = None,
|
668
|
-
) -> dict[str, Any]:
|
669
|
-
to_object: dict[str, Any] = {}
|
670
|
-
if getv(from_object, ['proactive_audio']) is not None:
|
671
|
-
setv(to_object, ['proactiveAudio'], getv(from_object, ['proactive_audio']))
|
672
|
-
|
673
|
-
return to_object
|
674
|
-
|
675
|
-
|
676
|
-
def _RealtimeInputConfig_to_mldev(
|
677
|
-
from_object: Union[dict[str, Any], object],
|
678
|
-
parent_object: Optional[dict[str, Any]] = None,
|
679
|
-
) -> dict[str, Any]:
|
680
|
-
to_object: dict[str, Any] = {}
|
681
|
-
if getv(from_object, ['automatic_activity_detection']) is not None:
|
682
|
-
setv(
|
683
|
-
to_object,
|
684
|
-
['automaticActivityDetection'],
|
685
|
-
_AutomaticActivityDetection_to_mldev(
|
686
|
-
getv(from_object, ['automatic_activity_detection']), to_object
|
687
|
-
),
|
688
|
-
)
|
689
|
-
|
690
|
-
if getv(from_object, ['activity_handling']) is not None:
|
691
|
-
setv(
|
692
|
-
to_object,
|
693
|
-
['activityHandling'],
|
694
|
-
getv(from_object, ['activity_handling']),
|
695
|
-
)
|
696
|
-
|
697
|
-
if getv(from_object, ['turn_coverage']) is not None:
|
698
|
-
setv(to_object, ['turnCoverage'], getv(from_object, ['turn_coverage']))
|
699
|
-
|
700
|
-
return to_object
|
701
|
-
|
702
|
-
|
703
402
|
def _SessionResumptionConfig_to_mldev(
|
704
403
|
from_object: Union[dict[str, Any], object],
|
705
404
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -714,78 +413,6 @@ def _SessionResumptionConfig_to_mldev(
|
|
714
413
|
return to_object
|
715
414
|
|
716
415
|
|
717
|
-
def _SlidingWindow_to_mldev(
|
718
|
-
from_object: Union[dict[str, Any], object],
|
719
|
-
parent_object: Optional[dict[str, Any]] = None,
|
720
|
-
) -> dict[str, Any]:
|
721
|
-
to_object: dict[str, Any] = {}
|
722
|
-
if getv(from_object, ['target_tokens']) is not None:
|
723
|
-
setv(to_object, ['targetTokens'], getv(from_object, ['target_tokens']))
|
724
|
-
|
725
|
-
return to_object
|
726
|
-
|
727
|
-
|
728
|
-
def _SpeakerVoiceConfig_to_mldev(
|
729
|
-
from_object: Union[dict[str, Any], object],
|
730
|
-
parent_object: Optional[dict[str, Any]] = None,
|
731
|
-
) -> dict[str, Any]:
|
732
|
-
to_object: dict[str, Any] = {}
|
733
|
-
if getv(from_object, ['speaker']) is not None:
|
734
|
-
setv(to_object, ['speaker'], getv(from_object, ['speaker']))
|
735
|
-
|
736
|
-
if getv(from_object, ['voice_config']) is not None:
|
737
|
-
setv(
|
738
|
-
to_object,
|
739
|
-
['voiceConfig'],
|
740
|
-
_VoiceConfig_to_mldev(getv(from_object, ['voice_config']), to_object),
|
741
|
-
)
|
742
|
-
|
743
|
-
return to_object
|
744
|
-
|
745
|
-
|
746
|
-
def _SpeechConfig_to_mldev(
|
747
|
-
from_object: Union[dict[str, Any], object],
|
748
|
-
parent_object: Optional[dict[str, Any]] = None,
|
749
|
-
) -> dict[str, Any]:
|
750
|
-
to_object: dict[str, Any] = {}
|
751
|
-
if getv(from_object, ['voice_config']) is not None:
|
752
|
-
setv(
|
753
|
-
to_object,
|
754
|
-
['voiceConfig'],
|
755
|
-
_VoiceConfig_to_mldev(getv(from_object, ['voice_config']), to_object),
|
756
|
-
)
|
757
|
-
|
758
|
-
if getv(from_object, ['multi_speaker_voice_config']) is not None:
|
759
|
-
setv(
|
760
|
-
to_object,
|
761
|
-
['multiSpeakerVoiceConfig'],
|
762
|
-
_MultiSpeakerVoiceConfig_to_mldev(
|
763
|
-
getv(from_object, ['multi_speaker_voice_config']), to_object
|
764
|
-
),
|
765
|
-
)
|
766
|
-
|
767
|
-
if getv(from_object, ['language_code']) is not None:
|
768
|
-
setv(to_object, ['languageCode'], getv(from_object, ['language_code']))
|
769
|
-
|
770
|
-
return to_object
|
771
|
-
|
772
|
-
|
773
|
-
def _ThinkingConfig_to_mldev(
|
774
|
-
from_object: Union[dict[str, Any], object],
|
775
|
-
parent_object: Optional[dict[str, Any]] = None,
|
776
|
-
) -> dict[str, Any]:
|
777
|
-
to_object: dict[str, Any] = {}
|
778
|
-
if getv(from_object, ['include_thoughts']) is not None:
|
779
|
-
setv(
|
780
|
-
to_object, ['includeThoughts'], getv(from_object, ['include_thoughts'])
|
781
|
-
)
|
782
|
-
|
783
|
-
if getv(from_object, ['thinking_budget']) is not None:
|
784
|
-
setv(to_object, ['thinkingBudget'], getv(from_object, ['thinking_budget']))
|
785
|
-
|
786
|
-
return to_object
|
787
|
-
|
788
|
-
|
789
416
|
def _Tool_to_mldev(
|
790
417
|
from_object: Union[dict[str, Any], object],
|
791
418
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -795,10 +422,7 @@ def _Tool_to_mldev(
|
|
795
422
|
setv(
|
796
423
|
to_object,
|
797
424
|
['functionDeclarations'],
|
798
|
-
[
|
799
|
-
_FunctionDeclaration_to_mldev(item, to_object)
|
800
|
-
for item in getv(from_object, ['function_declarations'])
|
801
|
-
],
|
425
|
+
[item for item in getv(from_object, ['function_declarations'])],
|
802
426
|
)
|
803
427
|
|
804
428
|
if getv(from_object, ['retrieval']) is not None:
|
@@ -815,9 +439,7 @@ def _Tool_to_mldev(
|
|
815
439
|
setv(
|
816
440
|
to_object,
|
817
441
|
['googleSearchRetrieval'],
|
818
|
-
|
819
|
-
getv(from_object, ['google_search_retrieval']), to_object
|
820
|
-
),
|
442
|
+
getv(from_object, ['google_search_retrieval']),
|
821
443
|
)
|
822
444
|
|
823
445
|
if getv(from_object, ['enterprise_web_search']) is not None:
|
@@ -829,63 +451,12 @@ def _Tool_to_mldev(
|
|
829
451
|
raise ValueError('google_maps parameter is not supported in Gemini API.')
|
830
452
|
|
831
453
|
if getv(from_object, ['url_context']) is not None:
|
832
|
-
setv(
|
833
|
-
to_object,
|
834
|
-
['urlContext'],
|
835
|
-
_UrlContext_to_mldev(getv(from_object, ['url_context']), to_object),
|
836
|
-
)
|
454
|
+
setv(to_object, ['urlContext'], getv(from_object, ['url_context']))
|
837
455
|
|
838
456
|
if getv(from_object, ['computer_use']) is not None:
|
839
|
-
setv(
|
840
|
-
to_object,
|
841
|
-
['computerUse'],
|
842
|
-
_ComputerUse_to_mldev(getv(from_object, ['computer_use']), to_object),
|
843
|
-
)
|
457
|
+
setv(to_object, ['computerUse'], getv(from_object, ['computer_use']))
|
844
458
|
|
845
459
|
if getv(from_object, ['code_execution']) is not None:
|
846
460
|
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
847
461
|
|
848
462
|
return to_object
|
849
|
-
|
850
|
-
|
851
|
-
def _UrlContext_to_mldev(
|
852
|
-
from_object: Union[dict[str, Any], object],
|
853
|
-
parent_object: Optional[dict[str, Any]] = None,
|
854
|
-
) -> dict[str, Any]:
|
855
|
-
to_object: dict[str, Any] = {}
|
856
|
-
|
857
|
-
return to_object
|
858
|
-
|
859
|
-
|
860
|
-
def _VideoMetadata_to_mldev(
|
861
|
-
from_object: Union[dict[str, Any], object],
|
862
|
-
parent_object: Optional[dict[str, Any]] = None,
|
863
|
-
) -> dict[str, Any]:
|
864
|
-
to_object: dict[str, Any] = {}
|
865
|
-
if getv(from_object, ['fps']) is not None:
|
866
|
-
setv(to_object, ['fps'], getv(from_object, ['fps']))
|
867
|
-
|
868
|
-
if getv(from_object, ['end_offset']) is not None:
|
869
|
-
setv(to_object, ['endOffset'], getv(from_object, ['end_offset']))
|
870
|
-
|
871
|
-
if getv(from_object, ['start_offset']) is not None:
|
872
|
-
setv(to_object, ['startOffset'], getv(from_object, ['start_offset']))
|
873
|
-
|
874
|
-
return to_object
|
875
|
-
|
876
|
-
|
877
|
-
def _VoiceConfig_to_mldev(
|
878
|
-
from_object: Union[dict[str, Any], object],
|
879
|
-
parent_object: Optional[dict[str, Any]] = None,
|
880
|
-
) -> dict[str, Any]:
|
881
|
-
to_object: dict[str, Any] = {}
|
882
|
-
if getv(from_object, ['prebuilt_voice_config']) is not None:
|
883
|
-
setv(
|
884
|
-
to_object,
|
885
|
-
['prebuiltVoiceConfig'],
|
886
|
-
_PrebuiltVoiceConfig_to_mldev(
|
887
|
-
getv(from_object, ['prebuilt_voice_config']), to_object
|
888
|
-
),
|
889
|
-
)
|
890
|
-
|
891
|
-
return to_object
|