google-genai 1.11.0__py3-none-any.whl → 1.12.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 +25 -24
- google/genai/_automatic_function_calling_util.py +4 -24
- google/genai/_common.py +40 -37
- google/genai/_extra_utils.py +7 -7
- google/genai/_live_converters.py +2487 -0
- google/genai/_replay_api_client.py +32 -26
- google/genai/_transformers.py +46 -81
- google/genai/batches.py +45 -45
- google/genai/caches.py +126 -126
- google/genai/chats.py +13 -9
- google/genai/client.py +3 -2
- google/genai/errors.py +6 -6
- google/genai/files.py +38 -38
- google/genai/live.py +69 -17
- google/genai/models.py +388 -388
- google/genai/operations.py +33 -33
- google/genai/pagers.py +2 -2
- google/genai/py.typed +1 -0
- google/genai/tunings.py +70 -70
- google/genai/types.py +455 -24
- google/genai/version.py +1 -1
- {google_genai-1.11.0.dist-info → google_genai-1.12.0.dist-info}/METADATA +1 -1
- google_genai-1.12.0.dist-info/RECORD +29 -0
- {google_genai-1.11.0.dist-info → google_genai-1.12.0.dist-info}/WHEEL +1 -1
- google/genai/live_converters.py +0 -1298
- google_genai-1.11.0.dist-info/RECORD +0 -28
- {google_genai-1.11.0.dist-info → google_genai-1.12.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.11.0.dist-info → google_genai-1.12.0.dist-info}/top_level.txt +0 -0
google/genai/models.py
CHANGED
@@ -33,9 +33,9 @@ logger = logging.getLogger('google_genai.models')
|
|
33
33
|
|
34
34
|
def _Part_to_mldev(
|
35
35
|
api_client: BaseApiClient,
|
36
|
-
from_object: Union[dict, object],
|
37
|
-
parent_object: Optional[dict] = None,
|
38
|
-
) -> dict:
|
36
|
+
from_object: Union[dict[str, Any], object],
|
37
|
+
parent_object: Optional[dict[str, Any]] = None,
|
38
|
+
) -> dict[str, Any]:
|
39
39
|
to_object: dict[str, Any] = {}
|
40
40
|
if getv(from_object, ['video_metadata']) is not None:
|
41
41
|
raise ValueError('video_metadata parameter is not supported in Gemini API.')
|
@@ -77,9 +77,9 @@ def _Part_to_mldev(
|
|
77
77
|
|
78
78
|
def _Content_to_mldev(
|
79
79
|
api_client: BaseApiClient,
|
80
|
-
from_object: Union[dict, object],
|
81
|
-
parent_object: Optional[dict] = None,
|
82
|
-
) -> dict:
|
80
|
+
from_object: Union[dict[str, Any], object],
|
81
|
+
parent_object: Optional[dict[str, Any]] = None,
|
82
|
+
) -> dict[str, Any]:
|
83
83
|
to_object: dict[str, Any] = {}
|
84
84
|
if getv(from_object, ['parts']) is not None:
|
85
85
|
setv(
|
@@ -99,9 +99,9 @@ def _Content_to_mldev(
|
|
99
99
|
|
100
100
|
def _Schema_to_mldev(
|
101
101
|
api_client: BaseApiClient,
|
102
|
-
from_object: Union[dict, object],
|
103
|
-
parent_object: Optional[dict] = None,
|
104
|
-
) -> dict:
|
102
|
+
from_object: Union[dict[str, Any], object],
|
103
|
+
parent_object: Optional[dict[str, Any]] = None,
|
104
|
+
) -> dict[str, Any]:
|
105
105
|
to_object: dict[str, Any] = {}
|
106
106
|
if getv(from_object, ['example']) is not None:
|
107
107
|
raise ValueError('example parameter is not supported in Gemini API.')
|
@@ -178,9 +178,9 @@ def _Schema_to_mldev(
|
|
178
178
|
|
179
179
|
def _ModelSelectionConfig_to_mldev(
|
180
180
|
api_client: BaseApiClient,
|
181
|
-
from_object: Union[dict, object],
|
182
|
-
parent_object: Optional[dict] = None,
|
183
|
-
) -> dict:
|
181
|
+
from_object: Union[dict[str, Any], object],
|
182
|
+
parent_object: Optional[dict[str, Any]] = None,
|
183
|
+
) -> dict[str, Any]:
|
184
184
|
to_object: dict[str, Any] = {}
|
185
185
|
if getv(from_object, ['feature_selection_preference']) is not None:
|
186
186
|
raise ValueError(
|
@@ -192,9 +192,9 @@ def _ModelSelectionConfig_to_mldev(
|
|
192
192
|
|
193
193
|
def _SafetySetting_to_mldev(
|
194
194
|
api_client: BaseApiClient,
|
195
|
-
from_object: Union[dict, object],
|
196
|
-
parent_object: Optional[dict] = None,
|
197
|
-
) -> dict:
|
195
|
+
from_object: Union[dict[str, Any], object],
|
196
|
+
parent_object: Optional[dict[str, Any]] = None,
|
197
|
+
) -> dict[str, Any]:
|
198
198
|
to_object: dict[str, Any] = {}
|
199
199
|
if getv(from_object, ['method']) is not None:
|
200
200
|
raise ValueError('method parameter is not supported in Gemini API.')
|
@@ -210,9 +210,9 @@ def _SafetySetting_to_mldev(
|
|
210
210
|
|
211
211
|
def _FunctionDeclaration_to_mldev(
|
212
212
|
api_client: BaseApiClient,
|
213
|
-
from_object: Union[dict, object],
|
214
|
-
parent_object: Optional[dict] = None,
|
215
|
-
) -> dict:
|
213
|
+
from_object: Union[dict[str, Any], object],
|
214
|
+
parent_object: Optional[dict[str, Any]] = None,
|
215
|
+
) -> dict[str, Any]:
|
216
216
|
to_object: dict[str, Any] = {}
|
217
217
|
if getv(from_object, ['response']) is not None:
|
218
218
|
raise ValueError('response parameter is not supported in Gemini API.')
|
@@ -231,9 +231,9 @@ def _FunctionDeclaration_to_mldev(
|
|
231
231
|
|
232
232
|
def _GoogleSearch_to_mldev(
|
233
233
|
api_client: BaseApiClient,
|
234
|
-
from_object: Union[dict, object],
|
235
|
-
parent_object: Optional[dict] = None,
|
236
|
-
) -> dict:
|
234
|
+
from_object: Union[dict[str, Any], object],
|
235
|
+
parent_object: Optional[dict[str, Any]] = None,
|
236
|
+
) -> dict[str, Any]:
|
237
237
|
to_object: dict[str, Any] = {}
|
238
238
|
|
239
239
|
return to_object
|
@@ -241,9 +241,9 @@ def _GoogleSearch_to_mldev(
|
|
241
241
|
|
242
242
|
def _DynamicRetrievalConfig_to_mldev(
|
243
243
|
api_client: BaseApiClient,
|
244
|
-
from_object: Union[dict, object],
|
245
|
-
parent_object: Optional[dict] = None,
|
246
|
-
) -> dict:
|
244
|
+
from_object: Union[dict[str, Any], object],
|
245
|
+
parent_object: Optional[dict[str, Any]] = None,
|
246
|
+
) -> dict[str, Any]:
|
247
247
|
to_object: dict[str, Any] = {}
|
248
248
|
if getv(from_object, ['mode']) is not None:
|
249
249
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
@@ -260,9 +260,9 @@ def _DynamicRetrievalConfig_to_mldev(
|
|
260
260
|
|
261
261
|
def _GoogleSearchRetrieval_to_mldev(
|
262
262
|
api_client: BaseApiClient,
|
263
|
-
from_object: Union[dict, object],
|
264
|
-
parent_object: Optional[dict] = None,
|
265
|
-
) -> dict:
|
263
|
+
from_object: Union[dict[str, Any], object],
|
264
|
+
parent_object: Optional[dict[str, Any]] = None,
|
265
|
+
) -> dict[str, Any]:
|
266
266
|
to_object: dict[str, Any] = {}
|
267
267
|
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
268
268
|
setv(
|
@@ -280,9 +280,9 @@ def _GoogleSearchRetrieval_to_mldev(
|
|
280
280
|
|
281
281
|
def _Tool_to_mldev(
|
282
282
|
api_client: BaseApiClient,
|
283
|
-
from_object: Union[dict, object],
|
284
|
-
parent_object: Optional[dict] = None,
|
285
|
-
) -> dict:
|
283
|
+
from_object: Union[dict[str, Any], object],
|
284
|
+
parent_object: Optional[dict[str, Any]] = None,
|
285
|
+
) -> dict[str, Any]:
|
286
286
|
to_object: dict[str, Any] = {}
|
287
287
|
if getv(from_object, ['function_declarations']) is not None:
|
288
288
|
setv(
|
@@ -325,9 +325,9 @@ def _Tool_to_mldev(
|
|
325
325
|
|
326
326
|
def _FunctionCallingConfig_to_mldev(
|
327
327
|
api_client: BaseApiClient,
|
328
|
-
from_object: Union[dict, object],
|
329
|
-
parent_object: Optional[dict] = None,
|
330
|
-
) -> dict:
|
328
|
+
from_object: Union[dict[str, Any], object],
|
329
|
+
parent_object: Optional[dict[str, Any]] = None,
|
330
|
+
) -> dict[str, Any]:
|
331
331
|
to_object: dict[str, Any] = {}
|
332
332
|
if getv(from_object, ['mode']) is not None:
|
333
333
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
@@ -344,9 +344,9 @@ def _FunctionCallingConfig_to_mldev(
|
|
344
344
|
|
345
345
|
def _ToolConfig_to_mldev(
|
346
346
|
api_client: BaseApiClient,
|
347
|
-
from_object: Union[dict, object],
|
348
|
-
parent_object: Optional[dict] = None,
|
349
|
-
) -> dict:
|
347
|
+
from_object: Union[dict[str, Any], object],
|
348
|
+
parent_object: Optional[dict[str, Any]] = None,
|
349
|
+
) -> dict[str, Any]:
|
350
350
|
to_object: dict[str, Any] = {}
|
351
351
|
if getv(from_object, ['function_calling_config']) is not None:
|
352
352
|
setv(
|
@@ -364,9 +364,9 @@ def _ToolConfig_to_mldev(
|
|
364
364
|
|
365
365
|
def _PrebuiltVoiceConfig_to_mldev(
|
366
366
|
api_client: BaseApiClient,
|
367
|
-
from_object: Union[dict, object],
|
368
|
-
parent_object: Optional[dict] = None,
|
369
|
-
) -> dict:
|
367
|
+
from_object: Union[dict[str, Any], object],
|
368
|
+
parent_object: Optional[dict[str, Any]] = None,
|
369
|
+
) -> dict[str, Any]:
|
370
370
|
to_object: dict[str, Any] = {}
|
371
371
|
if getv(from_object, ['voice_name']) is not None:
|
372
372
|
setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
|
@@ -376,9 +376,9 @@ def _PrebuiltVoiceConfig_to_mldev(
|
|
376
376
|
|
377
377
|
def _VoiceConfig_to_mldev(
|
378
378
|
api_client: BaseApiClient,
|
379
|
-
from_object: Union[dict, object],
|
380
|
-
parent_object: Optional[dict] = None,
|
381
|
-
) -> dict:
|
379
|
+
from_object: Union[dict[str, Any], object],
|
380
|
+
parent_object: Optional[dict[str, Any]] = None,
|
381
|
+
) -> dict[str, Any]:
|
382
382
|
to_object: dict[str, Any] = {}
|
383
383
|
if getv(from_object, ['prebuilt_voice_config']) is not None:
|
384
384
|
setv(
|
@@ -394,9 +394,9 @@ def _VoiceConfig_to_mldev(
|
|
394
394
|
|
395
395
|
def _SpeechConfig_to_mldev(
|
396
396
|
api_client: BaseApiClient,
|
397
|
-
from_object: Union[dict, object],
|
398
|
-
parent_object: Optional[dict] = None,
|
399
|
-
) -> dict:
|
397
|
+
from_object: Union[dict[str, Any], object],
|
398
|
+
parent_object: Optional[dict[str, Any]] = None,
|
399
|
+
) -> dict[str, Any]:
|
400
400
|
to_object: dict[str, Any] = {}
|
401
401
|
if getv(from_object, ['voice_config']) is not None:
|
402
402
|
setv(
|
@@ -415,9 +415,9 @@ def _SpeechConfig_to_mldev(
|
|
415
415
|
|
416
416
|
def _ThinkingConfig_to_mldev(
|
417
417
|
api_client: BaseApiClient,
|
418
|
-
from_object: Union[dict, object],
|
419
|
-
parent_object: Optional[dict] = None,
|
420
|
-
) -> dict:
|
418
|
+
from_object: Union[dict[str, Any], object],
|
419
|
+
parent_object: Optional[dict[str, Any]] = None,
|
420
|
+
) -> dict[str, Any]:
|
421
421
|
to_object: dict[str, Any] = {}
|
422
422
|
if getv(from_object, ['include_thoughts']) is not None:
|
423
423
|
setv(
|
@@ -432,9 +432,9 @@ def _ThinkingConfig_to_mldev(
|
|
432
432
|
|
433
433
|
def _GenerateContentConfig_to_mldev(
|
434
434
|
api_client: BaseApiClient,
|
435
|
-
from_object: Union[dict, object],
|
436
|
-
parent_object: Optional[dict] = None,
|
437
|
-
) -> dict:
|
435
|
+
from_object: Union[dict[str, Any], object],
|
436
|
+
parent_object: Optional[dict[str, Any]] = None,
|
437
|
+
) -> dict[str, Any]:
|
438
438
|
to_object: dict[str, Any] = {}
|
439
439
|
|
440
440
|
if getv(from_object, ['system_instruction']) is not None:
|
@@ -602,9 +602,9 @@ def _GenerateContentConfig_to_mldev(
|
|
602
602
|
|
603
603
|
def _GenerateContentParameters_to_mldev(
|
604
604
|
api_client: BaseApiClient,
|
605
|
-
from_object: Union[dict, object],
|
606
|
-
parent_object: Optional[dict] = None,
|
607
|
-
) -> dict:
|
605
|
+
from_object: Union[dict[str, Any], object],
|
606
|
+
parent_object: Optional[dict[str, Any]] = None,
|
607
|
+
) -> dict[str, Any]:
|
608
608
|
to_object: dict[str, Any] = {}
|
609
609
|
if getv(from_object, ['model']) is not None:
|
610
610
|
setv(
|
@@ -639,9 +639,9 @@ def _GenerateContentParameters_to_mldev(
|
|
639
639
|
|
640
640
|
def _EmbedContentConfig_to_mldev(
|
641
641
|
api_client: BaseApiClient,
|
642
|
-
from_object: Union[dict, object],
|
643
|
-
parent_object: Optional[dict] = None,
|
644
|
-
) -> dict:
|
642
|
+
from_object: Union[dict[str, Any], object],
|
643
|
+
parent_object: Optional[dict[str, Any]] = None,
|
644
|
+
) -> dict[str, Any]:
|
645
645
|
to_object: dict[str, Any] = {}
|
646
646
|
|
647
647
|
if getv(from_object, ['task_type']) is not None:
|
@@ -672,9 +672,9 @@ def _EmbedContentConfig_to_mldev(
|
|
672
672
|
|
673
673
|
def _EmbedContentParameters_to_mldev(
|
674
674
|
api_client: BaseApiClient,
|
675
|
-
from_object: Union[dict, object],
|
676
|
-
parent_object: Optional[dict] = None,
|
677
|
-
) -> dict:
|
675
|
+
from_object: Union[dict[str, Any], object],
|
676
|
+
parent_object: Optional[dict[str, Any]] = None,
|
677
|
+
) -> dict[str, Any]:
|
678
678
|
to_object: dict[str, Any] = {}
|
679
679
|
if getv(from_object, ['model']) is not None:
|
680
680
|
setv(
|
@@ -709,9 +709,9 @@ def _EmbedContentParameters_to_mldev(
|
|
709
709
|
|
710
710
|
def _GenerateImagesConfig_to_mldev(
|
711
711
|
api_client: BaseApiClient,
|
712
|
-
from_object: Union[dict, object],
|
713
|
-
parent_object: Optional[dict] = None,
|
714
|
-
) -> dict:
|
712
|
+
from_object: Union[dict[str, Any], object],
|
713
|
+
parent_object: Optional[dict[str, Any]] = None,
|
714
|
+
) -> dict[str, Any]:
|
715
715
|
to_object: dict[str, Any] = {}
|
716
716
|
|
717
717
|
if getv(from_object, ['output_gcs_uri']) is not None:
|
@@ -812,9 +812,9 @@ def _GenerateImagesConfig_to_mldev(
|
|
812
812
|
|
813
813
|
def _GenerateImagesParameters_to_mldev(
|
814
814
|
api_client: BaseApiClient,
|
815
|
-
from_object: Union[dict, object],
|
816
|
-
parent_object: Optional[dict] = None,
|
817
|
-
) -> dict:
|
815
|
+
from_object: Union[dict[str, Any], object],
|
816
|
+
parent_object: Optional[dict[str, Any]] = None,
|
817
|
+
) -> dict[str, Any]:
|
818
818
|
to_object: dict[str, Any] = {}
|
819
819
|
if getv(from_object, ['model']) is not None:
|
820
820
|
setv(
|
@@ -840,9 +840,9 @@ def _GenerateImagesParameters_to_mldev(
|
|
840
840
|
|
841
841
|
def _GetModelParameters_to_mldev(
|
842
842
|
api_client: BaseApiClient,
|
843
|
-
from_object: Union[dict, object],
|
844
|
-
parent_object: Optional[dict] = None,
|
845
|
-
) -> dict:
|
843
|
+
from_object: Union[dict[str, Any], object],
|
844
|
+
parent_object: Optional[dict[str, Any]] = None,
|
845
|
+
) -> dict[str, Any]:
|
846
846
|
to_object: dict[str, Any] = {}
|
847
847
|
if getv(from_object, ['model']) is not None:
|
848
848
|
setv(
|
@@ -859,9 +859,9 @@ def _GetModelParameters_to_mldev(
|
|
859
859
|
|
860
860
|
def _ListModelsConfig_to_mldev(
|
861
861
|
api_client: BaseApiClient,
|
862
|
-
from_object: Union[dict, object],
|
863
|
-
parent_object: Optional[dict] = None,
|
864
|
-
) -> dict:
|
862
|
+
from_object: Union[dict[str, Any], object],
|
863
|
+
parent_object: Optional[dict[str, Any]] = None,
|
864
|
+
) -> dict[str, Any]:
|
865
865
|
to_object: dict[str, Any] = {}
|
866
866
|
|
867
867
|
if getv(from_object, ['page_size']) is not None:
|
@@ -891,9 +891,9 @@ def _ListModelsConfig_to_mldev(
|
|
891
891
|
|
892
892
|
def _ListModelsParameters_to_mldev(
|
893
893
|
api_client: BaseApiClient,
|
894
|
-
from_object: Union[dict, object],
|
895
|
-
parent_object: Optional[dict] = None,
|
896
|
-
) -> dict:
|
894
|
+
from_object: Union[dict[str, Any], object],
|
895
|
+
parent_object: Optional[dict[str, Any]] = None,
|
896
|
+
) -> dict[str, Any]:
|
897
897
|
to_object: dict[str, Any] = {}
|
898
898
|
if getv(from_object, ['config']) is not None:
|
899
899
|
setv(
|
@@ -909,9 +909,9 @@ def _ListModelsParameters_to_mldev(
|
|
909
909
|
|
910
910
|
def _UpdateModelConfig_to_mldev(
|
911
911
|
api_client: BaseApiClient,
|
912
|
-
from_object: Union[dict, object],
|
913
|
-
parent_object: Optional[dict] = None,
|
914
|
-
) -> dict:
|
912
|
+
from_object: Union[dict[str, Any], object],
|
913
|
+
parent_object: Optional[dict[str, Any]] = None,
|
914
|
+
) -> dict[str, Any]:
|
915
915
|
to_object: dict[str, Any] = {}
|
916
916
|
|
917
917
|
if getv(from_object, ['display_name']) is not None:
|
@@ -925,9 +925,9 @@ def _UpdateModelConfig_to_mldev(
|
|
925
925
|
|
926
926
|
def _UpdateModelParameters_to_mldev(
|
927
927
|
api_client: BaseApiClient,
|
928
|
-
from_object: Union[dict, object],
|
929
|
-
parent_object: Optional[dict] = None,
|
930
|
-
) -> dict:
|
928
|
+
from_object: Union[dict[str, Any], object],
|
929
|
+
parent_object: Optional[dict[str, Any]] = None,
|
930
|
+
) -> dict[str, Any]:
|
931
931
|
to_object: dict[str, Any] = {}
|
932
932
|
if getv(from_object, ['model']) is not None:
|
933
933
|
setv(
|
@@ -950,9 +950,9 @@ def _UpdateModelParameters_to_mldev(
|
|
950
950
|
|
951
951
|
def _DeleteModelParameters_to_mldev(
|
952
952
|
api_client: BaseApiClient,
|
953
|
-
from_object: Union[dict, object],
|
954
|
-
parent_object: Optional[dict] = None,
|
955
|
-
) -> dict:
|
953
|
+
from_object: Union[dict[str, Any], object],
|
954
|
+
parent_object: Optional[dict[str, Any]] = None,
|
955
|
+
) -> dict[str, Any]:
|
956
956
|
to_object: dict[str, Any] = {}
|
957
957
|
if getv(from_object, ['model']) is not None:
|
958
958
|
setv(
|
@@ -969,9 +969,9 @@ def _DeleteModelParameters_to_mldev(
|
|
969
969
|
|
970
970
|
def _CountTokensConfig_to_mldev(
|
971
971
|
api_client: BaseApiClient,
|
972
|
-
from_object: Union[dict, object],
|
973
|
-
parent_object: Optional[dict] = None,
|
974
|
-
) -> dict:
|
972
|
+
from_object: Union[dict[str, Any], object],
|
973
|
+
parent_object: Optional[dict[str, Any]] = None,
|
974
|
+
) -> dict[str, Any]:
|
975
975
|
to_object: dict[str, Any] = {}
|
976
976
|
|
977
977
|
if getv(from_object, ['system_instruction']) is not None:
|
@@ -992,9 +992,9 @@ def _CountTokensConfig_to_mldev(
|
|
992
992
|
|
993
993
|
def _CountTokensParameters_to_mldev(
|
994
994
|
api_client: BaseApiClient,
|
995
|
-
from_object: Union[dict, object],
|
996
|
-
parent_object: Optional[dict] = None,
|
997
|
-
) -> dict:
|
995
|
+
from_object: Union[dict[str, Any], object],
|
996
|
+
parent_object: Optional[dict[str, Any]] = None,
|
997
|
+
) -> dict[str, Any]:
|
998
998
|
to_object: dict[str, Any] = {}
|
999
999
|
if getv(from_object, ['model']) is not None:
|
1000
1000
|
setv(
|
@@ -1029,9 +1029,9 @@ def _CountTokensParameters_to_mldev(
|
|
1029
1029
|
|
1030
1030
|
def _Image_to_mldev(
|
1031
1031
|
api_client: BaseApiClient,
|
1032
|
-
from_object: Union[dict, object],
|
1033
|
-
parent_object: Optional[dict] = None,
|
1034
|
-
) -> dict:
|
1032
|
+
from_object: Union[dict[str, Any], object],
|
1033
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1034
|
+
) -> dict[str, Any]:
|
1035
1035
|
to_object: dict[str, Any] = {}
|
1036
1036
|
if getv(from_object, ['gcs_uri']) is not None:
|
1037
1037
|
raise ValueError('gcs_uri parameter is not supported in Gemini API.')
|
@@ -1051,9 +1051,9 @@ def _Image_to_mldev(
|
|
1051
1051
|
|
1052
1052
|
def _GenerateVideosConfig_to_mldev(
|
1053
1053
|
api_client: BaseApiClient,
|
1054
|
-
from_object: Union[dict, object],
|
1055
|
-
parent_object: Optional[dict] = None,
|
1056
|
-
) -> dict:
|
1054
|
+
from_object: Union[dict[str, Any], object],
|
1055
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1056
|
+
) -> dict[str, Any]:
|
1057
1057
|
to_object: dict[str, Any] = {}
|
1058
1058
|
|
1059
1059
|
if getv(from_object, ['number_of_videos']) is not None:
|
@@ -1114,9 +1114,9 @@ def _GenerateVideosConfig_to_mldev(
|
|
1114
1114
|
|
1115
1115
|
def _GenerateVideosParameters_to_mldev(
|
1116
1116
|
api_client: BaseApiClient,
|
1117
|
-
from_object: Union[dict, object],
|
1118
|
-
parent_object: Optional[dict] = None,
|
1119
|
-
) -> dict:
|
1117
|
+
from_object: Union[dict[str, Any], object],
|
1118
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1119
|
+
) -> dict[str, Any]:
|
1120
1120
|
to_object: dict[str, Any] = {}
|
1121
1121
|
if getv(from_object, ['model']) is not None:
|
1122
1122
|
setv(
|
@@ -1149,9 +1149,9 @@ def _GenerateVideosParameters_to_mldev(
|
|
1149
1149
|
|
1150
1150
|
def _Part_to_vertex(
|
1151
1151
|
api_client: BaseApiClient,
|
1152
|
-
from_object: Union[dict, object],
|
1153
|
-
parent_object: Optional[dict] = None,
|
1154
|
-
) -> dict:
|
1152
|
+
from_object: Union[dict[str, Any], object],
|
1153
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1154
|
+
) -> dict[str, Any]:
|
1155
1155
|
to_object: dict[str, Any] = {}
|
1156
1156
|
if getv(from_object, ['video_metadata']) is not None:
|
1157
1157
|
setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
|
@@ -1193,9 +1193,9 @@ def _Part_to_vertex(
|
|
1193
1193
|
|
1194
1194
|
def _Content_to_vertex(
|
1195
1195
|
api_client: BaseApiClient,
|
1196
|
-
from_object: Union[dict, object],
|
1197
|
-
parent_object: Optional[dict] = None,
|
1198
|
-
) -> dict:
|
1196
|
+
from_object: Union[dict[str, Any], object],
|
1197
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1198
|
+
) -> dict[str, Any]:
|
1199
1199
|
to_object: dict[str, Any] = {}
|
1200
1200
|
if getv(from_object, ['parts']) is not None:
|
1201
1201
|
setv(
|
@@ -1215,9 +1215,9 @@ def _Content_to_vertex(
|
|
1215
1215
|
|
1216
1216
|
def _Schema_to_vertex(
|
1217
1217
|
api_client: BaseApiClient,
|
1218
|
-
from_object: Union[dict, object],
|
1219
|
-
parent_object: Optional[dict] = None,
|
1220
|
-
) -> dict:
|
1218
|
+
from_object: Union[dict[str, Any], object],
|
1219
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1220
|
+
) -> dict[str, Any]:
|
1221
1221
|
to_object: dict[str, Any] = {}
|
1222
1222
|
if getv(from_object, ['example']) is not None:
|
1223
1223
|
setv(to_object, ['example'], getv(from_object, ['example']))
|
@@ -1294,9 +1294,9 @@ def _Schema_to_vertex(
|
|
1294
1294
|
|
1295
1295
|
def _ModelSelectionConfig_to_vertex(
|
1296
1296
|
api_client: BaseApiClient,
|
1297
|
-
from_object: Union[dict, object],
|
1298
|
-
parent_object: Optional[dict] = None,
|
1299
|
-
) -> dict:
|
1297
|
+
from_object: Union[dict[str, Any], object],
|
1298
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1299
|
+
) -> dict[str, Any]:
|
1300
1300
|
to_object: dict[str, Any] = {}
|
1301
1301
|
if getv(from_object, ['feature_selection_preference']) is not None:
|
1302
1302
|
setv(
|
@@ -1310,9 +1310,9 @@ def _ModelSelectionConfig_to_vertex(
|
|
1310
1310
|
|
1311
1311
|
def _SafetySetting_to_vertex(
|
1312
1312
|
api_client: BaseApiClient,
|
1313
|
-
from_object: Union[dict, object],
|
1314
|
-
parent_object: Optional[dict] = None,
|
1315
|
-
) -> dict:
|
1313
|
+
from_object: Union[dict[str, Any], object],
|
1314
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1315
|
+
) -> dict[str, Any]:
|
1316
1316
|
to_object: dict[str, Any] = {}
|
1317
1317
|
if getv(from_object, ['method']) is not None:
|
1318
1318
|
setv(to_object, ['method'], getv(from_object, ['method']))
|
@@ -1328,9 +1328,9 @@ def _SafetySetting_to_vertex(
|
|
1328
1328
|
|
1329
1329
|
def _FunctionDeclaration_to_vertex(
|
1330
1330
|
api_client: BaseApiClient,
|
1331
|
-
from_object: Union[dict, object],
|
1332
|
-
parent_object: Optional[dict] = None,
|
1333
|
-
) -> dict:
|
1331
|
+
from_object: Union[dict[str, Any], object],
|
1332
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1333
|
+
) -> dict[str, Any]:
|
1334
1334
|
to_object: dict[str, Any] = {}
|
1335
1335
|
if getv(from_object, ['response']) is not None:
|
1336
1336
|
setv(
|
@@ -1355,9 +1355,9 @@ def _FunctionDeclaration_to_vertex(
|
|
1355
1355
|
|
1356
1356
|
def _GoogleSearch_to_vertex(
|
1357
1357
|
api_client: BaseApiClient,
|
1358
|
-
from_object: Union[dict, object],
|
1359
|
-
parent_object: Optional[dict] = None,
|
1360
|
-
) -> dict:
|
1358
|
+
from_object: Union[dict[str, Any], object],
|
1359
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1360
|
+
) -> dict[str, Any]:
|
1361
1361
|
to_object: dict[str, Any] = {}
|
1362
1362
|
|
1363
1363
|
return to_object
|
@@ -1365,9 +1365,9 @@ def _GoogleSearch_to_vertex(
|
|
1365
1365
|
|
1366
1366
|
def _DynamicRetrievalConfig_to_vertex(
|
1367
1367
|
api_client: BaseApiClient,
|
1368
|
-
from_object: Union[dict, object],
|
1369
|
-
parent_object: Optional[dict] = None,
|
1370
|
-
) -> dict:
|
1368
|
+
from_object: Union[dict[str, Any], object],
|
1369
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1370
|
+
) -> dict[str, Any]:
|
1371
1371
|
to_object: dict[str, Any] = {}
|
1372
1372
|
if getv(from_object, ['mode']) is not None:
|
1373
1373
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
@@ -1384,9 +1384,9 @@ def _DynamicRetrievalConfig_to_vertex(
|
|
1384
1384
|
|
1385
1385
|
def _GoogleSearchRetrieval_to_vertex(
|
1386
1386
|
api_client: BaseApiClient,
|
1387
|
-
from_object: Union[dict, object],
|
1388
|
-
parent_object: Optional[dict] = None,
|
1389
|
-
) -> dict:
|
1387
|
+
from_object: Union[dict[str, Any], object],
|
1388
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1389
|
+
) -> dict[str, Any]:
|
1390
1390
|
to_object: dict[str, Any] = {}
|
1391
1391
|
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
1392
1392
|
setv(
|
@@ -1404,9 +1404,9 @@ def _GoogleSearchRetrieval_to_vertex(
|
|
1404
1404
|
|
1405
1405
|
def _Tool_to_vertex(
|
1406
1406
|
api_client: BaseApiClient,
|
1407
|
-
from_object: Union[dict, object],
|
1408
|
-
parent_object: Optional[dict] = None,
|
1409
|
-
) -> dict:
|
1407
|
+
from_object: Union[dict[str, Any], object],
|
1408
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1409
|
+
) -> dict[str, Any]:
|
1410
1410
|
to_object: dict[str, Any] = {}
|
1411
1411
|
if getv(from_object, ['function_declarations']) is not None:
|
1412
1412
|
setv(
|
@@ -1449,9 +1449,9 @@ def _Tool_to_vertex(
|
|
1449
1449
|
|
1450
1450
|
def _FunctionCallingConfig_to_vertex(
|
1451
1451
|
api_client: BaseApiClient,
|
1452
|
-
from_object: Union[dict, object],
|
1453
|
-
parent_object: Optional[dict] = None,
|
1454
|
-
) -> dict:
|
1452
|
+
from_object: Union[dict[str, Any], object],
|
1453
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1454
|
+
) -> dict[str, Any]:
|
1455
1455
|
to_object: dict[str, Any] = {}
|
1456
1456
|
if getv(from_object, ['mode']) is not None:
|
1457
1457
|
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
@@ -1468,9 +1468,9 @@ def _FunctionCallingConfig_to_vertex(
|
|
1468
1468
|
|
1469
1469
|
def _ToolConfig_to_vertex(
|
1470
1470
|
api_client: BaseApiClient,
|
1471
|
-
from_object: Union[dict, object],
|
1472
|
-
parent_object: Optional[dict] = None,
|
1473
|
-
) -> dict:
|
1471
|
+
from_object: Union[dict[str, Any], object],
|
1472
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1473
|
+
) -> dict[str, Any]:
|
1474
1474
|
to_object: dict[str, Any] = {}
|
1475
1475
|
if getv(from_object, ['function_calling_config']) is not None:
|
1476
1476
|
setv(
|
@@ -1488,9 +1488,9 @@ def _ToolConfig_to_vertex(
|
|
1488
1488
|
|
1489
1489
|
def _PrebuiltVoiceConfig_to_vertex(
|
1490
1490
|
api_client: BaseApiClient,
|
1491
|
-
from_object: Union[dict, object],
|
1492
|
-
parent_object: Optional[dict] = None,
|
1493
|
-
) -> dict:
|
1491
|
+
from_object: Union[dict[str, Any], object],
|
1492
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1493
|
+
) -> dict[str, Any]:
|
1494
1494
|
to_object: dict[str, Any] = {}
|
1495
1495
|
if getv(from_object, ['voice_name']) is not None:
|
1496
1496
|
setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
|
@@ -1500,9 +1500,9 @@ def _PrebuiltVoiceConfig_to_vertex(
|
|
1500
1500
|
|
1501
1501
|
def _VoiceConfig_to_vertex(
|
1502
1502
|
api_client: BaseApiClient,
|
1503
|
-
from_object: Union[dict, object],
|
1504
|
-
parent_object: Optional[dict] = None,
|
1505
|
-
) -> dict:
|
1503
|
+
from_object: Union[dict[str, Any], object],
|
1504
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1505
|
+
) -> dict[str, Any]:
|
1506
1506
|
to_object: dict[str, Any] = {}
|
1507
1507
|
if getv(from_object, ['prebuilt_voice_config']) is not None:
|
1508
1508
|
setv(
|
@@ -1518,9 +1518,9 @@ def _VoiceConfig_to_vertex(
|
|
1518
1518
|
|
1519
1519
|
def _SpeechConfig_to_vertex(
|
1520
1520
|
api_client: BaseApiClient,
|
1521
|
-
from_object: Union[dict, object],
|
1522
|
-
parent_object: Optional[dict] = None,
|
1523
|
-
) -> dict:
|
1521
|
+
from_object: Union[dict[str, Any], object],
|
1522
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1523
|
+
) -> dict[str, Any]:
|
1524
1524
|
to_object: dict[str, Any] = {}
|
1525
1525
|
if getv(from_object, ['voice_config']) is not None:
|
1526
1526
|
setv(
|
@@ -1539,9 +1539,9 @@ def _SpeechConfig_to_vertex(
|
|
1539
1539
|
|
1540
1540
|
def _ThinkingConfig_to_vertex(
|
1541
1541
|
api_client: BaseApiClient,
|
1542
|
-
from_object: Union[dict, object],
|
1543
|
-
parent_object: Optional[dict] = None,
|
1544
|
-
) -> dict:
|
1542
|
+
from_object: Union[dict[str, Any], object],
|
1543
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1544
|
+
) -> dict[str, Any]:
|
1545
1545
|
to_object: dict[str, Any] = {}
|
1546
1546
|
if getv(from_object, ['include_thoughts']) is not None:
|
1547
1547
|
setv(
|
@@ -1556,9 +1556,9 @@ def _ThinkingConfig_to_vertex(
|
|
1556
1556
|
|
1557
1557
|
def _GenerateContentConfig_to_vertex(
|
1558
1558
|
api_client: BaseApiClient,
|
1559
|
-
from_object: Union[dict, object],
|
1560
|
-
parent_object: Optional[dict] = None,
|
1561
|
-
) -> dict:
|
1559
|
+
from_object: Union[dict[str, Any], object],
|
1560
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1561
|
+
) -> dict[str, Any]:
|
1562
1562
|
to_object: dict[str, Any] = {}
|
1563
1563
|
|
1564
1564
|
if getv(from_object, ['system_instruction']) is not None:
|
@@ -1728,9 +1728,9 @@ def _GenerateContentConfig_to_vertex(
|
|
1728
1728
|
|
1729
1729
|
def _GenerateContentParameters_to_vertex(
|
1730
1730
|
api_client: BaseApiClient,
|
1731
|
-
from_object: Union[dict, object],
|
1732
|
-
parent_object: Optional[dict] = None,
|
1733
|
-
) -> dict:
|
1731
|
+
from_object: Union[dict[str, Any], object],
|
1732
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1733
|
+
) -> dict[str, Any]:
|
1734
1734
|
to_object: dict[str, Any] = {}
|
1735
1735
|
if getv(from_object, ['model']) is not None:
|
1736
1736
|
setv(
|
@@ -1765,9 +1765,9 @@ def _GenerateContentParameters_to_vertex(
|
|
1765
1765
|
|
1766
1766
|
def _EmbedContentConfig_to_vertex(
|
1767
1767
|
api_client: BaseApiClient,
|
1768
|
-
from_object: Union[dict, object],
|
1769
|
-
parent_object: Optional[dict] = None,
|
1770
|
-
) -> dict:
|
1768
|
+
from_object: Union[dict[str, Any], object],
|
1769
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1770
|
+
) -> dict[str, Any]:
|
1771
1771
|
to_object: dict[str, Any] = {}
|
1772
1772
|
|
1773
1773
|
if getv(from_object, ['task_type']) is not None:
|
@@ -1806,9 +1806,9 @@ def _EmbedContentConfig_to_vertex(
|
|
1806
1806
|
|
1807
1807
|
def _EmbedContentParameters_to_vertex(
|
1808
1808
|
api_client: BaseApiClient,
|
1809
|
-
from_object: Union[dict, object],
|
1810
|
-
parent_object: Optional[dict] = None,
|
1811
|
-
) -> dict:
|
1809
|
+
from_object: Union[dict[str, Any], object],
|
1810
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1811
|
+
) -> dict[str, Any]:
|
1812
1812
|
to_object: dict[str, Any] = {}
|
1813
1813
|
if getv(from_object, ['model']) is not None:
|
1814
1814
|
setv(
|
@@ -1838,9 +1838,9 @@ def _EmbedContentParameters_to_vertex(
|
|
1838
1838
|
|
1839
1839
|
def _GenerateImagesConfig_to_vertex(
|
1840
1840
|
api_client: BaseApiClient,
|
1841
|
-
from_object: Union[dict, object],
|
1842
|
-
parent_object: Optional[dict] = None,
|
1843
|
-
) -> dict:
|
1841
|
+
from_object: Union[dict[str, Any], object],
|
1842
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1843
|
+
) -> dict[str, Any]:
|
1844
1844
|
to_object: dict[str, Any] = {}
|
1845
1845
|
|
1846
1846
|
if getv(from_object, ['output_gcs_uri']) is not None:
|
@@ -1949,9 +1949,9 @@ def _GenerateImagesConfig_to_vertex(
|
|
1949
1949
|
|
1950
1950
|
def _GenerateImagesParameters_to_vertex(
|
1951
1951
|
api_client: BaseApiClient,
|
1952
|
-
from_object: Union[dict, object],
|
1953
|
-
parent_object: Optional[dict] = None,
|
1954
|
-
) -> dict:
|
1952
|
+
from_object: Union[dict[str, Any], object],
|
1953
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1954
|
+
) -> dict[str, Any]:
|
1955
1955
|
to_object: dict[str, Any] = {}
|
1956
1956
|
if getv(from_object, ['model']) is not None:
|
1957
1957
|
setv(
|
@@ -1977,9 +1977,9 @@ def _GenerateImagesParameters_to_vertex(
|
|
1977
1977
|
|
1978
1978
|
def _Image_to_vertex(
|
1979
1979
|
api_client: BaseApiClient,
|
1980
|
-
from_object: Union[dict, object],
|
1981
|
-
parent_object: Optional[dict] = None,
|
1982
|
-
) -> dict:
|
1980
|
+
from_object: Union[dict[str, Any], object],
|
1981
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1982
|
+
) -> dict[str, Any]:
|
1983
1983
|
to_object: dict[str, Any] = {}
|
1984
1984
|
if getv(from_object, ['gcs_uri']) is not None:
|
1985
1985
|
setv(to_object, ['gcsUri'], getv(from_object, ['gcs_uri']))
|
@@ -1999,9 +1999,9 @@ def _Image_to_vertex(
|
|
1999
1999
|
|
2000
2000
|
def _MaskReferenceConfig_to_vertex(
|
2001
2001
|
api_client: BaseApiClient,
|
2002
|
-
from_object: Union[dict, object],
|
2003
|
-
parent_object: Optional[dict] = None,
|
2004
|
-
) -> dict:
|
2002
|
+
from_object: Union[dict[str, Any], object],
|
2003
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2004
|
+
) -> dict[str, Any]:
|
2005
2005
|
to_object: dict[str, Any] = {}
|
2006
2006
|
if getv(from_object, ['mask_mode']) is not None:
|
2007
2007
|
setv(to_object, ['maskMode'], getv(from_object, ['mask_mode']))
|
@@ -2019,9 +2019,9 @@ def _MaskReferenceConfig_to_vertex(
|
|
2019
2019
|
|
2020
2020
|
def _ControlReferenceConfig_to_vertex(
|
2021
2021
|
api_client: BaseApiClient,
|
2022
|
-
from_object: Union[dict, object],
|
2023
|
-
parent_object: Optional[dict] = None,
|
2024
|
-
) -> dict:
|
2022
|
+
from_object: Union[dict[str, Any], object],
|
2023
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2024
|
+
) -> dict[str, Any]:
|
2025
2025
|
to_object: dict[str, Any] = {}
|
2026
2026
|
if getv(from_object, ['control_type']) is not None:
|
2027
2027
|
setv(to_object, ['controlType'], getv(from_object, ['control_type']))
|
@@ -2038,9 +2038,9 @@ def _ControlReferenceConfig_to_vertex(
|
|
2038
2038
|
|
2039
2039
|
def _StyleReferenceConfig_to_vertex(
|
2040
2040
|
api_client: BaseApiClient,
|
2041
|
-
from_object: Union[dict, object],
|
2042
|
-
parent_object: Optional[dict] = None,
|
2043
|
-
) -> dict:
|
2041
|
+
from_object: Union[dict[str, Any], object],
|
2042
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2043
|
+
) -> dict[str, Any]:
|
2044
2044
|
to_object: dict[str, Any] = {}
|
2045
2045
|
if getv(from_object, ['style_description']) is not None:
|
2046
2046
|
setv(
|
@@ -2054,9 +2054,9 @@ def _StyleReferenceConfig_to_vertex(
|
|
2054
2054
|
|
2055
2055
|
def _SubjectReferenceConfig_to_vertex(
|
2056
2056
|
api_client: BaseApiClient,
|
2057
|
-
from_object: Union[dict, object],
|
2058
|
-
parent_object: Optional[dict] = None,
|
2059
|
-
) -> dict:
|
2057
|
+
from_object: Union[dict[str, Any], object],
|
2058
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2059
|
+
) -> dict[str, Any]:
|
2060
2060
|
to_object: dict[str, Any] = {}
|
2061
2061
|
if getv(from_object, ['subject_type']) is not None:
|
2062
2062
|
setv(to_object, ['subjectType'], getv(from_object, ['subject_type']))
|
@@ -2073,9 +2073,9 @@ def _SubjectReferenceConfig_to_vertex(
|
|
2073
2073
|
|
2074
2074
|
def _ReferenceImageAPI_to_vertex(
|
2075
2075
|
api_client: BaseApiClient,
|
2076
|
-
from_object: Union[dict, object],
|
2077
|
-
parent_object: Optional[dict] = None,
|
2078
|
-
) -> dict:
|
2076
|
+
from_object: Union[dict[str, Any], object],
|
2077
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2078
|
+
) -> dict[str, Any]:
|
2079
2079
|
to_object: dict[str, Any] = {}
|
2080
2080
|
if getv(from_object, ['reference_image']) is not None:
|
2081
2081
|
setv(
|
@@ -2133,9 +2133,9 @@ def _ReferenceImageAPI_to_vertex(
|
|
2133
2133
|
|
2134
2134
|
def _EditImageConfig_to_vertex(
|
2135
2135
|
api_client: BaseApiClient,
|
2136
|
-
from_object: Union[dict, object],
|
2137
|
-
parent_object: Optional[dict] = None,
|
2138
|
-
) -> dict:
|
2136
|
+
from_object: Union[dict[str, Any], object],
|
2137
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2138
|
+
) -> dict[str, Any]:
|
2139
2139
|
to_object: dict[str, Any] = {}
|
2140
2140
|
|
2141
2141
|
if getv(from_object, ['output_gcs_uri']) is not None:
|
@@ -2244,9 +2244,9 @@ def _EditImageConfig_to_vertex(
|
|
2244
2244
|
|
2245
2245
|
def _EditImageParameters_to_vertex(
|
2246
2246
|
api_client: BaseApiClient,
|
2247
|
-
from_object: Union[dict, object],
|
2248
|
-
parent_object: Optional[dict] = None,
|
2249
|
-
) -> dict:
|
2247
|
+
from_object: Union[dict[str, Any], object],
|
2248
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2249
|
+
) -> dict[str, Any]:
|
2250
2250
|
to_object: dict[str, Any] = {}
|
2251
2251
|
if getv(from_object, ['model']) is not None:
|
2252
2252
|
setv(
|
@@ -2282,9 +2282,9 @@ def _EditImageParameters_to_vertex(
|
|
2282
2282
|
|
2283
2283
|
def _UpscaleImageAPIConfig_to_vertex(
|
2284
2284
|
api_client: BaseApiClient,
|
2285
|
-
from_object: Union[dict, object],
|
2286
|
-
parent_object: Optional[dict] = None,
|
2287
|
-
) -> dict:
|
2285
|
+
from_object: Union[dict[str, Any], object],
|
2286
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2287
|
+
) -> dict[str, Any]:
|
2288
2288
|
to_object: dict[str, Any] = {}
|
2289
2289
|
|
2290
2290
|
if getv(from_object, ['include_rai_reason']) is not None:
|
@@ -2323,9 +2323,9 @@ def _UpscaleImageAPIConfig_to_vertex(
|
|
2323
2323
|
|
2324
2324
|
def _UpscaleImageAPIParameters_to_vertex(
|
2325
2325
|
api_client: BaseApiClient,
|
2326
|
-
from_object: Union[dict, object],
|
2327
|
-
parent_object: Optional[dict] = None,
|
2328
|
-
) -> dict:
|
2326
|
+
from_object: Union[dict[str, Any], object],
|
2327
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2328
|
+
) -> dict[str, Any]:
|
2329
2329
|
to_object: dict[str, Any] = {}
|
2330
2330
|
if getv(from_object, ['model']) is not None:
|
2331
2331
|
setv(
|
@@ -2362,9 +2362,9 @@ def _UpscaleImageAPIParameters_to_vertex(
|
|
2362
2362
|
|
2363
2363
|
def _GetModelParameters_to_vertex(
|
2364
2364
|
api_client: BaseApiClient,
|
2365
|
-
from_object: Union[dict, object],
|
2366
|
-
parent_object: Optional[dict] = None,
|
2367
|
-
) -> dict:
|
2365
|
+
from_object: Union[dict[str, Any], object],
|
2366
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2367
|
+
) -> dict[str, Any]:
|
2368
2368
|
to_object: dict[str, Any] = {}
|
2369
2369
|
if getv(from_object, ['model']) is not None:
|
2370
2370
|
setv(
|
@@ -2381,9 +2381,9 @@ def _GetModelParameters_to_vertex(
|
|
2381
2381
|
|
2382
2382
|
def _ListModelsConfig_to_vertex(
|
2383
2383
|
api_client: BaseApiClient,
|
2384
|
-
from_object: Union[dict, object],
|
2385
|
-
parent_object: Optional[dict] = None,
|
2386
|
-
) -> dict:
|
2384
|
+
from_object: Union[dict[str, Any], object],
|
2385
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2386
|
+
) -> dict[str, Any]:
|
2387
2387
|
to_object: dict[str, Any] = {}
|
2388
2388
|
|
2389
2389
|
if getv(from_object, ['page_size']) is not None:
|
@@ -2413,9 +2413,9 @@ def _ListModelsConfig_to_vertex(
|
|
2413
2413
|
|
2414
2414
|
def _ListModelsParameters_to_vertex(
|
2415
2415
|
api_client: BaseApiClient,
|
2416
|
-
from_object: Union[dict, object],
|
2417
|
-
parent_object: Optional[dict] = None,
|
2418
|
-
) -> dict:
|
2416
|
+
from_object: Union[dict[str, Any], object],
|
2417
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2418
|
+
) -> dict[str, Any]:
|
2419
2419
|
to_object: dict[str, Any] = {}
|
2420
2420
|
if getv(from_object, ['config']) is not None:
|
2421
2421
|
setv(
|
@@ -2431,9 +2431,9 @@ def _ListModelsParameters_to_vertex(
|
|
2431
2431
|
|
2432
2432
|
def _UpdateModelConfig_to_vertex(
|
2433
2433
|
api_client: BaseApiClient,
|
2434
|
-
from_object: Union[dict, object],
|
2435
|
-
parent_object: Optional[dict] = None,
|
2436
|
-
) -> dict:
|
2434
|
+
from_object: Union[dict[str, Any], object],
|
2435
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2436
|
+
) -> dict[str, Any]:
|
2437
2437
|
to_object: dict[str, Any] = {}
|
2438
2438
|
|
2439
2439
|
if getv(from_object, ['display_name']) is not None:
|
@@ -2447,9 +2447,9 @@ def _UpdateModelConfig_to_vertex(
|
|
2447
2447
|
|
2448
2448
|
def _UpdateModelParameters_to_vertex(
|
2449
2449
|
api_client: BaseApiClient,
|
2450
|
-
from_object: Union[dict, object],
|
2451
|
-
parent_object: Optional[dict] = None,
|
2452
|
-
) -> dict:
|
2450
|
+
from_object: Union[dict[str, Any], object],
|
2451
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2452
|
+
) -> dict[str, Any]:
|
2453
2453
|
to_object: dict[str, Any] = {}
|
2454
2454
|
if getv(from_object, ['model']) is not None:
|
2455
2455
|
setv(
|
@@ -2472,9 +2472,9 @@ def _UpdateModelParameters_to_vertex(
|
|
2472
2472
|
|
2473
2473
|
def _DeleteModelParameters_to_vertex(
|
2474
2474
|
api_client: BaseApiClient,
|
2475
|
-
from_object: Union[dict, object],
|
2476
|
-
parent_object: Optional[dict] = None,
|
2477
|
-
) -> dict:
|
2475
|
+
from_object: Union[dict[str, Any], object],
|
2476
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2477
|
+
) -> dict[str, Any]:
|
2478
2478
|
to_object: dict[str, Any] = {}
|
2479
2479
|
if getv(from_object, ['model']) is not None:
|
2480
2480
|
setv(
|
@@ -2491,9 +2491,9 @@ def _DeleteModelParameters_to_vertex(
|
|
2491
2491
|
|
2492
2492
|
def _CountTokensConfig_to_vertex(
|
2493
2493
|
api_client: BaseApiClient,
|
2494
|
-
from_object: Union[dict, object],
|
2495
|
-
parent_object: Optional[dict] = None,
|
2496
|
-
) -> dict:
|
2494
|
+
from_object: Union[dict[str, Any], object],
|
2495
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2496
|
+
) -> dict[str, Any]:
|
2497
2497
|
to_object: dict[str, Any] = {}
|
2498
2498
|
|
2499
2499
|
if getv(from_object, ['system_instruction']) is not None:
|
@@ -2529,9 +2529,9 @@ def _CountTokensConfig_to_vertex(
|
|
2529
2529
|
|
2530
2530
|
def _CountTokensParameters_to_vertex(
|
2531
2531
|
api_client: BaseApiClient,
|
2532
|
-
from_object: Union[dict, object],
|
2533
|
-
parent_object: Optional[dict] = None,
|
2534
|
-
) -> dict:
|
2532
|
+
from_object: Union[dict[str, Any], object],
|
2533
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2534
|
+
) -> dict[str, Any]:
|
2535
2535
|
to_object: dict[str, Any] = {}
|
2536
2536
|
if getv(from_object, ['model']) is not None:
|
2537
2537
|
setv(
|
@@ -2566,9 +2566,9 @@ def _CountTokensParameters_to_vertex(
|
|
2566
2566
|
|
2567
2567
|
def _ComputeTokensParameters_to_vertex(
|
2568
2568
|
api_client: BaseApiClient,
|
2569
|
-
from_object: Union[dict, object],
|
2570
|
-
parent_object: Optional[dict] = None,
|
2571
|
-
) -> dict:
|
2569
|
+
from_object: Union[dict[str, Any], object],
|
2570
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2571
|
+
) -> dict[str, Any]:
|
2572
2572
|
to_object: dict[str, Any] = {}
|
2573
2573
|
if getv(from_object, ['model']) is not None:
|
2574
2574
|
setv(
|
@@ -2597,9 +2597,9 @@ def _ComputeTokensParameters_to_vertex(
|
|
2597
2597
|
|
2598
2598
|
def _GenerateVideosConfig_to_vertex(
|
2599
2599
|
api_client: BaseApiClient,
|
2600
|
-
from_object: Union[dict, object],
|
2601
|
-
parent_object: Optional[dict] = None,
|
2602
|
-
) -> dict:
|
2600
|
+
from_object: Union[dict[str, Any], object],
|
2601
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2602
|
+
) -> dict[str, Any]:
|
2603
2603
|
to_object: dict[str, Any] = {}
|
2604
2604
|
|
2605
2605
|
if getv(from_object, ['number_of_videos']) is not None:
|
@@ -2676,9 +2676,9 @@ def _GenerateVideosConfig_to_vertex(
|
|
2676
2676
|
|
2677
2677
|
def _GenerateVideosParameters_to_vertex(
|
2678
2678
|
api_client: BaseApiClient,
|
2679
|
-
from_object: Union[dict, object],
|
2680
|
-
parent_object: Optional[dict] = None,
|
2681
|
-
) -> dict:
|
2679
|
+
from_object: Union[dict[str, Any], object],
|
2680
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2681
|
+
) -> dict[str, Any]:
|
2682
2682
|
to_object: dict[str, Any] = {}
|
2683
2683
|
if getv(from_object, ['model']) is not None:
|
2684
2684
|
setv(
|
@@ -2709,7 +2709,7 @@ def _GenerateVideosParameters_to_vertex(
|
|
2709
2709
|
return to_object
|
2710
2710
|
|
2711
2711
|
|
2712
|
-
def _FeatureSelectionPreference_to_mldev_enum_validate(enum_value: Any):
|
2712
|
+
def _FeatureSelectionPreference_to_mldev_enum_validate(enum_value: Any) -> None:
|
2713
2713
|
if enum_value in set([
|
2714
2714
|
'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED',
|
2715
2715
|
'PRIORITIZE_QUALITY',
|
@@ -2719,21 +2719,21 @@ def _FeatureSelectionPreference_to_mldev_enum_validate(enum_value: Any):
|
|
2719
2719
|
raise ValueError(f'{enum_value} enum value is not supported in Gemini API.')
|
2720
2720
|
|
2721
2721
|
|
2722
|
-
def _SafetyFilterLevel_to_mldev_enum_validate(enum_value: Any):
|
2722
|
+
def _SafetyFilterLevel_to_mldev_enum_validate(enum_value: Any) -> None:
|
2723
2723
|
if enum_value in set(['BLOCK_NONE']):
|
2724
2724
|
raise ValueError(f'{enum_value} enum value is not supported in Gemini API.')
|
2725
2725
|
|
2726
2726
|
|
2727
|
-
def _PersonGeneration_to_mldev_enum_validate(enum_value: Any):
|
2727
|
+
def _PersonGeneration_to_mldev_enum_validate(enum_value: Any) -> None:
|
2728
2728
|
if enum_value in set(['ALLOW_ALL']):
|
2729
2729
|
raise ValueError(f'{enum_value} enum value is not supported in Gemini API.')
|
2730
2730
|
|
2731
2731
|
|
2732
2732
|
def _Part_from_mldev(
|
2733
2733
|
api_client: BaseApiClient,
|
2734
|
-
from_object: Union[dict, object],
|
2735
|
-
parent_object: Optional[dict] = None,
|
2736
|
-
) -> dict:
|
2734
|
+
from_object: Union[dict[str, Any], object],
|
2735
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2736
|
+
) -> dict[str, Any]:
|
2737
2737
|
to_object: dict[str, Any] = {}
|
2738
2738
|
|
2739
2739
|
if getv(from_object, ['thought']) is not None:
|
@@ -2773,9 +2773,9 @@ def _Part_from_mldev(
|
|
2773
2773
|
|
2774
2774
|
def _Content_from_mldev(
|
2775
2775
|
api_client: BaseApiClient,
|
2776
|
-
from_object: Union[dict, object],
|
2777
|
-
parent_object: Optional[dict] = None,
|
2778
|
-
) -> dict:
|
2776
|
+
from_object: Union[dict[str, Any], object],
|
2777
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2778
|
+
) -> dict[str, Any]:
|
2779
2779
|
to_object: dict[str, Any] = {}
|
2780
2780
|
if getv(from_object, ['parts']) is not None:
|
2781
2781
|
setv(
|
@@ -2795,9 +2795,9 @@ def _Content_from_mldev(
|
|
2795
2795
|
|
2796
2796
|
def _CitationMetadata_from_mldev(
|
2797
2797
|
api_client: BaseApiClient,
|
2798
|
-
from_object: Union[dict, object],
|
2799
|
-
parent_object: Optional[dict] = None,
|
2800
|
-
) -> dict:
|
2798
|
+
from_object: Union[dict[str, Any], object],
|
2799
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2800
|
+
) -> dict[str, Any]:
|
2801
2801
|
to_object: dict[str, Any] = {}
|
2802
2802
|
if getv(from_object, ['citationSources']) is not None:
|
2803
2803
|
setv(to_object, ['citations'], getv(from_object, ['citationSources']))
|
@@ -2807,9 +2807,9 @@ def _CitationMetadata_from_mldev(
|
|
2807
2807
|
|
2808
2808
|
def _Candidate_from_mldev(
|
2809
2809
|
api_client: BaseApiClient,
|
2810
|
-
from_object: Union[dict, object],
|
2811
|
-
parent_object: Optional[dict] = None,
|
2812
|
-
) -> dict:
|
2810
|
+
from_object: Union[dict[str, Any], object],
|
2811
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2812
|
+
) -> dict[str, Any]:
|
2813
2813
|
to_object: dict[str, Any] = {}
|
2814
2814
|
if getv(from_object, ['content']) is not None:
|
2815
2815
|
setv(
|
@@ -2859,9 +2859,9 @@ def _Candidate_from_mldev(
|
|
2859
2859
|
|
2860
2860
|
def _GenerateContentResponse_from_mldev(
|
2861
2861
|
api_client: BaseApiClient,
|
2862
|
-
from_object: Union[dict, object],
|
2863
|
-
parent_object: Optional[dict] = None,
|
2864
|
-
) -> dict:
|
2862
|
+
from_object: Union[dict[str, Any], object],
|
2863
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2864
|
+
) -> dict[str, Any]:
|
2865
2865
|
to_object: dict[str, Any] = {}
|
2866
2866
|
if getv(from_object, ['candidates']) is not None:
|
2867
2867
|
setv(
|
@@ -2887,9 +2887,9 @@ def _GenerateContentResponse_from_mldev(
|
|
2887
2887
|
|
2888
2888
|
def _ContentEmbeddingStatistics_from_mldev(
|
2889
2889
|
api_client: BaseApiClient,
|
2890
|
-
from_object: Union[dict, object],
|
2891
|
-
parent_object: Optional[dict] = None,
|
2892
|
-
) -> dict:
|
2890
|
+
from_object: Union[dict[str, Any], object],
|
2891
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2892
|
+
) -> dict[str, Any]:
|
2893
2893
|
to_object: dict[str, Any] = {}
|
2894
2894
|
|
2895
2895
|
return to_object
|
@@ -2897,9 +2897,9 @@ def _ContentEmbeddingStatistics_from_mldev(
|
|
2897
2897
|
|
2898
2898
|
def _ContentEmbedding_from_mldev(
|
2899
2899
|
api_client: BaseApiClient,
|
2900
|
-
from_object: Union[dict, object],
|
2901
|
-
parent_object: Optional[dict] = None,
|
2902
|
-
) -> dict:
|
2900
|
+
from_object: Union[dict[str, Any], object],
|
2901
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2902
|
+
) -> dict[str, Any]:
|
2903
2903
|
to_object: dict[str, Any] = {}
|
2904
2904
|
if getv(from_object, ['values']) is not None:
|
2905
2905
|
setv(to_object, ['values'], getv(from_object, ['values']))
|
@@ -2909,9 +2909,9 @@ def _ContentEmbedding_from_mldev(
|
|
2909
2909
|
|
2910
2910
|
def _EmbedContentMetadata_from_mldev(
|
2911
2911
|
api_client: BaseApiClient,
|
2912
|
-
from_object: Union[dict, object],
|
2913
|
-
parent_object: Optional[dict] = None,
|
2914
|
-
) -> dict:
|
2912
|
+
from_object: Union[dict[str, Any], object],
|
2913
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2914
|
+
) -> dict[str, Any]:
|
2915
2915
|
to_object: dict[str, Any] = {}
|
2916
2916
|
|
2917
2917
|
return to_object
|
@@ -2919,9 +2919,9 @@ def _EmbedContentMetadata_from_mldev(
|
|
2919
2919
|
|
2920
2920
|
def _EmbedContentResponse_from_mldev(
|
2921
2921
|
api_client: BaseApiClient,
|
2922
|
-
from_object: Union[dict, object],
|
2923
|
-
parent_object: Optional[dict] = None,
|
2924
|
-
) -> dict:
|
2922
|
+
from_object: Union[dict[str, Any], object],
|
2923
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2924
|
+
) -> dict[str, Any]:
|
2925
2925
|
to_object: dict[str, Any] = {}
|
2926
2926
|
if getv(from_object, ['embeddings']) is not None:
|
2927
2927
|
setv(
|
@@ -2947,9 +2947,9 @@ def _EmbedContentResponse_from_mldev(
|
|
2947
2947
|
|
2948
2948
|
def _Image_from_mldev(
|
2949
2949
|
api_client: BaseApiClient,
|
2950
|
-
from_object: Union[dict, object],
|
2951
|
-
parent_object: Optional[dict] = None,
|
2952
|
-
) -> dict:
|
2950
|
+
from_object: Union[dict[str, Any], object],
|
2951
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2952
|
+
) -> dict[str, Any]:
|
2953
2953
|
to_object: dict[str, Any] = {}
|
2954
2954
|
|
2955
2955
|
if getv(from_object, ['bytesBase64Encoded']) is not None:
|
@@ -2967,9 +2967,9 @@ def _Image_from_mldev(
|
|
2967
2967
|
|
2968
2968
|
def _SafetyAttributes_from_mldev(
|
2969
2969
|
api_client: BaseApiClient,
|
2970
|
-
from_object: Union[dict, object],
|
2971
|
-
parent_object: Optional[dict] = None,
|
2972
|
-
) -> dict:
|
2970
|
+
from_object: Union[dict[str, Any], object],
|
2971
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2972
|
+
) -> dict[str, Any]:
|
2973
2973
|
to_object: dict[str, Any] = {}
|
2974
2974
|
if getv(from_object, ['safetyAttributes', 'categories']) is not None:
|
2975
2975
|
setv(
|
@@ -2991,9 +2991,9 @@ def _SafetyAttributes_from_mldev(
|
|
2991
2991
|
|
2992
2992
|
def _GeneratedImage_from_mldev(
|
2993
2993
|
api_client: BaseApiClient,
|
2994
|
-
from_object: Union[dict, object],
|
2995
|
-
parent_object: Optional[dict] = None,
|
2996
|
-
) -> dict:
|
2994
|
+
from_object: Union[dict[str, Any], object],
|
2995
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2996
|
+
) -> dict[str, Any]:
|
2997
2997
|
to_object: dict[str, Any] = {}
|
2998
2998
|
if getv(from_object, ['_self']) is not None:
|
2999
2999
|
setv(
|
@@ -3023,9 +3023,9 @@ def _GeneratedImage_from_mldev(
|
|
3023
3023
|
|
3024
3024
|
def _GenerateImagesResponse_from_mldev(
|
3025
3025
|
api_client: BaseApiClient,
|
3026
|
-
from_object: Union[dict, object],
|
3027
|
-
parent_object: Optional[dict] = None,
|
3028
|
-
) -> dict:
|
3026
|
+
from_object: Union[dict[str, Any], object],
|
3027
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3028
|
+
) -> dict[str, Any]:
|
3029
3029
|
to_object: dict[str, Any] = {}
|
3030
3030
|
if getv(from_object, ['predictions']) is not None:
|
3031
3031
|
setv(
|
@@ -3053,9 +3053,9 @@ def _GenerateImagesResponse_from_mldev(
|
|
3053
3053
|
|
3054
3054
|
def _Endpoint_from_mldev(
|
3055
3055
|
api_client: BaseApiClient,
|
3056
|
-
from_object: Union[dict, object],
|
3057
|
-
parent_object: Optional[dict] = None,
|
3058
|
-
) -> dict:
|
3056
|
+
from_object: Union[dict[str, Any], object],
|
3057
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3058
|
+
) -> dict[str, Any]:
|
3059
3059
|
to_object: dict[str, Any] = {}
|
3060
3060
|
|
3061
3061
|
return to_object
|
@@ -3063,9 +3063,9 @@ def _Endpoint_from_mldev(
|
|
3063
3063
|
|
3064
3064
|
def _TunedModelInfo_from_mldev(
|
3065
3065
|
api_client: BaseApiClient,
|
3066
|
-
from_object: Union[dict, object],
|
3067
|
-
parent_object: Optional[dict] = None,
|
3068
|
-
) -> dict:
|
3066
|
+
from_object: Union[dict[str, Any], object],
|
3067
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3068
|
+
) -> dict[str, Any]:
|
3069
3069
|
to_object: dict[str, Any] = {}
|
3070
3070
|
if getv(from_object, ['baseModel']) is not None:
|
3071
3071
|
setv(to_object, ['base_model'], getv(from_object, ['baseModel']))
|
@@ -3081,9 +3081,9 @@ def _TunedModelInfo_from_mldev(
|
|
3081
3081
|
|
3082
3082
|
def _Model_from_mldev(
|
3083
3083
|
api_client: BaseApiClient,
|
3084
|
-
from_object: Union[dict, object],
|
3085
|
-
parent_object: Optional[dict] = None,
|
3086
|
-
) -> dict:
|
3084
|
+
from_object: Union[dict[str, Any], object],
|
3085
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3086
|
+
) -> dict[str, Any]:
|
3087
3087
|
to_object: dict[str, Any] = {}
|
3088
3088
|
if getv(from_object, ['name']) is not None:
|
3089
3089
|
setv(to_object, ['name'], getv(from_object, ['name']))
|
@@ -3130,9 +3130,9 @@ def _Model_from_mldev(
|
|
3130
3130
|
|
3131
3131
|
def _ListModelsResponse_from_mldev(
|
3132
3132
|
api_client: BaseApiClient,
|
3133
|
-
from_object: Union[dict, object],
|
3134
|
-
parent_object: Optional[dict] = None,
|
3135
|
-
) -> dict:
|
3133
|
+
from_object: Union[dict[str, Any], object],
|
3134
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3135
|
+
) -> dict[str, Any]:
|
3136
3136
|
to_object: dict[str, Any] = {}
|
3137
3137
|
if getv(from_object, ['nextPageToken']) is not None:
|
3138
3138
|
setv(to_object, ['next_page_token'], getv(from_object, ['nextPageToken']))
|
@@ -3154,9 +3154,9 @@ def _ListModelsResponse_from_mldev(
|
|
3154
3154
|
|
3155
3155
|
def _DeleteModelResponse_from_mldev(
|
3156
3156
|
api_client: BaseApiClient,
|
3157
|
-
from_object: Union[dict, object],
|
3158
|
-
parent_object: Optional[dict] = None,
|
3159
|
-
) -> dict:
|
3157
|
+
from_object: Union[dict[str, Any], object],
|
3158
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3159
|
+
) -> dict[str, Any]:
|
3160
3160
|
to_object: dict[str, Any] = {}
|
3161
3161
|
|
3162
3162
|
return to_object
|
@@ -3164,9 +3164,9 @@ def _DeleteModelResponse_from_mldev(
|
|
3164
3164
|
|
3165
3165
|
def _CountTokensResponse_from_mldev(
|
3166
3166
|
api_client: BaseApiClient,
|
3167
|
-
from_object: Union[dict, object],
|
3168
|
-
parent_object: Optional[dict] = None,
|
3169
|
-
) -> dict:
|
3167
|
+
from_object: Union[dict[str, Any], object],
|
3168
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3169
|
+
) -> dict[str, Any]:
|
3170
3170
|
to_object: dict[str, Any] = {}
|
3171
3171
|
if getv(from_object, ['totalTokens']) is not None:
|
3172
3172
|
setv(to_object, ['total_tokens'], getv(from_object, ['totalTokens']))
|
@@ -3183,9 +3183,9 @@ def _CountTokensResponse_from_mldev(
|
|
3183
3183
|
|
3184
3184
|
def _Video_from_mldev(
|
3185
3185
|
api_client: BaseApiClient,
|
3186
|
-
from_object: Union[dict, object],
|
3187
|
-
parent_object: Optional[dict] = None,
|
3188
|
-
) -> dict:
|
3186
|
+
from_object: Union[dict[str, Any], object],
|
3187
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3188
|
+
) -> dict[str, Any]:
|
3189
3189
|
to_object: dict[str, Any] = {}
|
3190
3190
|
if getv(from_object, ['video', 'uri']) is not None:
|
3191
3191
|
setv(to_object, ['uri'], getv(from_object, ['video', 'uri']))
|
@@ -3205,9 +3205,9 @@ def _Video_from_mldev(
|
|
3205
3205
|
|
3206
3206
|
def _GeneratedVideo_from_mldev(
|
3207
3207
|
api_client: BaseApiClient,
|
3208
|
-
from_object: Union[dict, object],
|
3209
|
-
parent_object: Optional[dict] = None,
|
3210
|
-
) -> dict:
|
3208
|
+
from_object: Union[dict[str, Any], object],
|
3209
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3210
|
+
) -> dict[str, Any]:
|
3211
3211
|
to_object: dict[str, Any] = {}
|
3212
3212
|
if getv(from_object, ['_self']) is not None:
|
3213
3213
|
setv(
|
@@ -3221,9 +3221,9 @@ def _GeneratedVideo_from_mldev(
|
|
3221
3221
|
|
3222
3222
|
def _GenerateVideosResponse_from_mldev(
|
3223
3223
|
api_client: BaseApiClient,
|
3224
|
-
from_object: Union[dict, object],
|
3225
|
-
parent_object: Optional[dict] = None,
|
3226
|
-
) -> dict:
|
3224
|
+
from_object: Union[dict[str, Any], object],
|
3225
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3226
|
+
) -> dict[str, Any]:
|
3227
3227
|
to_object: dict[str, Any] = {}
|
3228
3228
|
if getv(from_object, ['generatedSamples']) is not None:
|
3229
3229
|
setv(
|
@@ -3254,9 +3254,9 @@ def _GenerateVideosResponse_from_mldev(
|
|
3254
3254
|
|
3255
3255
|
def _GenerateVideosOperation_from_mldev(
|
3256
3256
|
api_client: BaseApiClient,
|
3257
|
-
from_object: Union[dict, object],
|
3258
|
-
parent_object: Optional[dict] = None,
|
3259
|
-
) -> dict:
|
3257
|
+
from_object: Union[dict[str, Any], object],
|
3258
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3259
|
+
) -> dict[str, Any]:
|
3260
3260
|
to_object: dict[str, Any] = {}
|
3261
3261
|
if getv(from_object, ['name']) is not None:
|
3262
3262
|
setv(to_object, ['name'], getv(from_object, ['name']))
|
@@ -3297,9 +3297,9 @@ def _GenerateVideosOperation_from_mldev(
|
|
3297
3297
|
|
3298
3298
|
def _Part_from_vertex(
|
3299
3299
|
api_client: BaseApiClient,
|
3300
|
-
from_object: Union[dict, object],
|
3301
|
-
parent_object: Optional[dict] = None,
|
3302
|
-
) -> dict:
|
3300
|
+
from_object: Union[dict[str, Any], object],
|
3301
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3302
|
+
) -> dict[str, Any]:
|
3303
3303
|
to_object: dict[str, Any] = {}
|
3304
3304
|
if getv(from_object, ['videoMetadata']) is not None:
|
3305
3305
|
setv(to_object, ['video_metadata'], getv(from_object, ['videoMetadata']))
|
@@ -3341,9 +3341,9 @@ def _Part_from_vertex(
|
|
3341
3341
|
|
3342
3342
|
def _Content_from_vertex(
|
3343
3343
|
api_client: BaseApiClient,
|
3344
|
-
from_object: Union[dict, object],
|
3345
|
-
parent_object: Optional[dict] = None,
|
3346
|
-
) -> dict:
|
3344
|
+
from_object: Union[dict[str, Any], object],
|
3345
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3346
|
+
) -> dict[str, Any]:
|
3347
3347
|
to_object: dict[str, Any] = {}
|
3348
3348
|
if getv(from_object, ['parts']) is not None:
|
3349
3349
|
setv(
|
@@ -3363,9 +3363,9 @@ def _Content_from_vertex(
|
|
3363
3363
|
|
3364
3364
|
def _CitationMetadata_from_vertex(
|
3365
3365
|
api_client: BaseApiClient,
|
3366
|
-
from_object: Union[dict, object],
|
3367
|
-
parent_object: Optional[dict] = None,
|
3368
|
-
) -> dict:
|
3366
|
+
from_object: Union[dict[str, Any], object],
|
3367
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3368
|
+
) -> dict[str, Any]:
|
3369
3369
|
to_object: dict[str, Any] = {}
|
3370
3370
|
if getv(from_object, ['citations']) is not None:
|
3371
3371
|
setv(to_object, ['citations'], getv(from_object, ['citations']))
|
@@ -3375,9 +3375,9 @@ def _CitationMetadata_from_vertex(
|
|
3375
3375
|
|
3376
3376
|
def _Candidate_from_vertex(
|
3377
3377
|
api_client: BaseApiClient,
|
3378
|
-
from_object: Union[dict, object],
|
3379
|
-
parent_object: Optional[dict] = None,
|
3380
|
-
) -> dict:
|
3378
|
+
from_object: Union[dict[str, Any], object],
|
3379
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3380
|
+
) -> dict[str, Any]:
|
3381
3381
|
to_object: dict[str, Any] = {}
|
3382
3382
|
if getv(from_object, ['content']) is not None:
|
3383
3383
|
setv(
|
@@ -3427,9 +3427,9 @@ def _Candidate_from_vertex(
|
|
3427
3427
|
|
3428
3428
|
def _GenerateContentResponse_from_vertex(
|
3429
3429
|
api_client: BaseApiClient,
|
3430
|
-
from_object: Union[dict, object],
|
3431
|
-
parent_object: Optional[dict] = None,
|
3432
|
-
) -> dict:
|
3430
|
+
from_object: Union[dict[str, Any], object],
|
3431
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3432
|
+
) -> dict[str, Any]:
|
3433
3433
|
to_object: dict[str, Any] = {}
|
3434
3434
|
if getv(from_object, ['candidates']) is not None:
|
3435
3435
|
setv(
|
@@ -3461,9 +3461,9 @@ def _GenerateContentResponse_from_vertex(
|
|
3461
3461
|
|
3462
3462
|
def _ContentEmbeddingStatistics_from_vertex(
|
3463
3463
|
api_client: BaseApiClient,
|
3464
|
-
from_object: Union[dict, object],
|
3465
|
-
parent_object: Optional[dict] = None,
|
3466
|
-
) -> dict:
|
3464
|
+
from_object: Union[dict[str, Any], object],
|
3465
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3466
|
+
) -> dict[str, Any]:
|
3467
3467
|
to_object: dict[str, Any] = {}
|
3468
3468
|
if getv(from_object, ['truncated']) is not None:
|
3469
3469
|
setv(to_object, ['truncated'], getv(from_object, ['truncated']))
|
@@ -3476,9 +3476,9 @@ def _ContentEmbeddingStatistics_from_vertex(
|
|
3476
3476
|
|
3477
3477
|
def _ContentEmbedding_from_vertex(
|
3478
3478
|
api_client: BaseApiClient,
|
3479
|
-
from_object: Union[dict, object],
|
3480
|
-
parent_object: Optional[dict] = None,
|
3481
|
-
) -> dict:
|
3479
|
+
from_object: Union[dict[str, Any], object],
|
3480
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3481
|
+
) -> dict[str, Any]:
|
3482
3482
|
to_object: dict[str, Any] = {}
|
3483
3483
|
if getv(from_object, ['values']) is not None:
|
3484
3484
|
setv(to_object, ['values'], getv(from_object, ['values']))
|
@@ -3497,9 +3497,9 @@ def _ContentEmbedding_from_vertex(
|
|
3497
3497
|
|
3498
3498
|
def _EmbedContentMetadata_from_vertex(
|
3499
3499
|
api_client: BaseApiClient,
|
3500
|
-
from_object: Union[dict, object],
|
3501
|
-
parent_object: Optional[dict] = None,
|
3502
|
-
) -> dict:
|
3500
|
+
from_object: Union[dict[str, Any], object],
|
3501
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3502
|
+
) -> dict[str, Any]:
|
3503
3503
|
to_object: dict[str, Any] = {}
|
3504
3504
|
if getv(from_object, ['billableCharacterCount']) is not None:
|
3505
3505
|
setv(
|
@@ -3513,9 +3513,9 @@ def _EmbedContentMetadata_from_vertex(
|
|
3513
3513
|
|
3514
3514
|
def _EmbedContentResponse_from_vertex(
|
3515
3515
|
api_client: BaseApiClient,
|
3516
|
-
from_object: Union[dict, object],
|
3517
|
-
parent_object: Optional[dict] = None,
|
3518
|
-
) -> dict:
|
3516
|
+
from_object: Union[dict[str, Any], object],
|
3517
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3518
|
+
) -> dict[str, Any]:
|
3519
3519
|
to_object: dict[str, Any] = {}
|
3520
3520
|
if getv(from_object, ['predictions[]', 'embeddings']) is not None:
|
3521
3521
|
setv(
|
@@ -3541,9 +3541,9 @@ def _EmbedContentResponse_from_vertex(
|
|
3541
3541
|
|
3542
3542
|
def _Image_from_vertex(
|
3543
3543
|
api_client: BaseApiClient,
|
3544
|
-
from_object: Union[dict, object],
|
3545
|
-
parent_object: Optional[dict] = None,
|
3546
|
-
) -> dict:
|
3544
|
+
from_object: Union[dict[str, Any], object],
|
3545
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3546
|
+
) -> dict[str, Any]:
|
3547
3547
|
to_object: dict[str, Any] = {}
|
3548
3548
|
if getv(from_object, ['gcsUri']) is not None:
|
3549
3549
|
setv(to_object, ['gcs_uri'], getv(from_object, ['gcsUri']))
|
@@ -3563,9 +3563,9 @@ def _Image_from_vertex(
|
|
3563
3563
|
|
3564
3564
|
def _SafetyAttributes_from_vertex(
|
3565
3565
|
api_client: BaseApiClient,
|
3566
|
-
from_object: Union[dict, object],
|
3567
|
-
parent_object: Optional[dict] = None,
|
3568
|
-
) -> dict:
|
3566
|
+
from_object: Union[dict[str, Any], object],
|
3567
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3568
|
+
) -> dict[str, Any]:
|
3569
3569
|
to_object: dict[str, Any] = {}
|
3570
3570
|
if getv(from_object, ['safetyAttributes', 'categories']) is not None:
|
3571
3571
|
setv(
|
@@ -3587,9 +3587,9 @@ def _SafetyAttributes_from_vertex(
|
|
3587
3587
|
|
3588
3588
|
def _GeneratedImage_from_vertex(
|
3589
3589
|
api_client: BaseApiClient,
|
3590
|
-
from_object: Union[dict, object],
|
3591
|
-
parent_object: Optional[dict] = None,
|
3592
|
-
) -> dict:
|
3590
|
+
from_object: Union[dict[str, Any], object],
|
3591
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3592
|
+
) -> dict[str, Any]:
|
3593
3593
|
to_object: dict[str, Any] = {}
|
3594
3594
|
if getv(from_object, ['_self']) is not None:
|
3595
3595
|
setv(
|
@@ -3622,9 +3622,9 @@ def _GeneratedImage_from_vertex(
|
|
3622
3622
|
|
3623
3623
|
def _GenerateImagesResponse_from_vertex(
|
3624
3624
|
api_client: BaseApiClient,
|
3625
|
-
from_object: Union[dict, object],
|
3626
|
-
parent_object: Optional[dict] = None,
|
3627
|
-
) -> dict:
|
3625
|
+
from_object: Union[dict[str, Any], object],
|
3626
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3627
|
+
) -> dict[str, Any]:
|
3628
3628
|
to_object: dict[str, Any] = {}
|
3629
3629
|
if getv(from_object, ['predictions']) is not None:
|
3630
3630
|
setv(
|
@@ -3652,9 +3652,9 @@ def _GenerateImagesResponse_from_vertex(
|
|
3652
3652
|
|
3653
3653
|
def _EditImageResponse_from_vertex(
|
3654
3654
|
api_client: BaseApiClient,
|
3655
|
-
from_object: Union[dict, object],
|
3656
|
-
parent_object: Optional[dict] = None,
|
3657
|
-
) -> dict:
|
3655
|
+
from_object: Union[dict[str, Any], object],
|
3656
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3657
|
+
) -> dict[str, Any]:
|
3658
3658
|
to_object: dict[str, Any] = {}
|
3659
3659
|
if getv(from_object, ['predictions']) is not None:
|
3660
3660
|
setv(
|
@@ -3671,9 +3671,9 @@ def _EditImageResponse_from_vertex(
|
|
3671
3671
|
|
3672
3672
|
def _UpscaleImageResponse_from_vertex(
|
3673
3673
|
api_client: BaseApiClient,
|
3674
|
-
from_object: Union[dict, object],
|
3675
|
-
parent_object: Optional[dict] = None,
|
3676
|
-
) -> dict:
|
3674
|
+
from_object: Union[dict[str, Any], object],
|
3675
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3676
|
+
) -> dict[str, Any]:
|
3677
3677
|
to_object: dict[str, Any] = {}
|
3678
3678
|
if getv(from_object, ['predictions']) is not None:
|
3679
3679
|
setv(
|
@@ -3690,9 +3690,9 @@ def _UpscaleImageResponse_from_vertex(
|
|
3690
3690
|
|
3691
3691
|
def _Endpoint_from_vertex(
|
3692
3692
|
api_client: BaseApiClient,
|
3693
|
-
from_object: Union[dict, object],
|
3694
|
-
parent_object: Optional[dict] = None,
|
3695
|
-
) -> dict:
|
3693
|
+
from_object: Union[dict[str, Any], object],
|
3694
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3695
|
+
) -> dict[str, Any]:
|
3696
3696
|
to_object: dict[str, Any] = {}
|
3697
3697
|
if getv(from_object, ['endpoint']) is not None:
|
3698
3698
|
setv(to_object, ['name'], getv(from_object, ['endpoint']))
|
@@ -3707,9 +3707,9 @@ def _Endpoint_from_vertex(
|
|
3707
3707
|
|
3708
3708
|
def _TunedModelInfo_from_vertex(
|
3709
3709
|
api_client: BaseApiClient,
|
3710
|
-
from_object: Union[dict, object],
|
3711
|
-
parent_object: Optional[dict] = None,
|
3712
|
-
) -> dict:
|
3710
|
+
from_object: Union[dict[str, Any], object],
|
3711
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3712
|
+
) -> dict[str, Any]:
|
3713
3713
|
to_object: dict[str, Any] = {}
|
3714
3714
|
if (
|
3715
3715
|
getv(from_object, ['labels', 'google-vertex-llm-tuning-base-model-id'])
|
@@ -3732,9 +3732,9 @@ def _TunedModelInfo_from_vertex(
|
|
3732
3732
|
|
3733
3733
|
def _Model_from_vertex(
|
3734
3734
|
api_client: BaseApiClient,
|
3735
|
-
from_object: Union[dict, object],
|
3736
|
-
parent_object: Optional[dict] = None,
|
3737
|
-
) -> dict:
|
3735
|
+
from_object: Union[dict[str, Any], object],
|
3736
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3737
|
+
) -> dict[str, Any]:
|
3738
3738
|
to_object: dict[str, Any] = {}
|
3739
3739
|
if getv(from_object, ['name']) is not None:
|
3740
3740
|
setv(to_object, ['name'], getv(from_object, ['name']))
|
@@ -3775,9 +3775,9 @@ def _Model_from_vertex(
|
|
3775
3775
|
|
3776
3776
|
def _ListModelsResponse_from_vertex(
|
3777
3777
|
api_client: BaseApiClient,
|
3778
|
-
from_object: Union[dict, object],
|
3779
|
-
parent_object: Optional[dict] = None,
|
3780
|
-
) -> dict:
|
3778
|
+
from_object: Union[dict[str, Any], object],
|
3779
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3780
|
+
) -> dict[str, Any]:
|
3781
3781
|
to_object: dict[str, Any] = {}
|
3782
3782
|
if getv(from_object, ['nextPageToken']) is not None:
|
3783
3783
|
setv(to_object, ['next_page_token'], getv(from_object, ['nextPageToken']))
|
@@ -3799,9 +3799,9 @@ def _ListModelsResponse_from_vertex(
|
|
3799
3799
|
|
3800
3800
|
def _DeleteModelResponse_from_vertex(
|
3801
3801
|
api_client: BaseApiClient,
|
3802
|
-
from_object: Union[dict, object],
|
3803
|
-
parent_object: Optional[dict] = None,
|
3804
|
-
) -> dict:
|
3802
|
+
from_object: Union[dict[str, Any], object],
|
3803
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3804
|
+
) -> dict[str, Any]:
|
3805
3805
|
to_object: dict[str, Any] = {}
|
3806
3806
|
|
3807
3807
|
return to_object
|
@@ -3809,9 +3809,9 @@ def _DeleteModelResponse_from_vertex(
|
|
3809
3809
|
|
3810
3810
|
def _CountTokensResponse_from_vertex(
|
3811
3811
|
api_client: BaseApiClient,
|
3812
|
-
from_object: Union[dict, object],
|
3813
|
-
parent_object: Optional[dict] = None,
|
3814
|
-
) -> dict:
|
3812
|
+
from_object: Union[dict[str, Any], object],
|
3813
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3814
|
+
) -> dict[str, Any]:
|
3815
3815
|
to_object: dict[str, Any] = {}
|
3816
3816
|
if getv(from_object, ['totalTokens']) is not None:
|
3817
3817
|
setv(to_object, ['total_tokens'], getv(from_object, ['totalTokens']))
|
@@ -3821,9 +3821,9 @@ def _CountTokensResponse_from_vertex(
|
|
3821
3821
|
|
3822
3822
|
def _ComputeTokensResponse_from_vertex(
|
3823
3823
|
api_client: BaseApiClient,
|
3824
|
-
from_object: Union[dict, object],
|
3825
|
-
parent_object: Optional[dict] = None,
|
3826
|
-
) -> dict:
|
3824
|
+
from_object: Union[dict[str, Any], object],
|
3825
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3826
|
+
) -> dict[str, Any]:
|
3827
3827
|
to_object: dict[str, Any] = {}
|
3828
3828
|
if getv(from_object, ['tokensInfo']) is not None:
|
3829
3829
|
setv(to_object, ['tokens_info'], getv(from_object, ['tokensInfo']))
|
@@ -3833,9 +3833,9 @@ def _ComputeTokensResponse_from_vertex(
|
|
3833
3833
|
|
3834
3834
|
def _Video_from_vertex(
|
3835
3835
|
api_client: BaseApiClient,
|
3836
|
-
from_object: Union[dict, object],
|
3837
|
-
parent_object: Optional[dict] = None,
|
3838
|
-
) -> dict:
|
3836
|
+
from_object: Union[dict[str, Any], object],
|
3837
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3838
|
+
) -> dict[str, Any]:
|
3839
3839
|
to_object: dict[str, Any] = {}
|
3840
3840
|
if getv(from_object, ['gcsUri']) is not None:
|
3841
3841
|
setv(to_object, ['uri'], getv(from_object, ['gcsUri']))
|
@@ -3855,9 +3855,9 @@ def _Video_from_vertex(
|
|
3855
3855
|
|
3856
3856
|
def _GeneratedVideo_from_vertex(
|
3857
3857
|
api_client: BaseApiClient,
|
3858
|
-
from_object: Union[dict, object],
|
3859
|
-
parent_object: Optional[dict] = None,
|
3860
|
-
) -> dict:
|
3858
|
+
from_object: Union[dict[str, Any], object],
|
3859
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3860
|
+
) -> dict[str, Any]:
|
3861
3861
|
to_object: dict[str, Any] = {}
|
3862
3862
|
if getv(from_object, ['_self']) is not None:
|
3863
3863
|
setv(
|
@@ -3871,9 +3871,9 @@ def _GeneratedVideo_from_vertex(
|
|
3871
3871
|
|
3872
3872
|
def _GenerateVideosResponse_from_vertex(
|
3873
3873
|
api_client: BaseApiClient,
|
3874
|
-
from_object: Union[dict, object],
|
3875
|
-
parent_object: Optional[dict] = None,
|
3876
|
-
) -> dict:
|
3874
|
+
from_object: Union[dict[str, Any], object],
|
3875
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3876
|
+
) -> dict[str, Any]:
|
3877
3877
|
to_object: dict[str, Any] = {}
|
3878
3878
|
if getv(from_object, ['videos']) is not None:
|
3879
3879
|
setv(
|
@@ -3904,9 +3904,9 @@ def _GenerateVideosResponse_from_vertex(
|
|
3904
3904
|
|
3905
3905
|
def _GenerateVideosOperation_from_vertex(
|
3906
3906
|
api_client: BaseApiClient,
|
3907
|
-
from_object: Union[dict, object],
|
3908
|
-
parent_object: Optional[dict] = None,
|
3909
|
-
) -> dict:
|
3907
|
+
from_object: Union[dict[str, Any], object],
|
3908
|
+
parent_object: Optional[dict[str, Any]] = None,
|
3909
|
+
) -> dict[str, Any]:
|
3910
3910
|
to_object: dict[str, Any] = {}
|
3911
3911
|
if getv(from_object, ['name']) is not None:
|
3912
3912
|
setv(to_object, ['name'], getv(from_object, ['name']))
|
@@ -5565,7 +5565,7 @@ class AsyncModels(_api_module.BaseModule):
|
|
5565
5565
|
'post', path, request_dict, http_options
|
5566
5566
|
)
|
5567
5567
|
|
5568
|
-
async def async_generator():
|
5568
|
+
async def async_generator(): # type: ignore[no-untyped-def]
|
5569
5569
|
async for response_dict in response_stream:
|
5570
5570
|
|
5571
5571
|
if self._api_client.vertexai:
|
@@ -5584,7 +5584,7 @@ class AsyncModels(_api_module.BaseModule):
|
|
5584
5584
|
self._api_client._verify_response(return_value)
|
5585
5585
|
yield return_value
|
5586
5586
|
|
5587
|
-
return async_generator()
|
5587
|
+
return async_generator() # type: ignore[no-untyped-call, no-any-return]
|
5588
5588
|
|
5589
5589
|
async def embed_content(
|
5590
5590
|
self,
|
@@ -6539,7 +6539,7 @@ class AsyncModels(_api_module.BaseModule):
|
|
6539
6539
|
model: str,
|
6540
6540
|
contents: Union[types.ContentListUnion, types.ContentListUnionDict],
|
6541
6541
|
config: Optional[types.GenerateContentConfigOrDict] = None,
|
6542
|
-
) ->
|
6542
|
+
) -> AsyncIterator[types.GenerateContentResponse]:
|
6543
6543
|
"""Makes an API request to generate content using a model and yields the model's response in chunks.
|
6544
6544
|
|
6545
6545
|
For the `model` parameter, supported formats for Vertex AI API include:
|
@@ -6602,13 +6602,13 @@ class AsyncModels(_api_module.BaseModule):
|
|
6602
6602
|
model=model, contents=contents, config=config
|
6603
6603
|
)
|
6604
6604
|
|
6605
|
-
async def base_async_generator(model, contents, config):
|
6605
|
+
async def base_async_generator(model, contents, config): # type: ignore[no-untyped-def]
|
6606
6606
|
async for chunk in response: # type: ignore[attr-defined]
|
6607
6607
|
yield chunk
|
6608
6608
|
|
6609
|
-
return base_async_generator(model, contents, config)
|
6609
|
+
return base_async_generator(model, contents, config) # type: ignore[no-untyped-call, no-any-return]
|
6610
6610
|
|
6611
|
-
async def async_generator(model, contents, config):
|
6611
|
+
async def async_generator(model, contents, config): # type: ignore[no-untyped-def]
|
6612
6612
|
remaining_remote_calls_afc = _extra_utils.get_max_remote_calls_afc(config)
|
6613
6613
|
logger.info(
|
6614
6614
|
f'AFC is enabled with max remote calls: {remaining_remote_calls_afc}.'
|
@@ -6687,15 +6687,15 @@ class AsyncModels(_api_module.BaseModule):
|
|
6687
6687
|
)
|
6688
6688
|
contents = t.t_contents(self._api_client, contents)
|
6689
6689
|
if not automatic_function_calling_history:
|
6690
|
-
automatic_function_calling_history.extend(contents)
|
6690
|
+
automatic_function_calling_history.extend(contents)
|
6691
6691
|
if isinstance(contents, list) and func_call_content is not None:
|
6692
|
-
contents.append(func_call_content)
|
6693
|
-
contents.append(func_response_content)
|
6692
|
+
contents.append(func_call_content)
|
6693
|
+
contents.append(func_response_content)
|
6694
6694
|
if func_call_content is not None:
|
6695
6695
|
automatic_function_calling_history.append(func_call_content)
|
6696
6696
|
automatic_function_calling_history.append(func_response_content)
|
6697
6697
|
|
6698
|
-
return async_generator(model, contents, config)
|
6698
|
+
return async_generator(model, contents, config) # type: ignore[no-untyped-call, no-any-return]
|
6699
6699
|
|
6700
6700
|
async def edit_image(
|
6701
6701
|
self,
|