google-genai 1.20.0__py3-none-any.whl → 1.21.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/models.py CHANGED
@@ -15,6 +15,7 @@
15
15
 
16
16
  # Code generated by the Google Gen AI SDK generator DO NOT EDIT.
17
17
 
18
+ import json
18
19
  import logging
19
20
  from typing import Any, AsyncIterator, Awaitable, Iterator, Optional, Union
20
21
  from urllib.parse import urlencode
@@ -35,7 +36,6 @@ logger = logging.getLogger('google_genai.models')
35
36
 
36
37
 
37
38
  def _VideoMetadata_to_mldev(
38
- api_client: BaseApiClient,
39
39
  from_object: Union[dict[str, Any], object],
40
40
  parent_object: Optional[dict[str, Any]] = None,
41
41
  ) -> dict[str, Any]:
@@ -53,7 +53,6 @@ def _VideoMetadata_to_mldev(
53
53
 
54
54
 
55
55
  def _Blob_to_mldev(
56
- api_client: BaseApiClient,
57
56
  from_object: Union[dict[str, Any], object],
58
57
  parent_object: Optional[dict[str, Any]] = None,
59
58
  ) -> dict[str, Any]:
@@ -71,7 +70,6 @@ def _Blob_to_mldev(
71
70
 
72
71
 
73
72
  def _FileData_to_mldev(
74
- api_client: BaseApiClient,
75
73
  from_object: Union[dict[str, Any], object],
76
74
  parent_object: Optional[dict[str, Any]] = None,
77
75
  ) -> dict[str, Any]:
@@ -89,7 +87,6 @@ def _FileData_to_mldev(
89
87
 
90
88
 
91
89
  def _Part_to_mldev(
92
- api_client: BaseApiClient,
93
90
  from_object: Union[dict[str, Any], object],
94
91
  parent_object: Optional[dict[str, Any]] = None,
95
92
  ) -> dict[str, Any]:
@@ -99,7 +96,7 @@ def _Part_to_mldev(
99
96
  to_object,
100
97
  ['videoMetadata'],
101
98
  _VideoMetadata_to_mldev(
102
- api_client, getv(from_object, ['video_metadata']), to_object
99
+ getv(from_object, ['video_metadata']), to_object
103
100
  ),
104
101
  )
105
102
 
@@ -110,18 +107,14 @@ def _Part_to_mldev(
110
107
  setv(
111
108
  to_object,
112
109
  ['inlineData'],
113
- _Blob_to_mldev(
114
- api_client, getv(from_object, ['inline_data']), to_object
115
- ),
110
+ _Blob_to_mldev(getv(from_object, ['inline_data']), to_object),
116
111
  )
117
112
 
118
113
  if getv(from_object, ['file_data']) is not None:
119
114
  setv(
120
115
  to_object,
121
116
  ['fileData'],
122
- _FileData_to_mldev(
123
- api_client, getv(from_object, ['file_data']), to_object
124
- ),
117
+ _FileData_to_mldev(getv(from_object, ['file_data']), to_object),
125
118
  )
126
119
 
127
120
  if getv(from_object, ['thought_signature']) is not None:
@@ -158,7 +151,6 @@ def _Part_to_mldev(
158
151
 
159
152
 
160
153
  def _Content_to_mldev(
161
- api_client: BaseApiClient,
162
154
  from_object: Union[dict[str, Any], object],
163
155
  parent_object: Optional[dict[str, Any]] = None,
164
156
  ) -> dict[str, Any]:
@@ -168,7 +160,7 @@ def _Content_to_mldev(
168
160
  to_object,
169
161
  ['parts'],
170
162
  [
171
- _Part_to_mldev(api_client, item, to_object)
163
+ _Part_to_mldev(item, to_object)
172
164
  for item in getv(from_object, ['parts'])
173
165
  ],
174
166
  )
@@ -180,7 +172,6 @@ def _Content_to_mldev(
180
172
 
181
173
 
182
174
  def _Schema_to_mldev(
183
- api_client: BaseApiClient,
184
175
  from_object: Union[dict[str, Any], object],
185
176
  parent_object: Optional[dict[str, Any]] = None,
186
177
  ) -> dict[str, Any]:
@@ -270,7 +261,6 @@ def _Schema_to_mldev(
270
261
 
271
262
 
272
263
  def _ModelSelectionConfig_to_mldev(
273
- api_client: BaseApiClient,
274
264
  from_object: Union[dict[str, Any], object],
275
265
  parent_object: Optional[dict[str, Any]] = None,
276
266
  ) -> dict[str, Any]:
@@ -284,7 +274,6 @@ def _ModelSelectionConfig_to_mldev(
284
274
 
285
275
 
286
276
  def _SafetySetting_to_mldev(
287
- api_client: BaseApiClient,
288
277
  from_object: Union[dict[str, Any], object],
289
278
  parent_object: Optional[dict[str, Any]] = None,
290
279
  ) -> dict[str, Any]:
@@ -302,7 +291,6 @@ def _SafetySetting_to_mldev(
302
291
 
303
292
 
304
293
  def _FunctionDeclaration_to_mldev(
305
- api_client: BaseApiClient,
306
294
  from_object: Union[dict[str, Any], object],
307
295
  parent_object: Optional[dict[str, Any]] = None,
308
296
  ) -> dict[str, Any]:
@@ -319,14 +307,27 @@ def _FunctionDeclaration_to_mldev(
319
307
  if getv(from_object, ['parameters']) is not None:
320
308
  setv(to_object, ['parameters'], getv(from_object, ['parameters']))
321
309
 
310
+ if getv(from_object, ['parameters_json_schema']) is not None:
311
+ setv(
312
+ to_object,
313
+ ['parametersJsonSchema'],
314
+ getv(from_object, ['parameters_json_schema']),
315
+ )
316
+
322
317
  if getv(from_object, ['response']) is not None:
323
318
  setv(to_object, ['response'], getv(from_object, ['response']))
324
319
 
320
+ if getv(from_object, ['response_json_schema']) is not None:
321
+ setv(
322
+ to_object,
323
+ ['responseJsonSchema'],
324
+ getv(from_object, ['response_json_schema']),
325
+ )
326
+
325
327
  return to_object
326
328
 
327
329
 
328
330
  def _Interval_to_mldev(
329
- api_client: BaseApiClient,
330
331
  from_object: Union[dict[str, Any], object],
331
332
  parent_object: Optional[dict[str, Any]] = None,
332
333
  ) -> dict[str, Any]:
@@ -341,7 +342,6 @@ def _Interval_to_mldev(
341
342
 
342
343
 
343
344
  def _GoogleSearch_to_mldev(
344
- api_client: BaseApiClient,
345
345
  from_object: Union[dict[str, Any], object],
346
346
  parent_object: Optional[dict[str, Any]] = None,
347
347
  ) -> dict[str, Any]:
@@ -350,16 +350,13 @@ def _GoogleSearch_to_mldev(
350
350
  setv(
351
351
  to_object,
352
352
  ['timeRangeFilter'],
353
- _Interval_to_mldev(
354
- api_client, getv(from_object, ['time_range_filter']), to_object
355
- ),
353
+ _Interval_to_mldev(getv(from_object, ['time_range_filter']), to_object),
356
354
  )
357
355
 
358
356
  return to_object
359
357
 
360
358
 
361
359
  def _DynamicRetrievalConfig_to_mldev(
362
- api_client: BaseApiClient,
363
360
  from_object: Union[dict[str, Any], object],
364
361
  parent_object: Optional[dict[str, Any]] = None,
365
362
  ) -> dict[str, Any]:
@@ -378,7 +375,6 @@ def _DynamicRetrievalConfig_to_mldev(
378
375
 
379
376
 
380
377
  def _GoogleSearchRetrieval_to_mldev(
381
- api_client: BaseApiClient,
382
378
  from_object: Union[dict[str, Any], object],
383
379
  parent_object: Optional[dict[str, Any]] = None,
384
380
  ) -> dict[str, Any]:
@@ -388,9 +384,7 @@ def _GoogleSearchRetrieval_to_mldev(
388
384
  to_object,
389
385
  ['dynamicRetrievalConfig'],
390
386
  _DynamicRetrievalConfig_to_mldev(
391
- api_client,
392
- getv(from_object, ['dynamic_retrieval_config']),
393
- to_object,
387
+ getv(from_object, ['dynamic_retrieval_config']), to_object
394
388
  ),
395
389
  )
396
390
 
@@ -398,7 +392,6 @@ def _GoogleSearchRetrieval_to_mldev(
398
392
 
399
393
 
400
394
  def _EnterpriseWebSearch_to_mldev(
401
- api_client: BaseApiClient,
402
395
  from_object: Union[dict[str, Any], object],
403
396
  parent_object: Optional[dict[str, Any]] = None,
404
397
  ) -> dict[str, Any]:
@@ -408,7 +401,6 @@ def _EnterpriseWebSearch_to_mldev(
408
401
 
409
402
 
410
403
  def _ApiKeyConfig_to_mldev(
411
- api_client: BaseApiClient,
412
404
  from_object: Union[dict[str, Any], object],
413
405
  parent_object: Optional[dict[str, Any]] = None,
414
406
  ) -> dict[str, Any]:
@@ -420,7 +412,6 @@ def _ApiKeyConfig_to_mldev(
420
412
 
421
413
 
422
414
  def _AuthConfig_to_mldev(
423
- api_client: BaseApiClient,
424
415
  from_object: Union[dict[str, Any], object],
425
416
  parent_object: Optional[dict[str, Any]] = None,
426
417
  ) -> dict[str, Any]:
@@ -455,7 +446,6 @@ def _AuthConfig_to_mldev(
455
446
 
456
447
 
457
448
  def _GoogleMaps_to_mldev(
458
- api_client: BaseApiClient,
459
449
  from_object: Union[dict[str, Any], object],
460
450
  parent_object: Optional[dict[str, Any]] = None,
461
451
  ) -> dict[str, Any]:
@@ -467,7 +457,6 @@ def _GoogleMaps_to_mldev(
467
457
 
468
458
 
469
459
  def _UrlContext_to_mldev(
470
- api_client: BaseApiClient,
471
460
  from_object: Union[dict[str, Any], object],
472
461
  parent_object: Optional[dict[str, Any]] = None,
473
462
  ) -> dict[str, Any]:
@@ -477,7 +466,6 @@ def _UrlContext_to_mldev(
477
466
 
478
467
 
479
468
  def _Tool_to_mldev(
480
- api_client: BaseApiClient,
481
469
  from_object: Union[dict[str, Any], object],
482
470
  parent_object: Optional[dict[str, Any]] = None,
483
471
  ) -> dict[str, Any]:
@@ -487,7 +475,7 @@ def _Tool_to_mldev(
487
475
  to_object,
488
476
  ['functionDeclarations'],
489
477
  [
490
- _FunctionDeclaration_to_mldev(api_client, item, to_object)
478
+ _FunctionDeclaration_to_mldev(item, to_object)
491
479
  for item in getv(from_object, ['function_declarations'])
492
480
  ],
493
481
  )
@@ -499,9 +487,7 @@ def _Tool_to_mldev(
499
487
  setv(
500
488
  to_object,
501
489
  ['googleSearch'],
502
- _GoogleSearch_to_mldev(
503
- api_client, getv(from_object, ['google_search']), to_object
504
- ),
490
+ _GoogleSearch_to_mldev(getv(from_object, ['google_search']), to_object),
505
491
  )
506
492
 
507
493
  if getv(from_object, ['google_search_retrieval']) is not None:
@@ -509,9 +495,7 @@ def _Tool_to_mldev(
509
495
  to_object,
510
496
  ['googleSearchRetrieval'],
511
497
  _GoogleSearchRetrieval_to_mldev(
512
- api_client,
513
- getv(from_object, ['google_search_retrieval']),
514
- to_object,
498
+ getv(from_object, ['google_search_retrieval']), to_object
515
499
  ),
516
500
  )
517
501
 
@@ -527,9 +511,7 @@ def _Tool_to_mldev(
527
511
  setv(
528
512
  to_object,
529
513
  ['urlContext'],
530
- _UrlContext_to_mldev(
531
- api_client, getv(from_object, ['url_context']), to_object
532
- ),
514
+ _UrlContext_to_mldev(getv(from_object, ['url_context']), to_object),
533
515
  )
534
516
 
535
517
  if getv(from_object, ['code_execution']) is not None:
@@ -539,7 +521,6 @@ def _Tool_to_mldev(
539
521
 
540
522
 
541
523
  def _FunctionCallingConfig_to_mldev(
542
- api_client: BaseApiClient,
543
524
  from_object: Union[dict[str, Any], object],
544
525
  parent_object: Optional[dict[str, Any]] = None,
545
526
  ) -> dict[str, Any]:
@@ -558,7 +539,6 @@ def _FunctionCallingConfig_to_mldev(
558
539
 
559
540
 
560
541
  def _LatLng_to_mldev(
561
- api_client: BaseApiClient,
562
542
  from_object: Union[dict[str, Any], object],
563
543
  parent_object: Optional[dict[str, Any]] = None,
564
544
  ) -> dict[str, Any]:
@@ -573,7 +553,6 @@ def _LatLng_to_mldev(
573
553
 
574
554
 
575
555
  def _RetrievalConfig_to_mldev(
576
- api_client: BaseApiClient,
577
556
  from_object: Union[dict[str, Any], object],
578
557
  parent_object: Optional[dict[str, Any]] = None,
579
558
  ) -> dict[str, Any]:
@@ -582,7 +561,7 @@ def _RetrievalConfig_to_mldev(
582
561
  setv(
583
562
  to_object,
584
563
  ['latLng'],
585
- _LatLng_to_mldev(api_client, getv(from_object, ['lat_lng']), to_object),
564
+ _LatLng_to_mldev(getv(from_object, ['lat_lng']), to_object),
586
565
  )
587
566
 
588
567
  if getv(from_object, ['language_code']) is not None:
@@ -592,7 +571,6 @@ def _RetrievalConfig_to_mldev(
592
571
 
593
572
 
594
573
  def _ToolConfig_to_mldev(
595
- api_client: BaseApiClient,
596
574
  from_object: Union[dict[str, Any], object],
597
575
  parent_object: Optional[dict[str, Any]] = None,
598
576
  ) -> dict[str, Any]:
@@ -602,9 +580,7 @@ def _ToolConfig_to_mldev(
602
580
  to_object,
603
581
  ['functionCallingConfig'],
604
582
  _FunctionCallingConfig_to_mldev(
605
- api_client,
606
- getv(from_object, ['function_calling_config']),
607
- to_object,
583
+ getv(from_object, ['function_calling_config']), to_object
608
584
  ),
609
585
  )
610
586
 
@@ -613,7 +589,7 @@ def _ToolConfig_to_mldev(
613
589
  to_object,
614
590
  ['retrievalConfig'],
615
591
  _RetrievalConfig_to_mldev(
616
- api_client, getv(from_object, ['retrieval_config']), to_object
592
+ getv(from_object, ['retrieval_config']), to_object
617
593
  ),
618
594
  )
619
595
 
@@ -621,7 +597,6 @@ def _ToolConfig_to_mldev(
621
597
 
622
598
 
623
599
  def _PrebuiltVoiceConfig_to_mldev(
624
- api_client: BaseApiClient,
625
600
  from_object: Union[dict[str, Any], object],
626
601
  parent_object: Optional[dict[str, Any]] = None,
627
602
  ) -> dict[str, Any]:
@@ -633,7 +608,6 @@ def _PrebuiltVoiceConfig_to_mldev(
633
608
 
634
609
 
635
610
  def _VoiceConfig_to_mldev(
636
- api_client: BaseApiClient,
637
611
  from_object: Union[dict[str, Any], object],
638
612
  parent_object: Optional[dict[str, Any]] = None,
639
613
  ) -> dict[str, Any]:
@@ -643,7 +617,7 @@ def _VoiceConfig_to_mldev(
643
617
  to_object,
644
618
  ['prebuiltVoiceConfig'],
645
619
  _PrebuiltVoiceConfig_to_mldev(
646
- api_client, getv(from_object, ['prebuilt_voice_config']), to_object
620
+ getv(from_object, ['prebuilt_voice_config']), to_object
647
621
  ),
648
622
  )
649
623
 
@@ -651,7 +625,6 @@ def _VoiceConfig_to_mldev(
651
625
 
652
626
 
653
627
  def _SpeakerVoiceConfig_to_mldev(
654
- api_client: BaseApiClient,
655
628
  from_object: Union[dict[str, Any], object],
656
629
  parent_object: Optional[dict[str, Any]] = None,
657
630
  ) -> dict[str, Any]:
@@ -663,16 +636,13 @@ def _SpeakerVoiceConfig_to_mldev(
663
636
  setv(
664
637
  to_object,
665
638
  ['voiceConfig'],
666
- _VoiceConfig_to_mldev(
667
- api_client, getv(from_object, ['voice_config']), to_object
668
- ),
639
+ _VoiceConfig_to_mldev(getv(from_object, ['voice_config']), to_object),
669
640
  )
670
641
 
671
642
  return to_object
672
643
 
673
644
 
674
645
  def _MultiSpeakerVoiceConfig_to_mldev(
675
- api_client: BaseApiClient,
676
646
  from_object: Union[dict[str, Any], object],
677
647
  parent_object: Optional[dict[str, Any]] = None,
678
648
  ) -> dict[str, Any]:
@@ -682,7 +652,7 @@ def _MultiSpeakerVoiceConfig_to_mldev(
682
652
  to_object,
683
653
  ['speakerVoiceConfigs'],
684
654
  [
685
- _SpeakerVoiceConfig_to_mldev(api_client, item, to_object)
655
+ _SpeakerVoiceConfig_to_mldev(item, to_object)
686
656
  for item in getv(from_object, ['speaker_voice_configs'])
687
657
  ],
688
658
  )
@@ -691,7 +661,6 @@ def _MultiSpeakerVoiceConfig_to_mldev(
691
661
 
692
662
 
693
663
  def _SpeechConfig_to_mldev(
694
- api_client: BaseApiClient,
695
664
  from_object: Union[dict[str, Any], object],
696
665
  parent_object: Optional[dict[str, Any]] = None,
697
666
  ) -> dict[str, Any]:
@@ -700,9 +669,7 @@ def _SpeechConfig_to_mldev(
700
669
  setv(
701
670
  to_object,
702
671
  ['voiceConfig'],
703
- _VoiceConfig_to_mldev(
704
- api_client, getv(from_object, ['voice_config']), to_object
705
- ),
672
+ _VoiceConfig_to_mldev(getv(from_object, ['voice_config']), to_object),
706
673
  )
707
674
 
708
675
  if getv(from_object, ['multi_speaker_voice_config']) is not None:
@@ -710,9 +677,7 @@ def _SpeechConfig_to_mldev(
710
677
  to_object,
711
678
  ['multiSpeakerVoiceConfig'],
712
679
  _MultiSpeakerVoiceConfig_to_mldev(
713
- api_client,
714
- getv(from_object, ['multi_speaker_voice_config']),
715
- to_object,
680
+ getv(from_object, ['multi_speaker_voice_config']), to_object
716
681
  ),
717
682
  )
718
683
 
@@ -723,7 +688,6 @@ def _SpeechConfig_to_mldev(
723
688
 
724
689
 
725
690
  def _ThinkingConfig_to_mldev(
726
- api_client: BaseApiClient,
727
691
  from_object: Union[dict[str, Any], object],
728
692
  parent_object: Optional[dict[str, Any]] = None,
729
693
  ) -> dict[str, Any]:
@@ -751,9 +715,7 @@ def _GenerateContentConfig_to_mldev(
751
715
  parent_object,
752
716
  ['systemInstruction'],
753
717
  _Content_to_mldev(
754
- api_client,
755
- t.t_content(api_client, getv(from_object, ['system_instruction'])),
756
- to_object,
718
+ t.t_content(getv(from_object, ['system_instruction'])), to_object
757
719
  ),
758
720
  )
759
721
 
@@ -814,7 +776,6 @@ def _GenerateContentConfig_to_mldev(
814
776
  to_object,
815
777
  ['responseSchema'],
816
778
  _Schema_to_mldev(
817
- api_client,
818
779
  t.t_schema(api_client, getv(from_object, ['response_schema'])),
819
780
  to_object,
820
781
  ),
@@ -833,7 +794,7 @@ def _GenerateContentConfig_to_mldev(
833
794
  parent_object,
834
795
  ['safetySettings'],
835
796
  [
836
- _SafetySetting_to_mldev(api_client, item, to_object)
797
+ _SafetySetting_to_mldev(item, to_object)
837
798
  for item in getv(from_object, ['safety_settings'])
838
799
  ],
839
800
  )
@@ -843,7 +804,7 @@ def _GenerateContentConfig_to_mldev(
843
804
  parent_object,
844
805
  ['tools'],
845
806
  [
846
- _Tool_to_mldev(api_client, t.t_tool(api_client, item), to_object)
807
+ _Tool_to_mldev(t.t_tool(api_client, item), to_object)
847
808
  for item in t.t_tools(api_client, getv(from_object, ['tools']))
848
809
  ],
849
810
  )
@@ -852,9 +813,7 @@ def _GenerateContentConfig_to_mldev(
852
813
  setv(
853
814
  parent_object,
854
815
  ['toolConfig'],
855
- _ToolConfig_to_mldev(
856
- api_client, getv(from_object, ['tool_config']), to_object
857
- ),
816
+ _ToolConfig_to_mldev(getv(from_object, ['tool_config']), to_object),
858
817
  )
859
818
 
860
819
  if getv(from_object, ['labels']) is not None:
@@ -886,9 +845,7 @@ def _GenerateContentConfig_to_mldev(
886
845
  to_object,
887
846
  ['speechConfig'],
888
847
  _SpeechConfig_to_mldev(
889
- api_client,
890
- t.t_speech_config(api_client, getv(from_object, ['speech_config'])),
891
- to_object,
848
+ t.t_speech_config(getv(from_object, ['speech_config'])), to_object
892
849
  ),
893
850
  )
894
851
 
@@ -902,7 +859,7 @@ def _GenerateContentConfig_to_mldev(
902
859
  to_object,
903
860
  ['thinkingConfig'],
904
861
  _ThinkingConfig_to_mldev(
905
- api_client, getv(from_object, ['thinking_config']), to_object
862
+ getv(from_object, ['thinking_config']), to_object
906
863
  ),
907
864
  )
908
865
 
@@ -927,10 +884,8 @@ def _GenerateContentParameters_to_mldev(
927
884
  to_object,
928
885
  ['contents'],
929
886
  [
930
- _Content_to_mldev(api_client, item, to_object)
931
- for item in t.t_contents(
932
- api_client, getv(from_object, ['contents'])
933
- )
887
+ _Content_to_mldev(item, to_object)
888
+ for item in t.t_contents(getv(from_object, ['contents']))
934
889
  ],
935
890
  )
936
891
 
@@ -947,7 +902,6 @@ def _GenerateContentParameters_to_mldev(
947
902
 
948
903
 
949
904
  def _EmbedContentConfig_to_mldev(
950
- api_client: BaseApiClient,
951
905
  from_object: Union[dict[str, Any], object],
952
906
  parent_object: Optional[dict[str, Any]] = None,
953
907
  ) -> dict[str, Any]:
@@ -1003,9 +957,7 @@ def _EmbedContentParameters_to_mldev(
1003
957
  setv(
1004
958
  to_object,
1005
959
  ['config'],
1006
- _EmbedContentConfig_to_mldev(
1007
- api_client, getv(from_object, ['config']), to_object
1008
- ),
960
+ _EmbedContentConfig_to_mldev(getv(from_object, ['config']), to_object),
1009
961
  )
1010
962
 
1011
963
  setv(
@@ -1017,7 +969,6 @@ def _EmbedContentParameters_to_mldev(
1017
969
 
1018
970
 
1019
971
  def _GenerateImagesConfig_to_mldev(
1020
- api_client: BaseApiClient,
1021
972
  from_object: Union[dict[str, Any], object],
1022
973
  parent_object: Optional[dict[str, Any]] = None,
1023
974
  ) -> dict[str, Any]:
@@ -1140,7 +1091,7 @@ def _GenerateImagesParameters_to_mldev(
1140
1091
  to_object,
1141
1092
  ['config'],
1142
1093
  _GenerateImagesConfig_to_mldev(
1143
- api_client, getv(from_object, ['config']), to_object
1094
+ getv(from_object, ['config']), to_object
1144
1095
  ),
1145
1096
  )
1146
1097
 
@@ -1217,7 +1168,6 @@ def _ListModelsParameters_to_mldev(
1217
1168
 
1218
1169
 
1219
1170
  def _UpdateModelConfig_to_mldev(
1220
- api_client: BaseApiClient,
1221
1171
  from_object: Union[dict[str, Any], object],
1222
1172
  parent_object: Optional[dict[str, Any]] = None,
1223
1173
  ) -> dict[str, Any]:
@@ -1256,9 +1206,7 @@ def _UpdateModelParameters_to_mldev(
1256
1206
  setv(
1257
1207
  to_object,
1258
1208
  ['config'],
1259
- _UpdateModelConfig_to_mldev(
1260
- api_client, getv(from_object, ['config']), to_object
1261
- ),
1209
+ _UpdateModelConfig_to_mldev(getv(from_object, ['config']), to_object),
1262
1210
  )
1263
1211
 
1264
1212
  return to_object
@@ -1284,7 +1232,6 @@ def _DeleteModelParameters_to_mldev(
1284
1232
 
1285
1233
 
1286
1234
  def _CountTokensConfig_to_mldev(
1287
- api_client: BaseApiClient,
1288
1235
  from_object: Union[dict[str, Any], object],
1289
1236
  parent_object: Optional[dict[str, Any]] = None,
1290
1237
  ) -> dict[str, Any]:
@@ -1324,10 +1271,8 @@ def _CountTokensParameters_to_mldev(
1324
1271
  to_object,
1325
1272
  ['contents'],
1326
1273
  [
1327
- _Content_to_mldev(api_client, item, to_object)
1328
- for item in t.t_contents(
1329
- api_client, getv(from_object, ['contents'])
1330
- )
1274
+ _Content_to_mldev(item, to_object)
1275
+ for item in t.t_contents(getv(from_object, ['contents']))
1331
1276
  ],
1332
1277
  )
1333
1278
 
@@ -1335,16 +1280,13 @@ def _CountTokensParameters_to_mldev(
1335
1280
  setv(
1336
1281
  to_object,
1337
1282
  ['config'],
1338
- _CountTokensConfig_to_mldev(
1339
- api_client, getv(from_object, ['config']), to_object
1340
- ),
1283
+ _CountTokensConfig_to_mldev(getv(from_object, ['config']), to_object),
1341
1284
  )
1342
1285
 
1343
1286
  return to_object
1344
1287
 
1345
1288
 
1346
1289
  def _Image_to_mldev(
1347
- api_client: BaseApiClient,
1348
1290
  from_object: Union[dict[str, Any], object],
1349
1291
  parent_object: Optional[dict[str, Any]] = None,
1350
1292
  ) -> dict[str, Any]:
@@ -1356,7 +1298,7 @@ def _Image_to_mldev(
1356
1298
  setv(
1357
1299
  to_object,
1358
1300
  ['bytesBase64Encoded'],
1359
- t.t_bytes(api_client, getv(from_object, ['image_bytes'])),
1301
+ t.t_bytes(getv(from_object, ['image_bytes'])),
1360
1302
  )
1361
1303
 
1362
1304
  if getv(from_object, ['mime_type']) is not None:
@@ -1366,7 +1308,6 @@ def _Image_to_mldev(
1366
1308
 
1367
1309
 
1368
1310
  def _Video_to_mldev(
1369
- api_client: BaseApiClient,
1370
1311
  from_object: Union[dict[str, Any], object],
1371
1312
  parent_object: Optional[dict[str, Any]] = None,
1372
1313
  ) -> dict[str, Any]:
@@ -1378,7 +1319,7 @@ def _Video_to_mldev(
1378
1319
  setv(
1379
1320
  to_object,
1380
1321
  ['video', 'encodedVideo'],
1381
- t.t_bytes(api_client, getv(from_object, ['video_bytes'])),
1322
+ t.t_bytes(getv(from_object, ['video_bytes'])),
1382
1323
  )
1383
1324
 
1384
1325
  if getv(from_object, ['mime_type']) is not None:
@@ -1388,7 +1329,6 @@ def _Video_to_mldev(
1388
1329
 
1389
1330
 
1390
1331
  def _GenerateVideosConfig_to_mldev(
1391
- api_client: BaseApiClient,
1392
1332
  from_object: Union[dict[str, Any], object],
1393
1333
  parent_object: Optional[dict[str, Any]] = None,
1394
1334
  ) -> dict[str, Any]:
@@ -1480,7 +1420,7 @@ def _GenerateVideosParameters_to_mldev(
1480
1420
  setv(
1481
1421
  to_object,
1482
1422
  ['instances[0]', 'image'],
1483
- _Image_to_mldev(api_client, getv(from_object, ['image']), to_object),
1423
+ _Image_to_mldev(getv(from_object, ['image']), to_object),
1484
1424
  )
1485
1425
 
1486
1426
  if getv(from_object, ['video']) is not None:
@@ -1491,7 +1431,7 @@ def _GenerateVideosParameters_to_mldev(
1491
1431
  to_object,
1492
1432
  ['config'],
1493
1433
  _GenerateVideosConfig_to_mldev(
1494
- api_client, getv(from_object, ['config']), to_object
1434
+ getv(from_object, ['config']), to_object
1495
1435
  ),
1496
1436
  )
1497
1437
 
@@ -1499,7 +1439,6 @@ def _GenerateVideosParameters_to_mldev(
1499
1439
 
1500
1440
 
1501
1441
  def _VideoMetadata_to_vertex(
1502
- api_client: BaseApiClient,
1503
1442
  from_object: Union[dict[str, Any], object],
1504
1443
  parent_object: Optional[dict[str, Any]] = None,
1505
1444
  ) -> dict[str, Any]:
@@ -1517,7 +1456,6 @@ def _VideoMetadata_to_vertex(
1517
1456
 
1518
1457
 
1519
1458
  def _Blob_to_vertex(
1520
- api_client: BaseApiClient,
1521
1459
  from_object: Union[dict[str, Any], object],
1522
1460
  parent_object: Optional[dict[str, Any]] = None,
1523
1461
  ) -> dict[str, Any]:
@@ -1535,7 +1473,6 @@ def _Blob_to_vertex(
1535
1473
 
1536
1474
 
1537
1475
  def _FileData_to_vertex(
1538
- api_client: BaseApiClient,
1539
1476
  from_object: Union[dict[str, Any], object],
1540
1477
  parent_object: Optional[dict[str, Any]] = None,
1541
1478
  ) -> dict[str, Any]:
@@ -1553,7 +1490,6 @@ def _FileData_to_vertex(
1553
1490
 
1554
1491
 
1555
1492
  def _Part_to_vertex(
1556
- api_client: BaseApiClient,
1557
1493
  from_object: Union[dict[str, Any], object],
1558
1494
  parent_object: Optional[dict[str, Any]] = None,
1559
1495
  ) -> dict[str, Any]:
@@ -1563,7 +1499,7 @@ def _Part_to_vertex(
1563
1499
  to_object,
1564
1500
  ['videoMetadata'],
1565
1501
  _VideoMetadata_to_vertex(
1566
- api_client, getv(from_object, ['video_metadata']), to_object
1502
+ getv(from_object, ['video_metadata']), to_object
1567
1503
  ),
1568
1504
  )
1569
1505
 
@@ -1574,18 +1510,14 @@ def _Part_to_vertex(
1574
1510
  setv(
1575
1511
  to_object,
1576
1512
  ['inlineData'],
1577
- _Blob_to_vertex(
1578
- api_client, getv(from_object, ['inline_data']), to_object
1579
- ),
1513
+ _Blob_to_vertex(getv(from_object, ['inline_data']), to_object),
1580
1514
  )
1581
1515
 
1582
1516
  if getv(from_object, ['file_data']) is not None:
1583
1517
  setv(
1584
1518
  to_object,
1585
1519
  ['fileData'],
1586
- _FileData_to_vertex(
1587
- api_client, getv(from_object, ['file_data']), to_object
1588
- ),
1520
+ _FileData_to_vertex(getv(from_object, ['file_data']), to_object),
1589
1521
  )
1590
1522
 
1591
1523
  if getv(from_object, ['thought_signature']) is not None:
@@ -1622,7 +1554,6 @@ def _Part_to_vertex(
1622
1554
 
1623
1555
 
1624
1556
  def _Content_to_vertex(
1625
- api_client: BaseApiClient,
1626
1557
  from_object: Union[dict[str, Any], object],
1627
1558
  parent_object: Optional[dict[str, Any]] = None,
1628
1559
  ) -> dict[str, Any]:
@@ -1632,7 +1563,7 @@ def _Content_to_vertex(
1632
1563
  to_object,
1633
1564
  ['parts'],
1634
1565
  [
1635
- _Part_to_vertex(api_client, item, to_object)
1566
+ _Part_to_vertex(item, to_object)
1636
1567
  for item in getv(from_object, ['parts'])
1637
1568
  ],
1638
1569
  )
@@ -1644,7 +1575,6 @@ def _Content_to_vertex(
1644
1575
 
1645
1576
 
1646
1577
  def _Schema_to_vertex(
1647
- api_client: BaseApiClient,
1648
1578
  from_object: Union[dict[str, Any], object],
1649
1579
  parent_object: Optional[dict[str, Any]] = None,
1650
1580
  ) -> dict[str, Any]:
@@ -1736,7 +1666,6 @@ def _Schema_to_vertex(
1736
1666
 
1737
1667
 
1738
1668
  def _ModelSelectionConfig_to_vertex(
1739
- api_client: BaseApiClient,
1740
1669
  from_object: Union[dict[str, Any], object],
1741
1670
  parent_object: Optional[dict[str, Any]] = None,
1742
1671
  ) -> dict[str, Any]:
@@ -1752,7 +1681,6 @@ def _ModelSelectionConfig_to_vertex(
1752
1681
 
1753
1682
 
1754
1683
  def _SafetySetting_to_vertex(
1755
- api_client: BaseApiClient,
1756
1684
  from_object: Union[dict[str, Any], object],
1757
1685
  parent_object: Optional[dict[str, Any]] = None,
1758
1686
  ) -> dict[str, Any]:
@@ -1770,7 +1698,6 @@ def _SafetySetting_to_vertex(
1770
1698
 
1771
1699
 
1772
1700
  def _FunctionDeclaration_to_vertex(
1773
- api_client: BaseApiClient,
1774
1701
  from_object: Union[dict[str, Any], object],
1775
1702
  parent_object: Optional[dict[str, Any]] = None,
1776
1703
  ) -> dict[str, Any]:
@@ -1787,14 +1714,27 @@ def _FunctionDeclaration_to_vertex(
1787
1714
  if getv(from_object, ['parameters']) is not None:
1788
1715
  setv(to_object, ['parameters'], getv(from_object, ['parameters']))
1789
1716
 
1717
+ if getv(from_object, ['parameters_json_schema']) is not None:
1718
+ setv(
1719
+ to_object,
1720
+ ['parametersJsonSchema'],
1721
+ getv(from_object, ['parameters_json_schema']),
1722
+ )
1723
+
1790
1724
  if getv(from_object, ['response']) is not None:
1791
1725
  setv(to_object, ['response'], getv(from_object, ['response']))
1792
1726
 
1727
+ if getv(from_object, ['response_json_schema']) is not None:
1728
+ setv(
1729
+ to_object,
1730
+ ['responseJsonSchema'],
1731
+ getv(from_object, ['response_json_schema']),
1732
+ )
1733
+
1793
1734
  return to_object
1794
1735
 
1795
1736
 
1796
1737
  def _Interval_to_vertex(
1797
- api_client: BaseApiClient,
1798
1738
  from_object: Union[dict[str, Any], object],
1799
1739
  parent_object: Optional[dict[str, Any]] = None,
1800
1740
  ) -> dict[str, Any]:
@@ -1809,7 +1749,6 @@ def _Interval_to_vertex(
1809
1749
 
1810
1750
 
1811
1751
  def _GoogleSearch_to_vertex(
1812
- api_client: BaseApiClient,
1813
1752
  from_object: Union[dict[str, Any], object],
1814
1753
  parent_object: Optional[dict[str, Any]] = None,
1815
1754
  ) -> dict[str, Any]:
@@ -1819,7 +1758,7 @@ def _GoogleSearch_to_vertex(
1819
1758
  to_object,
1820
1759
  ['timeRangeFilter'],
1821
1760
  _Interval_to_vertex(
1822
- api_client, getv(from_object, ['time_range_filter']), to_object
1761
+ getv(from_object, ['time_range_filter']), to_object
1823
1762
  ),
1824
1763
  )
1825
1764
 
@@ -1827,7 +1766,6 @@ def _GoogleSearch_to_vertex(
1827
1766
 
1828
1767
 
1829
1768
  def _DynamicRetrievalConfig_to_vertex(
1830
- api_client: BaseApiClient,
1831
1769
  from_object: Union[dict[str, Any], object],
1832
1770
  parent_object: Optional[dict[str, Any]] = None,
1833
1771
  ) -> dict[str, Any]:
@@ -1846,7 +1784,6 @@ def _DynamicRetrievalConfig_to_vertex(
1846
1784
 
1847
1785
 
1848
1786
  def _GoogleSearchRetrieval_to_vertex(
1849
- api_client: BaseApiClient,
1850
1787
  from_object: Union[dict[str, Any], object],
1851
1788
  parent_object: Optional[dict[str, Any]] = None,
1852
1789
  ) -> dict[str, Any]:
@@ -1856,9 +1793,7 @@ def _GoogleSearchRetrieval_to_vertex(
1856
1793
  to_object,
1857
1794
  ['dynamicRetrievalConfig'],
1858
1795
  _DynamicRetrievalConfig_to_vertex(
1859
- api_client,
1860
- getv(from_object, ['dynamic_retrieval_config']),
1861
- to_object,
1796
+ getv(from_object, ['dynamic_retrieval_config']), to_object
1862
1797
  ),
1863
1798
  )
1864
1799
 
@@ -1866,7 +1801,6 @@ def _GoogleSearchRetrieval_to_vertex(
1866
1801
 
1867
1802
 
1868
1803
  def _EnterpriseWebSearch_to_vertex(
1869
- api_client: BaseApiClient,
1870
1804
  from_object: Union[dict[str, Any], object],
1871
1805
  parent_object: Optional[dict[str, Any]] = None,
1872
1806
  ) -> dict[str, Any]:
@@ -1876,7 +1810,6 @@ def _EnterpriseWebSearch_to_vertex(
1876
1810
 
1877
1811
 
1878
1812
  def _ApiKeyConfig_to_vertex(
1879
- api_client: BaseApiClient,
1880
1813
  from_object: Union[dict[str, Any], object],
1881
1814
  parent_object: Optional[dict[str, Any]] = None,
1882
1815
  ) -> dict[str, Any]:
@@ -1888,7 +1821,6 @@ def _ApiKeyConfig_to_vertex(
1888
1821
 
1889
1822
 
1890
1823
  def _AuthConfig_to_vertex(
1891
- api_client: BaseApiClient,
1892
1824
  from_object: Union[dict[str, Any], object],
1893
1825
  parent_object: Optional[dict[str, Any]] = None,
1894
1826
  ) -> dict[str, Any]:
@@ -1898,7 +1830,7 @@ def _AuthConfig_to_vertex(
1898
1830
  to_object,
1899
1831
  ['apiKeyConfig'],
1900
1832
  _ApiKeyConfig_to_vertex(
1901
- api_client, getv(from_object, ['api_key_config']), to_object
1833
+ getv(from_object, ['api_key_config']), to_object
1902
1834
  ),
1903
1835
  )
1904
1836
 
@@ -1929,7 +1861,6 @@ def _AuthConfig_to_vertex(
1929
1861
 
1930
1862
 
1931
1863
  def _GoogleMaps_to_vertex(
1932
- api_client: BaseApiClient,
1933
1864
  from_object: Union[dict[str, Any], object],
1934
1865
  parent_object: Optional[dict[str, Any]] = None,
1935
1866
  ) -> dict[str, Any]:
@@ -1938,16 +1869,13 @@ def _GoogleMaps_to_vertex(
1938
1869
  setv(
1939
1870
  to_object,
1940
1871
  ['authConfig'],
1941
- _AuthConfig_to_vertex(
1942
- api_client, getv(from_object, ['auth_config']), to_object
1943
- ),
1872
+ _AuthConfig_to_vertex(getv(from_object, ['auth_config']), to_object),
1944
1873
  )
1945
1874
 
1946
1875
  return to_object
1947
1876
 
1948
1877
 
1949
1878
  def _UrlContext_to_vertex(
1950
- api_client: BaseApiClient,
1951
1879
  from_object: Union[dict[str, Any], object],
1952
1880
  parent_object: Optional[dict[str, Any]] = None,
1953
1881
  ) -> dict[str, Any]:
@@ -1957,7 +1885,6 @@ def _UrlContext_to_vertex(
1957
1885
 
1958
1886
 
1959
1887
  def _Tool_to_vertex(
1960
- api_client: BaseApiClient,
1961
1888
  from_object: Union[dict[str, Any], object],
1962
1889
  parent_object: Optional[dict[str, Any]] = None,
1963
1890
  ) -> dict[str, Any]:
@@ -1967,7 +1894,7 @@ def _Tool_to_vertex(
1967
1894
  to_object,
1968
1895
  ['functionDeclarations'],
1969
1896
  [
1970
- _FunctionDeclaration_to_vertex(api_client, item, to_object)
1897
+ _FunctionDeclaration_to_vertex(item, to_object)
1971
1898
  for item in getv(from_object, ['function_declarations'])
1972
1899
  ],
1973
1900
  )
@@ -1980,7 +1907,7 @@ def _Tool_to_vertex(
1980
1907
  to_object,
1981
1908
  ['googleSearch'],
1982
1909
  _GoogleSearch_to_vertex(
1983
- api_client, getv(from_object, ['google_search']), to_object
1910
+ getv(from_object, ['google_search']), to_object
1984
1911
  ),
1985
1912
  )
1986
1913
 
@@ -1989,9 +1916,7 @@ def _Tool_to_vertex(
1989
1916
  to_object,
1990
1917
  ['googleSearchRetrieval'],
1991
1918
  _GoogleSearchRetrieval_to_vertex(
1992
- api_client,
1993
- getv(from_object, ['google_search_retrieval']),
1994
- to_object,
1919
+ getv(from_object, ['google_search_retrieval']), to_object
1995
1920
  ),
1996
1921
  )
1997
1922
 
@@ -2000,7 +1925,7 @@ def _Tool_to_vertex(
2000
1925
  to_object,
2001
1926
  ['enterpriseWebSearch'],
2002
1927
  _EnterpriseWebSearch_to_vertex(
2003
- api_client, getv(from_object, ['enterprise_web_search']), to_object
1928
+ getv(from_object, ['enterprise_web_search']), to_object
2004
1929
  ),
2005
1930
  )
2006
1931
 
@@ -2008,18 +1933,14 @@ def _Tool_to_vertex(
2008
1933
  setv(
2009
1934
  to_object,
2010
1935
  ['googleMaps'],
2011
- _GoogleMaps_to_vertex(
2012
- api_client, getv(from_object, ['google_maps']), to_object
2013
- ),
1936
+ _GoogleMaps_to_vertex(getv(from_object, ['google_maps']), to_object),
2014
1937
  )
2015
1938
 
2016
1939
  if getv(from_object, ['url_context']) is not None:
2017
1940
  setv(
2018
1941
  to_object,
2019
1942
  ['urlContext'],
2020
- _UrlContext_to_vertex(
2021
- api_client, getv(from_object, ['url_context']), to_object
2022
- ),
1943
+ _UrlContext_to_vertex(getv(from_object, ['url_context']), to_object),
2023
1944
  )
2024
1945
 
2025
1946
  if getv(from_object, ['code_execution']) is not None:
@@ -2029,7 +1950,6 @@ def _Tool_to_vertex(
2029
1950
 
2030
1951
 
2031
1952
  def _FunctionCallingConfig_to_vertex(
2032
- api_client: BaseApiClient,
2033
1953
  from_object: Union[dict[str, Any], object],
2034
1954
  parent_object: Optional[dict[str, Any]] = None,
2035
1955
  ) -> dict[str, Any]:
@@ -2048,7 +1968,6 @@ def _FunctionCallingConfig_to_vertex(
2048
1968
 
2049
1969
 
2050
1970
  def _LatLng_to_vertex(
2051
- api_client: BaseApiClient,
2052
1971
  from_object: Union[dict[str, Any], object],
2053
1972
  parent_object: Optional[dict[str, Any]] = None,
2054
1973
  ) -> dict[str, Any]:
@@ -2063,7 +1982,6 @@ def _LatLng_to_vertex(
2063
1982
 
2064
1983
 
2065
1984
  def _RetrievalConfig_to_vertex(
2066
- api_client: BaseApiClient,
2067
1985
  from_object: Union[dict[str, Any], object],
2068
1986
  parent_object: Optional[dict[str, Any]] = None,
2069
1987
  ) -> dict[str, Any]:
@@ -2072,9 +1990,7 @@ def _RetrievalConfig_to_vertex(
2072
1990
  setv(
2073
1991
  to_object,
2074
1992
  ['latLng'],
2075
- _LatLng_to_vertex(
2076
- api_client, getv(from_object, ['lat_lng']), to_object
2077
- ),
1993
+ _LatLng_to_vertex(getv(from_object, ['lat_lng']), to_object),
2078
1994
  )
2079
1995
 
2080
1996
  if getv(from_object, ['language_code']) is not None:
@@ -2084,7 +2000,6 @@ def _RetrievalConfig_to_vertex(
2084
2000
 
2085
2001
 
2086
2002
  def _ToolConfig_to_vertex(
2087
- api_client: BaseApiClient,
2088
2003
  from_object: Union[dict[str, Any], object],
2089
2004
  parent_object: Optional[dict[str, Any]] = None,
2090
2005
  ) -> dict[str, Any]:
@@ -2094,9 +2009,7 @@ def _ToolConfig_to_vertex(
2094
2009
  to_object,
2095
2010
  ['functionCallingConfig'],
2096
2011
  _FunctionCallingConfig_to_vertex(
2097
- api_client,
2098
- getv(from_object, ['function_calling_config']),
2099
- to_object,
2012
+ getv(from_object, ['function_calling_config']), to_object
2100
2013
  ),
2101
2014
  )
2102
2015
 
@@ -2105,7 +2018,7 @@ def _ToolConfig_to_vertex(
2105
2018
  to_object,
2106
2019
  ['retrievalConfig'],
2107
2020
  _RetrievalConfig_to_vertex(
2108
- api_client, getv(from_object, ['retrieval_config']), to_object
2021
+ getv(from_object, ['retrieval_config']), to_object
2109
2022
  ),
2110
2023
  )
2111
2024
 
@@ -2113,7 +2026,6 @@ def _ToolConfig_to_vertex(
2113
2026
 
2114
2027
 
2115
2028
  def _PrebuiltVoiceConfig_to_vertex(
2116
- api_client: BaseApiClient,
2117
2029
  from_object: Union[dict[str, Any], object],
2118
2030
  parent_object: Optional[dict[str, Any]] = None,
2119
2031
  ) -> dict[str, Any]:
@@ -2125,7 +2037,6 @@ def _PrebuiltVoiceConfig_to_vertex(
2125
2037
 
2126
2038
 
2127
2039
  def _VoiceConfig_to_vertex(
2128
- api_client: BaseApiClient,
2129
2040
  from_object: Union[dict[str, Any], object],
2130
2041
  parent_object: Optional[dict[str, Any]] = None,
2131
2042
  ) -> dict[str, Any]:
@@ -2135,7 +2046,7 @@ def _VoiceConfig_to_vertex(
2135
2046
  to_object,
2136
2047
  ['prebuiltVoiceConfig'],
2137
2048
  _PrebuiltVoiceConfig_to_vertex(
2138
- api_client, getv(from_object, ['prebuilt_voice_config']), to_object
2049
+ getv(from_object, ['prebuilt_voice_config']), to_object
2139
2050
  ),
2140
2051
  )
2141
2052
 
@@ -2143,7 +2054,6 @@ def _VoiceConfig_to_vertex(
2143
2054
 
2144
2055
 
2145
2056
  def _SpeakerVoiceConfig_to_vertex(
2146
- api_client: BaseApiClient,
2147
2057
  from_object: Union[dict[str, Any], object],
2148
2058
  parent_object: Optional[dict[str, Any]] = None,
2149
2059
  ) -> dict[str, Any]:
@@ -2158,7 +2068,6 @@ def _SpeakerVoiceConfig_to_vertex(
2158
2068
 
2159
2069
 
2160
2070
  def _MultiSpeakerVoiceConfig_to_vertex(
2161
- api_client: BaseApiClient,
2162
2071
  from_object: Union[dict[str, Any], object],
2163
2072
  parent_object: Optional[dict[str, Any]] = None,
2164
2073
  ) -> dict[str, Any]:
@@ -2172,7 +2081,6 @@ def _MultiSpeakerVoiceConfig_to_vertex(
2172
2081
 
2173
2082
 
2174
2083
  def _SpeechConfig_to_vertex(
2175
- api_client: BaseApiClient,
2176
2084
  from_object: Union[dict[str, Any], object],
2177
2085
  parent_object: Optional[dict[str, Any]] = None,
2178
2086
  ) -> dict[str, Any]:
@@ -2181,9 +2089,7 @@ def _SpeechConfig_to_vertex(
2181
2089
  setv(
2182
2090
  to_object,
2183
2091
  ['voiceConfig'],
2184
- _VoiceConfig_to_vertex(
2185
- api_client, getv(from_object, ['voice_config']), to_object
2186
- ),
2092
+ _VoiceConfig_to_vertex(getv(from_object, ['voice_config']), to_object),
2187
2093
  )
2188
2094
 
2189
2095
  if getv(from_object, ['multi_speaker_voice_config']) is not None:
@@ -2198,7 +2104,6 @@ def _SpeechConfig_to_vertex(
2198
2104
 
2199
2105
 
2200
2106
  def _ThinkingConfig_to_vertex(
2201
- api_client: BaseApiClient,
2202
2107
  from_object: Union[dict[str, Any], object],
2203
2108
  parent_object: Optional[dict[str, Any]] = None,
2204
2109
  ) -> dict[str, Any]:
@@ -2226,9 +2131,7 @@ def _GenerateContentConfig_to_vertex(
2226
2131
  parent_object,
2227
2132
  ['systemInstruction'],
2228
2133
  _Content_to_vertex(
2229
- api_client,
2230
- t.t_content(api_client, getv(from_object, ['system_instruction'])),
2231
- to_object,
2134
+ t.t_content(getv(from_object, ['system_instruction'])), to_object
2232
2135
  ),
2233
2136
  )
2234
2137
 
@@ -2289,7 +2192,6 @@ def _GenerateContentConfig_to_vertex(
2289
2192
  to_object,
2290
2193
  ['responseSchema'],
2291
2194
  _Schema_to_vertex(
2292
- api_client,
2293
2195
  t.t_schema(api_client, getv(from_object, ['response_schema'])),
2294
2196
  to_object,
2295
2197
  ),
@@ -2303,7 +2205,7 @@ def _GenerateContentConfig_to_vertex(
2303
2205
  to_object,
2304
2206
  ['modelConfig'],
2305
2207
  _ModelSelectionConfig_to_vertex(
2306
- api_client, getv(from_object, ['model_selection_config']), to_object
2208
+ getv(from_object, ['model_selection_config']), to_object
2307
2209
  ),
2308
2210
  )
2309
2211
 
@@ -2312,7 +2214,7 @@ def _GenerateContentConfig_to_vertex(
2312
2214
  parent_object,
2313
2215
  ['safetySettings'],
2314
2216
  [
2315
- _SafetySetting_to_vertex(api_client, item, to_object)
2217
+ _SafetySetting_to_vertex(item, to_object)
2316
2218
  for item in getv(from_object, ['safety_settings'])
2317
2219
  ],
2318
2220
  )
@@ -2322,7 +2224,7 @@ def _GenerateContentConfig_to_vertex(
2322
2224
  parent_object,
2323
2225
  ['tools'],
2324
2226
  [
2325
- _Tool_to_vertex(api_client, t.t_tool(api_client, item), to_object)
2227
+ _Tool_to_vertex(t.t_tool(api_client, item), to_object)
2326
2228
  for item in t.t_tools(api_client, getv(from_object, ['tools']))
2327
2229
  ],
2328
2230
  )
@@ -2331,9 +2233,7 @@ def _GenerateContentConfig_to_vertex(
2331
2233
  setv(
2332
2234
  parent_object,
2333
2235
  ['toolConfig'],
2334
- _ToolConfig_to_vertex(
2335
- api_client, getv(from_object, ['tool_config']), to_object
2336
- ),
2236
+ _ToolConfig_to_vertex(getv(from_object, ['tool_config']), to_object),
2337
2237
  )
2338
2238
 
2339
2239
  if getv(from_object, ['labels']) is not None:
@@ -2365,9 +2265,7 @@ def _GenerateContentConfig_to_vertex(
2365
2265
  to_object,
2366
2266
  ['speechConfig'],
2367
2267
  _SpeechConfig_to_vertex(
2368
- api_client,
2369
- t.t_speech_config(api_client, getv(from_object, ['speech_config'])),
2370
- to_object,
2268
+ t.t_speech_config(getv(from_object, ['speech_config'])), to_object
2371
2269
  ),
2372
2270
  )
2373
2271
 
@@ -2379,7 +2277,7 @@ def _GenerateContentConfig_to_vertex(
2379
2277
  to_object,
2380
2278
  ['thinkingConfig'],
2381
2279
  _ThinkingConfig_to_vertex(
2382
- api_client, getv(from_object, ['thinking_config']), to_object
2280
+ getv(from_object, ['thinking_config']), to_object
2383
2281
  ),
2384
2282
  )
2385
2283
 
@@ -2404,10 +2302,8 @@ def _GenerateContentParameters_to_vertex(
2404
2302
  to_object,
2405
2303
  ['contents'],
2406
2304
  [
2407
- _Content_to_vertex(api_client, item, to_object)
2408
- for item in t.t_contents(
2409
- api_client, getv(from_object, ['contents'])
2410
- )
2305
+ _Content_to_vertex(item, to_object)
2306
+ for item in t.t_contents(getv(from_object, ['contents']))
2411
2307
  ],
2412
2308
  )
2413
2309
 
@@ -2424,7 +2320,6 @@ def _GenerateContentParameters_to_vertex(
2424
2320
 
2425
2321
 
2426
2322
  def _EmbedContentConfig_to_vertex(
2427
- api_client: BaseApiClient,
2428
2323
  from_object: Union[dict[str, Any], object],
2429
2324
  parent_object: Optional[dict[str, Any]] = None,
2430
2325
  ) -> dict[str, Any]:
@@ -2488,16 +2383,13 @@ def _EmbedContentParameters_to_vertex(
2488
2383
  setv(
2489
2384
  to_object,
2490
2385
  ['config'],
2491
- _EmbedContentConfig_to_vertex(
2492
- api_client, getv(from_object, ['config']), to_object
2493
- ),
2386
+ _EmbedContentConfig_to_vertex(getv(from_object, ['config']), to_object),
2494
2387
  )
2495
2388
 
2496
2389
  return to_object
2497
2390
 
2498
2391
 
2499
2392
  def _GenerateImagesConfig_to_vertex(
2500
- api_client: BaseApiClient,
2501
2393
  from_object: Union[dict[str, Any], object],
2502
2394
  parent_object: Optional[dict[str, Any]] = None,
2503
2395
  ) -> dict[str, Any]:
@@ -2628,7 +2520,7 @@ def _GenerateImagesParameters_to_vertex(
2628
2520
  to_object,
2629
2521
  ['config'],
2630
2522
  _GenerateImagesConfig_to_vertex(
2631
- api_client, getv(from_object, ['config']), to_object
2523
+ getv(from_object, ['config']), to_object
2632
2524
  ),
2633
2525
  )
2634
2526
 
@@ -2636,7 +2528,6 @@ def _GenerateImagesParameters_to_vertex(
2636
2528
 
2637
2529
 
2638
2530
  def _Image_to_vertex(
2639
- api_client: BaseApiClient,
2640
2531
  from_object: Union[dict[str, Any], object],
2641
2532
  parent_object: Optional[dict[str, Any]] = None,
2642
2533
  ) -> dict[str, Any]:
@@ -2648,7 +2539,7 @@ def _Image_to_vertex(
2648
2539
  setv(
2649
2540
  to_object,
2650
2541
  ['bytesBase64Encoded'],
2651
- t.t_bytes(api_client, getv(from_object, ['image_bytes'])),
2542
+ t.t_bytes(getv(from_object, ['image_bytes'])),
2652
2543
  )
2653
2544
 
2654
2545
  if getv(from_object, ['mime_type']) is not None:
@@ -2658,7 +2549,6 @@ def _Image_to_vertex(
2658
2549
 
2659
2550
 
2660
2551
  def _MaskReferenceConfig_to_vertex(
2661
- api_client: BaseApiClient,
2662
2552
  from_object: Union[dict[str, Any], object],
2663
2553
  parent_object: Optional[dict[str, Any]] = None,
2664
2554
  ) -> dict[str, Any]:
@@ -2678,7 +2568,6 @@ def _MaskReferenceConfig_to_vertex(
2678
2568
 
2679
2569
 
2680
2570
  def _ControlReferenceConfig_to_vertex(
2681
- api_client: BaseApiClient,
2682
2571
  from_object: Union[dict[str, Any], object],
2683
2572
  parent_object: Optional[dict[str, Any]] = None,
2684
2573
  ) -> dict[str, Any]:
@@ -2697,7 +2586,6 @@ def _ControlReferenceConfig_to_vertex(
2697
2586
 
2698
2587
 
2699
2588
  def _StyleReferenceConfig_to_vertex(
2700
- api_client: BaseApiClient,
2701
2589
  from_object: Union[dict[str, Any], object],
2702
2590
  parent_object: Optional[dict[str, Any]] = None,
2703
2591
  ) -> dict[str, Any]:
@@ -2713,7 +2601,6 @@ def _StyleReferenceConfig_to_vertex(
2713
2601
 
2714
2602
 
2715
2603
  def _SubjectReferenceConfig_to_vertex(
2716
- api_client: BaseApiClient,
2717
2604
  from_object: Union[dict[str, Any], object],
2718
2605
  parent_object: Optional[dict[str, Any]] = None,
2719
2606
  ) -> dict[str, Any]:
@@ -2732,7 +2619,6 @@ def _SubjectReferenceConfig_to_vertex(
2732
2619
 
2733
2620
 
2734
2621
  def _ReferenceImageAPI_to_vertex(
2735
- api_client: BaseApiClient,
2736
2622
  from_object: Union[dict[str, Any], object],
2737
2623
  parent_object: Optional[dict[str, Any]] = None,
2738
2624
  ) -> dict[str, Any]:
@@ -2741,9 +2627,7 @@ def _ReferenceImageAPI_to_vertex(
2741
2627
  setv(
2742
2628
  to_object,
2743
2629
  ['referenceImage'],
2744
- _Image_to_vertex(
2745
- api_client, getv(from_object, ['reference_image']), to_object
2746
- ),
2630
+ _Image_to_vertex(getv(from_object, ['reference_image']), to_object),
2747
2631
  )
2748
2632
 
2749
2633
  if getv(from_object, ['reference_id']) is not None:
@@ -2757,7 +2641,7 @@ def _ReferenceImageAPI_to_vertex(
2757
2641
  to_object,
2758
2642
  ['maskImageConfig'],
2759
2643
  _MaskReferenceConfig_to_vertex(
2760
- api_client, getv(from_object, ['mask_image_config']), to_object
2644
+ getv(from_object, ['mask_image_config']), to_object
2761
2645
  ),
2762
2646
  )
2763
2647
 
@@ -2766,7 +2650,7 @@ def _ReferenceImageAPI_to_vertex(
2766
2650
  to_object,
2767
2651
  ['controlImageConfig'],
2768
2652
  _ControlReferenceConfig_to_vertex(
2769
- api_client, getv(from_object, ['control_image_config']), to_object
2653
+ getv(from_object, ['control_image_config']), to_object
2770
2654
  ),
2771
2655
  )
2772
2656
 
@@ -2775,7 +2659,7 @@ def _ReferenceImageAPI_to_vertex(
2775
2659
  to_object,
2776
2660
  ['styleImageConfig'],
2777
2661
  _StyleReferenceConfig_to_vertex(
2778
- api_client, getv(from_object, ['style_image_config']), to_object
2662
+ getv(from_object, ['style_image_config']), to_object
2779
2663
  ),
2780
2664
  )
2781
2665
 
@@ -2784,7 +2668,7 @@ def _ReferenceImageAPI_to_vertex(
2784
2668
  to_object,
2785
2669
  ['subjectImageConfig'],
2786
2670
  _SubjectReferenceConfig_to_vertex(
2787
- api_client, getv(from_object, ['subject_image_config']), to_object
2671
+ getv(from_object, ['subject_image_config']), to_object
2788
2672
  ),
2789
2673
  )
2790
2674
 
@@ -2792,7 +2676,6 @@ def _ReferenceImageAPI_to_vertex(
2792
2676
 
2793
2677
 
2794
2678
  def _EditImageConfig_to_vertex(
2795
- api_client: BaseApiClient,
2796
2679
  from_object: Union[dict[str, Any], object],
2797
2680
  parent_object: Optional[dict[str, Any]] = None,
2798
2681
  ) -> dict[str, Any]:
@@ -2923,7 +2806,7 @@ def _EditImageParameters_to_vertex(
2923
2806
  to_object,
2924
2807
  ['instances[0]', 'referenceImages'],
2925
2808
  [
2926
- _ReferenceImageAPI_to_vertex(api_client, item, to_object)
2809
+ _ReferenceImageAPI_to_vertex(item, to_object)
2927
2810
  for item in getv(from_object, ['reference_images'])
2928
2811
  ],
2929
2812
  )
@@ -2932,16 +2815,13 @@ def _EditImageParameters_to_vertex(
2932
2815
  setv(
2933
2816
  to_object,
2934
2817
  ['config'],
2935
- _EditImageConfig_to_vertex(
2936
- api_client, getv(from_object, ['config']), to_object
2937
- ),
2818
+ _EditImageConfig_to_vertex(getv(from_object, ['config']), to_object),
2938
2819
  )
2939
2820
 
2940
2821
  return to_object
2941
2822
 
2942
2823
 
2943
2824
  def _UpscaleImageAPIConfig_to_vertex(
2944
- api_client: BaseApiClient,
2945
2825
  from_object: Union[dict[str, Any], object],
2946
2826
  parent_object: Optional[dict[str, Any]] = None,
2947
2827
  ) -> dict[str, Any]:
@@ -2998,7 +2878,7 @@ def _UpscaleImageAPIParameters_to_vertex(
2998
2878
  setv(
2999
2879
  to_object,
3000
2880
  ['instances[0]', 'image'],
3001
- _Image_to_vertex(api_client, getv(from_object, ['image']), to_object),
2881
+ _Image_to_vertex(getv(from_object, ['image']), to_object),
3002
2882
  )
3003
2883
 
3004
2884
  if getv(from_object, ['upscale_factor']) is not None:
@@ -3013,7 +2893,7 @@ def _UpscaleImageAPIParameters_to_vertex(
3013
2893
  to_object,
3014
2894
  ['config'],
3015
2895
  _UpscaleImageAPIConfig_to_vertex(
3016
- api_client, getv(from_object, ['config']), to_object
2896
+ getv(from_object, ['config']), to_object
3017
2897
  ),
3018
2898
  )
3019
2899
 
@@ -3090,7 +2970,6 @@ def _ListModelsParameters_to_vertex(
3090
2970
 
3091
2971
 
3092
2972
  def _UpdateModelConfig_to_vertex(
3093
- api_client: BaseApiClient,
3094
2973
  from_object: Union[dict[str, Any], object],
3095
2974
  parent_object: Optional[dict[str, Any]] = None,
3096
2975
  ) -> dict[str, Any]:
@@ -3129,9 +3008,7 @@ def _UpdateModelParameters_to_vertex(
3129
3008
  setv(
3130
3009
  to_object,
3131
3010
  ['config'],
3132
- _UpdateModelConfig_to_vertex(
3133
- api_client, getv(from_object, ['config']), to_object
3134
- ),
3011
+ _UpdateModelConfig_to_vertex(getv(from_object, ['config']), to_object),
3135
3012
  )
3136
3013
 
3137
3014
  return to_object
@@ -3157,7 +3034,6 @@ def _DeleteModelParameters_to_vertex(
3157
3034
 
3158
3035
 
3159
3036
  def _CountTokensConfig_to_vertex(
3160
- api_client: BaseApiClient,
3161
3037
  from_object: Union[dict[str, Any], object],
3162
3038
  parent_object: Optional[dict[str, Any]] = None,
3163
3039
  ) -> dict[str, Any]:
@@ -3168,9 +3044,7 @@ def _CountTokensConfig_to_vertex(
3168
3044
  parent_object,
3169
3045
  ['systemInstruction'],
3170
3046
  _Content_to_vertex(
3171
- api_client,
3172
- t.t_content(api_client, getv(from_object, ['system_instruction'])),
3173
- to_object,
3047
+ t.t_content(getv(from_object, ['system_instruction'])), to_object
3174
3048
  ),
3175
3049
  )
3176
3050
 
@@ -3179,7 +3053,7 @@ def _CountTokensConfig_to_vertex(
3179
3053
  parent_object,
3180
3054
  ['tools'],
3181
3055
  [
3182
- _Tool_to_vertex(api_client, item, to_object)
3056
+ _Tool_to_vertex(item, to_object)
3183
3057
  for item in getv(from_object, ['tools'])
3184
3058
  ],
3185
3059
  )
@@ -3212,10 +3086,8 @@ def _CountTokensParameters_to_vertex(
3212
3086
  to_object,
3213
3087
  ['contents'],
3214
3088
  [
3215
- _Content_to_vertex(api_client, item, to_object)
3216
- for item in t.t_contents(
3217
- api_client, getv(from_object, ['contents'])
3218
- )
3089
+ _Content_to_vertex(item, to_object)
3090
+ for item in t.t_contents(getv(from_object, ['contents']))
3219
3091
  ],
3220
3092
  )
3221
3093
 
@@ -3223,9 +3095,7 @@ def _CountTokensParameters_to_vertex(
3223
3095
  setv(
3224
3096
  to_object,
3225
3097
  ['config'],
3226
- _CountTokensConfig_to_vertex(
3227
- api_client, getv(from_object, ['config']), to_object
3228
- ),
3098
+ _CountTokensConfig_to_vertex(getv(from_object, ['config']), to_object),
3229
3099
  )
3230
3100
 
3231
3101
  return to_object
@@ -3249,10 +3119,8 @@ def _ComputeTokensParameters_to_vertex(
3249
3119
  to_object,
3250
3120
  ['contents'],
3251
3121
  [
3252
- _Content_to_vertex(api_client, item, to_object)
3253
- for item in t.t_contents(
3254
- api_client, getv(from_object, ['contents'])
3255
- )
3122
+ _Content_to_vertex(item, to_object)
3123
+ for item in t.t_contents(getv(from_object, ['contents']))
3256
3124
  ],
3257
3125
  )
3258
3126
 
@@ -3263,7 +3131,6 @@ def _ComputeTokensParameters_to_vertex(
3263
3131
 
3264
3132
 
3265
3133
  def _Video_to_vertex(
3266
- api_client: BaseApiClient,
3267
3134
  from_object: Union[dict[str, Any], object],
3268
3135
  parent_object: Optional[dict[str, Any]] = None,
3269
3136
  ) -> dict[str, Any]:
@@ -3275,7 +3142,7 @@ def _Video_to_vertex(
3275
3142
  setv(
3276
3143
  to_object,
3277
3144
  ['bytesBase64Encoded'],
3278
- t.t_bytes(api_client, getv(from_object, ['video_bytes'])),
3145
+ t.t_bytes(getv(from_object, ['video_bytes'])),
3279
3146
  )
3280
3147
 
3281
3148
  if getv(from_object, ['mime_type']) is not None:
@@ -3285,7 +3152,6 @@ def _Video_to_vertex(
3285
3152
 
3286
3153
 
3287
3154
  def _GenerateVideosConfig_to_vertex(
3288
- api_client: BaseApiClient,
3289
3155
  from_object: Union[dict[str, Any], object],
3290
3156
  parent_object: Optional[dict[str, Any]] = None,
3291
3157
  ) -> dict[str, Any]:
@@ -3371,9 +3237,7 @@ def _GenerateVideosConfig_to_vertex(
3371
3237
  setv(
3372
3238
  parent_object,
3373
3239
  ['instances[0]', 'lastFrame'],
3374
- _Image_to_vertex(
3375
- api_client, getv(from_object, ['last_frame']), to_object
3376
- ),
3240
+ _Image_to_vertex(getv(from_object, ['last_frame']), to_object),
3377
3241
  )
3378
3242
 
3379
3243
  return to_object
@@ -3399,14 +3263,14 @@ def _GenerateVideosParameters_to_vertex(
3399
3263
  setv(
3400
3264
  to_object,
3401
3265
  ['instances[0]', 'image'],
3402
- _Image_to_vertex(api_client, getv(from_object, ['image']), to_object),
3266
+ _Image_to_vertex(getv(from_object, ['image']), to_object),
3403
3267
  )
3404
3268
 
3405
3269
  if getv(from_object, ['video']) is not None:
3406
3270
  setv(
3407
3271
  to_object,
3408
3272
  ['instances[0]', 'video'],
3409
- _Video_to_vertex(api_client, getv(from_object, ['video']), to_object),
3273
+ _Video_to_vertex(getv(from_object, ['video']), to_object),
3410
3274
  )
3411
3275
 
3412
3276
  if getv(from_object, ['config']) is not None:
@@ -3414,7 +3278,7 @@ def _GenerateVideosParameters_to_vertex(
3414
3278
  to_object,
3415
3279
  ['config'],
3416
3280
  _GenerateVideosConfig_to_vertex(
3417
- api_client, getv(from_object, ['config']), to_object
3281
+ getv(from_object, ['config']), to_object
3418
3282
  ),
3419
3283
  )
3420
3284
 
@@ -3422,12 +3286,14 @@ def _GenerateVideosParameters_to_vertex(
3422
3286
 
3423
3287
 
3424
3288
  def _FeatureSelectionPreference_to_mldev_enum_validate(enum_value: Any) -> None:
3425
- if enum_value in set([
3426
- 'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED',
3427
- 'PRIORITIZE_QUALITY',
3428
- 'BALANCED',
3429
- 'PRIORITIZE_COST',
3430
- ]):
3289
+ if enum_value in set(
3290
+ [
3291
+ 'FEATURE_SELECTION_PREFERENCE_UNSPECIFIED',
3292
+ 'PRIORITIZE_QUALITY',
3293
+ 'BALANCED',
3294
+ 'PRIORITIZE_COST',
3295
+ ]
3296
+ ):
3431
3297
  raise ValueError(f'{enum_value} enum value is not supported in Gemini API.')
3432
3298
 
3433
3299
 
@@ -3447,7 +3313,6 @@ def _Behavior_to_vertex_enum_validate(enum_value: Any) -> None:
3447
3313
 
3448
3314
 
3449
3315
  def _VideoMetadata_from_mldev(
3450
- api_client: BaseApiClient,
3451
3316
  from_object: Union[dict[str, Any], object],
3452
3317
  parent_object: Optional[dict[str, Any]] = None,
3453
3318
  ) -> dict[str, Any]:
@@ -3465,7 +3330,6 @@ def _VideoMetadata_from_mldev(
3465
3330
 
3466
3331
 
3467
3332
  def _Blob_from_mldev(
3468
- api_client: BaseApiClient,
3469
3333
  from_object: Union[dict[str, Any], object],
3470
3334
  parent_object: Optional[dict[str, Any]] = None,
3471
3335
  ) -> dict[str, Any]:
@@ -3481,7 +3345,6 @@ def _Blob_from_mldev(
3481
3345
 
3482
3346
 
3483
3347
  def _FileData_from_mldev(
3484
- api_client: BaseApiClient,
3485
3348
  from_object: Union[dict[str, Any], object],
3486
3349
  parent_object: Optional[dict[str, Any]] = None,
3487
3350
  ) -> dict[str, Any]:
@@ -3497,7 +3360,6 @@ def _FileData_from_mldev(
3497
3360
 
3498
3361
 
3499
3362
  def _Part_from_mldev(
3500
- api_client: BaseApiClient,
3501
3363
  from_object: Union[dict[str, Any], object],
3502
3364
  parent_object: Optional[dict[str, Any]] = None,
3503
3365
  ) -> dict[str, Any]:
@@ -3507,7 +3369,7 @@ def _Part_from_mldev(
3507
3369
  to_object,
3508
3370
  ['video_metadata'],
3509
3371
  _VideoMetadata_from_mldev(
3510
- api_client, getv(from_object, ['videoMetadata']), to_object
3372
+ getv(from_object, ['videoMetadata']), to_object
3511
3373
  ),
3512
3374
  )
3513
3375
 
@@ -3518,18 +3380,14 @@ def _Part_from_mldev(
3518
3380
  setv(
3519
3381
  to_object,
3520
3382
  ['inline_data'],
3521
- _Blob_from_mldev(
3522
- api_client, getv(from_object, ['inlineData']), to_object
3523
- ),
3383
+ _Blob_from_mldev(getv(from_object, ['inlineData']), to_object),
3524
3384
  )
3525
3385
 
3526
3386
  if getv(from_object, ['fileData']) is not None:
3527
3387
  setv(
3528
3388
  to_object,
3529
3389
  ['file_data'],
3530
- _FileData_from_mldev(
3531
- api_client, getv(from_object, ['fileData']), to_object
3532
- ),
3390
+ _FileData_from_mldev(getv(from_object, ['fileData']), to_object),
3533
3391
  )
3534
3392
 
3535
3393
  if getv(from_object, ['thoughtSignature']) is not None:
@@ -3566,7 +3424,6 @@ def _Part_from_mldev(
3566
3424
 
3567
3425
 
3568
3426
  def _Content_from_mldev(
3569
- api_client: BaseApiClient,
3570
3427
  from_object: Union[dict[str, Any], object],
3571
3428
  parent_object: Optional[dict[str, Any]] = None,
3572
3429
  ) -> dict[str, Any]:
@@ -3576,7 +3433,7 @@ def _Content_from_mldev(
3576
3433
  to_object,
3577
3434
  ['parts'],
3578
3435
  [
3579
- _Part_from_mldev(api_client, item, to_object)
3436
+ _Part_from_mldev(item, to_object)
3580
3437
  for item in getv(from_object, ['parts'])
3581
3438
  ],
3582
3439
  )
@@ -3588,7 +3445,6 @@ def _Content_from_mldev(
3588
3445
 
3589
3446
 
3590
3447
  def _CitationMetadata_from_mldev(
3591
- api_client: BaseApiClient,
3592
3448
  from_object: Union[dict[str, Any], object],
3593
3449
  parent_object: Optional[dict[str, Any]] = None,
3594
3450
  ) -> dict[str, Any]:
@@ -3600,7 +3456,6 @@ def _CitationMetadata_from_mldev(
3600
3456
 
3601
3457
 
3602
3458
  def _UrlMetadata_from_mldev(
3603
- api_client: BaseApiClient,
3604
3459
  from_object: Union[dict[str, Any], object],
3605
3460
  parent_object: Optional[dict[str, Any]] = None,
3606
3461
  ) -> dict[str, Any]:
@@ -3619,7 +3474,6 @@ def _UrlMetadata_from_mldev(
3619
3474
 
3620
3475
 
3621
3476
  def _UrlContextMetadata_from_mldev(
3622
- api_client: BaseApiClient,
3623
3477
  from_object: Union[dict[str, Any], object],
3624
3478
  parent_object: Optional[dict[str, Any]] = None,
3625
3479
  ) -> dict[str, Any]:
@@ -3629,7 +3483,7 @@ def _UrlContextMetadata_from_mldev(
3629
3483
  to_object,
3630
3484
  ['url_metadata'],
3631
3485
  [
3632
- _UrlMetadata_from_mldev(api_client, item, to_object)
3486
+ _UrlMetadata_from_mldev(item, to_object)
3633
3487
  for item in getv(from_object, ['urlMetadata'])
3634
3488
  ],
3635
3489
  )
@@ -3638,7 +3492,6 @@ def _UrlContextMetadata_from_mldev(
3638
3492
 
3639
3493
 
3640
3494
  def _Candidate_from_mldev(
3641
- api_client: BaseApiClient,
3642
3495
  from_object: Union[dict[str, Any], object],
3643
3496
  parent_object: Optional[dict[str, Any]] = None,
3644
3497
  ) -> dict[str, Any]:
@@ -3647,9 +3500,7 @@ def _Candidate_from_mldev(
3647
3500
  setv(
3648
3501
  to_object,
3649
3502
  ['content'],
3650
- _Content_from_mldev(
3651
- api_client, getv(from_object, ['content']), to_object
3652
- ),
3503
+ _Content_from_mldev(getv(from_object, ['content']), to_object),
3653
3504
  )
3654
3505
 
3655
3506
  if getv(from_object, ['citationMetadata']) is not None:
@@ -3657,7 +3508,7 @@ def _Candidate_from_mldev(
3657
3508
  to_object,
3658
3509
  ['citation_metadata'],
3659
3510
  _CitationMetadata_from_mldev(
3660
- api_client, getv(from_object, ['citationMetadata']), to_object
3511
+ getv(from_object, ['citationMetadata']), to_object
3661
3512
  ),
3662
3513
  )
3663
3514
 
@@ -3672,7 +3523,7 @@ def _Candidate_from_mldev(
3672
3523
  to_object,
3673
3524
  ['url_context_metadata'],
3674
3525
  _UrlContextMetadata_from_mldev(
3675
- api_client, getv(from_object, ['urlContextMetadata']), to_object
3526
+ getv(from_object, ['urlContextMetadata']), to_object
3676
3527
  ),
3677
3528
  )
3678
3529
 
@@ -3699,7 +3550,6 @@ def _Candidate_from_mldev(
3699
3550
 
3700
3551
 
3701
3552
  def _GenerateContentResponse_from_mldev(
3702
- api_client: BaseApiClient,
3703
3553
  from_object: Union[dict[str, Any], object],
3704
3554
  parent_object: Optional[dict[str, Any]] = None,
3705
3555
  ) -> dict[str, Any]:
@@ -3709,7 +3559,7 @@ def _GenerateContentResponse_from_mldev(
3709
3559
  to_object,
3710
3560
  ['candidates'],
3711
3561
  [
3712
- _Candidate_from_mldev(api_client, item, to_object)
3562
+ _Candidate_from_mldev(item, to_object)
3713
3563
  for item in getv(from_object, ['candidates'])
3714
3564
  ],
3715
3565
  )
@@ -3727,7 +3577,6 @@ def _GenerateContentResponse_from_mldev(
3727
3577
 
3728
3578
 
3729
3579
  def _ContentEmbeddingStatistics_from_mldev(
3730
- api_client: BaseApiClient,
3731
3580
  from_object: Union[dict[str, Any], object],
3732
3581
  parent_object: Optional[dict[str, Any]] = None,
3733
3582
  ) -> dict[str, Any]:
@@ -3737,7 +3586,6 @@ def _ContentEmbeddingStatistics_from_mldev(
3737
3586
 
3738
3587
 
3739
3588
  def _ContentEmbedding_from_mldev(
3740
- api_client: BaseApiClient,
3741
3589
  from_object: Union[dict[str, Any], object],
3742
3590
  parent_object: Optional[dict[str, Any]] = None,
3743
3591
  ) -> dict[str, Any]:
@@ -3749,7 +3597,6 @@ def _ContentEmbedding_from_mldev(
3749
3597
 
3750
3598
 
3751
3599
  def _EmbedContentMetadata_from_mldev(
3752
- api_client: BaseApiClient,
3753
3600
  from_object: Union[dict[str, Any], object],
3754
3601
  parent_object: Optional[dict[str, Any]] = None,
3755
3602
  ) -> dict[str, Any]:
@@ -3759,7 +3606,6 @@ def _EmbedContentMetadata_from_mldev(
3759
3606
 
3760
3607
 
3761
3608
  def _EmbedContentResponse_from_mldev(
3762
- api_client: BaseApiClient,
3763
3609
  from_object: Union[dict[str, Any], object],
3764
3610
  parent_object: Optional[dict[str, Any]] = None,
3765
3611
  ) -> dict[str, Any]:
@@ -3769,7 +3615,7 @@ def _EmbedContentResponse_from_mldev(
3769
3615
  to_object,
3770
3616
  ['embeddings'],
3771
3617
  [
3772
- _ContentEmbedding_from_mldev(api_client, item, to_object)
3618
+ _ContentEmbedding_from_mldev(item, to_object)
3773
3619
  for item in getv(from_object, ['embeddings'])
3774
3620
  ],
3775
3621
  )
@@ -3779,7 +3625,7 @@ def _EmbedContentResponse_from_mldev(
3779
3625
  to_object,
3780
3626
  ['metadata'],
3781
3627
  _EmbedContentMetadata_from_mldev(
3782
- api_client, getv(from_object, ['metadata']), to_object
3628
+ getv(from_object, ['metadata']), to_object
3783
3629
  ),
3784
3630
  )
3785
3631
 
@@ -3787,7 +3633,6 @@ def _EmbedContentResponse_from_mldev(
3787
3633
 
3788
3634
 
3789
3635
  def _Image_from_mldev(
3790
- api_client: BaseApiClient,
3791
3636
  from_object: Union[dict[str, Any], object],
3792
3637
  parent_object: Optional[dict[str, Any]] = None,
3793
3638
  ) -> dict[str, Any]:
@@ -3797,7 +3642,7 @@ def _Image_from_mldev(
3797
3642
  setv(
3798
3643
  to_object,
3799
3644
  ['image_bytes'],
3800
- t.t_bytes(api_client, getv(from_object, ['bytesBase64Encoded'])),
3645
+ t.t_bytes(getv(from_object, ['bytesBase64Encoded'])),
3801
3646
  )
3802
3647
 
3803
3648
  if getv(from_object, ['mimeType']) is not None:
@@ -3807,7 +3652,6 @@ def _Image_from_mldev(
3807
3652
 
3808
3653
 
3809
3654
  def _SafetyAttributes_from_mldev(
3810
- api_client: BaseApiClient,
3811
3655
  from_object: Union[dict[str, Any], object],
3812
3656
  parent_object: Optional[dict[str, Any]] = None,
3813
3657
  ) -> dict[str, Any]:
@@ -3831,7 +3675,6 @@ def _SafetyAttributes_from_mldev(
3831
3675
 
3832
3676
 
3833
3677
  def _GeneratedImage_from_mldev(
3834
- api_client: BaseApiClient,
3835
3678
  from_object: Union[dict[str, Any], object],
3836
3679
  parent_object: Optional[dict[str, Any]] = None,
3837
3680
  ) -> dict[str, Any]:
@@ -3840,7 +3683,7 @@ def _GeneratedImage_from_mldev(
3840
3683
  setv(
3841
3684
  to_object,
3842
3685
  ['image'],
3843
- _Image_from_mldev(api_client, getv(from_object, ['_self']), to_object),
3686
+ _Image_from_mldev(getv(from_object, ['_self']), to_object),
3844
3687
  )
3845
3688
 
3846
3689
  if getv(from_object, ['raiFilteredReason']) is not None:
@@ -3854,16 +3697,13 @@ def _GeneratedImage_from_mldev(
3854
3697
  setv(
3855
3698
  to_object,
3856
3699
  ['safety_attributes'],
3857
- _SafetyAttributes_from_mldev(
3858
- api_client, getv(from_object, ['_self']), to_object
3859
- ),
3700
+ _SafetyAttributes_from_mldev(getv(from_object, ['_self']), to_object),
3860
3701
  )
3861
3702
 
3862
3703
  return to_object
3863
3704
 
3864
3705
 
3865
3706
  def _GenerateImagesResponse_from_mldev(
3866
- api_client: BaseApiClient,
3867
3707
  from_object: Union[dict[str, Any], object],
3868
3708
  parent_object: Optional[dict[str, Any]] = None,
3869
3709
  ) -> dict[str, Any]:
@@ -3873,7 +3713,7 @@ def _GenerateImagesResponse_from_mldev(
3873
3713
  to_object,
3874
3714
  ['generated_images'],
3875
3715
  [
3876
- _GeneratedImage_from_mldev(api_client, item, to_object)
3716
+ _GeneratedImage_from_mldev(item, to_object)
3877
3717
  for item in getv(from_object, ['predictions'])
3878
3718
  ],
3879
3719
  )
@@ -3883,9 +3723,7 @@ def _GenerateImagesResponse_from_mldev(
3883
3723
  to_object,
3884
3724
  ['positive_prompt_safety_attributes'],
3885
3725
  _SafetyAttributes_from_mldev(
3886
- api_client,
3887
- getv(from_object, ['positivePromptSafetyAttributes']),
3888
- to_object,
3726
+ getv(from_object, ['positivePromptSafetyAttributes']), to_object
3889
3727
  ),
3890
3728
  )
3891
3729
 
@@ -3893,7 +3731,6 @@ def _GenerateImagesResponse_from_mldev(
3893
3731
 
3894
3732
 
3895
3733
  def _Endpoint_from_mldev(
3896
- api_client: BaseApiClient,
3897
3734
  from_object: Union[dict[str, Any], object],
3898
3735
  parent_object: Optional[dict[str, Any]] = None,
3899
3736
  ) -> dict[str, Any]:
@@ -3903,7 +3740,6 @@ def _Endpoint_from_mldev(
3903
3740
 
3904
3741
 
3905
3742
  def _TunedModelInfo_from_mldev(
3906
- api_client: BaseApiClient,
3907
3743
  from_object: Union[dict[str, Any], object],
3908
3744
  parent_object: Optional[dict[str, Any]] = None,
3909
3745
  ) -> dict[str, Any]:
@@ -3921,7 +3757,6 @@ def _TunedModelInfo_from_mldev(
3921
3757
 
3922
3758
 
3923
3759
  def _Checkpoint_from_mldev(
3924
- api_client: BaseApiClient,
3925
3760
  from_object: Union[dict[str, Any], object],
3926
3761
  parent_object: Optional[dict[str, Any]] = None,
3927
3762
  ) -> dict[str, Any]:
@@ -3931,7 +3766,6 @@ def _Checkpoint_from_mldev(
3931
3766
 
3932
3767
 
3933
3768
  def _Model_from_mldev(
3934
- api_client: BaseApiClient,
3935
3769
  from_object: Union[dict[str, Any], object],
3936
3770
  parent_object: Optional[dict[str, Any]] = None,
3937
3771
  ) -> dict[str, Any]:
@@ -3952,9 +3786,7 @@ def _Model_from_mldev(
3952
3786
  setv(
3953
3787
  to_object,
3954
3788
  ['tuned_model_info'],
3955
- _TunedModelInfo_from_mldev(
3956
- api_client, getv(from_object, ['_self']), to_object
3957
- ),
3789
+ _TunedModelInfo_from_mldev(getv(from_object, ['_self']), to_object),
3958
3790
  )
3959
3791
 
3960
3792
  if getv(from_object, ['inputTokenLimit']) is not None:
@@ -3980,7 +3812,6 @@ def _Model_from_mldev(
3980
3812
 
3981
3813
 
3982
3814
  def _ListModelsResponse_from_mldev(
3983
- api_client: BaseApiClient,
3984
3815
  from_object: Union[dict[str, Any], object],
3985
3816
  parent_object: Optional[dict[str, Any]] = None,
3986
3817
  ) -> dict[str, Any]:
@@ -3993,10 +3824,8 @@ def _ListModelsResponse_from_mldev(
3993
3824
  to_object,
3994
3825
  ['models'],
3995
3826
  [
3996
- _Model_from_mldev(api_client, item, to_object)
3997
- for item in t.t_extract_models(
3998
- api_client, getv(from_object, ['_self'])
3999
- )
3827
+ _Model_from_mldev(item, to_object)
3828
+ for item in t.t_extract_models(getv(from_object, ['_self']))
4000
3829
  ],
4001
3830
  )
4002
3831
 
@@ -4004,7 +3833,6 @@ def _ListModelsResponse_from_mldev(
4004
3833
 
4005
3834
 
4006
3835
  def _DeleteModelResponse_from_mldev(
4007
- api_client: BaseApiClient,
4008
3836
  from_object: Union[dict[str, Any], object],
4009
3837
  parent_object: Optional[dict[str, Any]] = None,
4010
3838
  ) -> dict[str, Any]:
@@ -4014,7 +3842,6 @@ def _DeleteModelResponse_from_mldev(
4014
3842
 
4015
3843
 
4016
3844
  def _CountTokensResponse_from_mldev(
4017
- api_client: BaseApiClient,
4018
3845
  from_object: Union[dict[str, Any], object],
4019
3846
  parent_object: Optional[dict[str, Any]] = None,
4020
3847
  ) -> dict[str, Any]:
@@ -4033,7 +3860,6 @@ def _CountTokensResponse_from_mldev(
4033
3860
 
4034
3861
 
4035
3862
  def _Video_from_mldev(
4036
- api_client: BaseApiClient,
4037
3863
  from_object: Union[dict[str, Any], object],
4038
3864
  parent_object: Optional[dict[str, Any]] = None,
4039
3865
  ) -> dict[str, Any]:
@@ -4045,7 +3871,7 @@ def _Video_from_mldev(
4045
3871
  setv(
4046
3872
  to_object,
4047
3873
  ['video_bytes'],
4048
- t.t_bytes(api_client, getv(from_object, ['video', 'encodedVideo'])),
3874
+ t.t_bytes(getv(from_object, ['video', 'encodedVideo'])),
4049
3875
  )
4050
3876
 
4051
3877
  if getv(from_object, ['encoding']) is not None:
@@ -4055,7 +3881,6 @@ def _Video_from_mldev(
4055
3881
 
4056
3882
 
4057
3883
  def _GeneratedVideo_from_mldev(
4058
- api_client: BaseApiClient,
4059
3884
  from_object: Union[dict[str, Any], object],
4060
3885
  parent_object: Optional[dict[str, Any]] = None,
4061
3886
  ) -> dict[str, Any]:
@@ -4064,14 +3889,13 @@ def _GeneratedVideo_from_mldev(
4064
3889
  setv(
4065
3890
  to_object,
4066
3891
  ['video'],
4067
- _Video_from_mldev(api_client, getv(from_object, ['_self']), to_object),
3892
+ _Video_from_mldev(getv(from_object, ['_self']), to_object),
4068
3893
  )
4069
3894
 
4070
3895
  return to_object
4071
3896
 
4072
3897
 
4073
3898
  def _GenerateVideosResponse_from_mldev(
4074
- api_client: BaseApiClient,
4075
3899
  from_object: Union[dict[str, Any], object],
4076
3900
  parent_object: Optional[dict[str, Any]] = None,
4077
3901
  ) -> dict[str, Any]:
@@ -4081,7 +3905,7 @@ def _GenerateVideosResponse_from_mldev(
4081
3905
  to_object,
4082
3906
  ['generated_videos'],
4083
3907
  [
4084
- _GeneratedVideo_from_mldev(api_client, item, to_object)
3908
+ _GeneratedVideo_from_mldev(item, to_object)
4085
3909
  for item in getv(from_object, ['generatedSamples'])
4086
3910
  ],
4087
3911
  )
@@ -4104,7 +3928,6 @@ def _GenerateVideosResponse_from_mldev(
4104
3928
 
4105
3929
 
4106
3930
  def _GenerateVideosOperation_from_mldev(
4107
- api_client: BaseApiClient,
4108
3931
  from_object: Union[dict[str, Any], object],
4109
3932
  parent_object: Optional[dict[str, Any]] = None,
4110
3933
  ) -> dict[str, Any]:
@@ -4126,9 +3949,7 @@ def _GenerateVideosOperation_from_mldev(
4126
3949
  to_object,
4127
3950
  ['response'],
4128
3951
  _GenerateVideosResponse_from_mldev(
4129
- api_client,
4130
- getv(from_object, ['response', 'generateVideoResponse']),
4131
- to_object,
3952
+ getv(from_object, ['response', 'generateVideoResponse']), to_object
4132
3953
  ),
4133
3954
  )
4134
3955
 
@@ -4137,9 +3958,7 @@ def _GenerateVideosOperation_from_mldev(
4137
3958
  to_object,
4138
3959
  ['result'],
4139
3960
  _GenerateVideosResponse_from_mldev(
4140
- api_client,
4141
- getv(from_object, ['response', 'generateVideoResponse']),
4142
- to_object,
3961
+ getv(from_object, ['response', 'generateVideoResponse']), to_object
4143
3962
  ),
4144
3963
  )
4145
3964
 
@@ -4147,7 +3966,6 @@ def _GenerateVideosOperation_from_mldev(
4147
3966
 
4148
3967
 
4149
3968
  def _VideoMetadata_from_vertex(
4150
- api_client: BaseApiClient,
4151
3969
  from_object: Union[dict[str, Any], object],
4152
3970
  parent_object: Optional[dict[str, Any]] = None,
4153
3971
  ) -> dict[str, Any]:
@@ -4165,7 +3983,6 @@ def _VideoMetadata_from_vertex(
4165
3983
 
4166
3984
 
4167
3985
  def _Blob_from_vertex(
4168
- api_client: BaseApiClient,
4169
3986
  from_object: Union[dict[str, Any], object],
4170
3987
  parent_object: Optional[dict[str, Any]] = None,
4171
3988
  ) -> dict[str, Any]:
@@ -4183,7 +4000,6 @@ def _Blob_from_vertex(
4183
4000
 
4184
4001
 
4185
4002
  def _FileData_from_vertex(
4186
- api_client: BaseApiClient,
4187
4003
  from_object: Union[dict[str, Any], object],
4188
4004
  parent_object: Optional[dict[str, Any]] = None,
4189
4005
  ) -> dict[str, Any]:
@@ -4201,7 +4017,6 @@ def _FileData_from_vertex(
4201
4017
 
4202
4018
 
4203
4019
  def _Part_from_vertex(
4204
- api_client: BaseApiClient,
4205
4020
  from_object: Union[dict[str, Any], object],
4206
4021
  parent_object: Optional[dict[str, Any]] = None,
4207
4022
  ) -> dict[str, Any]:
@@ -4211,7 +4026,7 @@ def _Part_from_vertex(
4211
4026
  to_object,
4212
4027
  ['video_metadata'],
4213
4028
  _VideoMetadata_from_vertex(
4214
- api_client, getv(from_object, ['videoMetadata']), to_object
4029
+ getv(from_object, ['videoMetadata']), to_object
4215
4030
  ),
4216
4031
  )
4217
4032
 
@@ -4222,18 +4037,14 @@ def _Part_from_vertex(
4222
4037
  setv(
4223
4038
  to_object,
4224
4039
  ['inline_data'],
4225
- _Blob_from_vertex(
4226
- api_client, getv(from_object, ['inlineData']), to_object
4227
- ),
4040
+ _Blob_from_vertex(getv(from_object, ['inlineData']), to_object),
4228
4041
  )
4229
4042
 
4230
4043
  if getv(from_object, ['fileData']) is not None:
4231
4044
  setv(
4232
4045
  to_object,
4233
4046
  ['file_data'],
4234
- _FileData_from_vertex(
4235
- api_client, getv(from_object, ['fileData']), to_object
4236
- ),
4047
+ _FileData_from_vertex(getv(from_object, ['fileData']), to_object),
4237
4048
  )
4238
4049
 
4239
4050
  if getv(from_object, ['thoughtSignature']) is not None:
@@ -4270,7 +4081,6 @@ def _Part_from_vertex(
4270
4081
 
4271
4082
 
4272
4083
  def _Content_from_vertex(
4273
- api_client: BaseApiClient,
4274
4084
  from_object: Union[dict[str, Any], object],
4275
4085
  parent_object: Optional[dict[str, Any]] = None,
4276
4086
  ) -> dict[str, Any]:
@@ -4280,7 +4090,7 @@ def _Content_from_vertex(
4280
4090
  to_object,
4281
4091
  ['parts'],
4282
4092
  [
4283
- _Part_from_vertex(api_client, item, to_object)
4093
+ _Part_from_vertex(item, to_object)
4284
4094
  for item in getv(from_object, ['parts'])
4285
4095
  ],
4286
4096
  )
@@ -4292,7 +4102,6 @@ def _Content_from_vertex(
4292
4102
 
4293
4103
 
4294
4104
  def _CitationMetadata_from_vertex(
4295
- api_client: BaseApiClient,
4296
4105
  from_object: Union[dict[str, Any], object],
4297
4106
  parent_object: Optional[dict[str, Any]] = None,
4298
4107
  ) -> dict[str, Any]:
@@ -4304,7 +4113,6 @@ def _CitationMetadata_from_vertex(
4304
4113
 
4305
4114
 
4306
4115
  def _UrlMetadata_from_vertex(
4307
- api_client: BaseApiClient,
4308
4116
  from_object: Union[dict[str, Any], object],
4309
4117
  parent_object: Optional[dict[str, Any]] = None,
4310
4118
  ) -> dict[str, Any]:
@@ -4323,7 +4131,6 @@ def _UrlMetadata_from_vertex(
4323
4131
 
4324
4132
 
4325
4133
  def _UrlContextMetadata_from_vertex(
4326
- api_client: BaseApiClient,
4327
4134
  from_object: Union[dict[str, Any], object],
4328
4135
  parent_object: Optional[dict[str, Any]] = None,
4329
4136
  ) -> dict[str, Any]:
@@ -4333,7 +4140,7 @@ def _UrlContextMetadata_from_vertex(
4333
4140
  to_object,
4334
4141
  ['url_metadata'],
4335
4142
  [
4336
- _UrlMetadata_from_vertex(api_client, item, to_object)
4143
+ _UrlMetadata_from_vertex(item, to_object)
4337
4144
  for item in getv(from_object, ['urlMetadata'])
4338
4145
  ],
4339
4146
  )
@@ -4342,7 +4149,6 @@ def _UrlContextMetadata_from_vertex(
4342
4149
 
4343
4150
 
4344
4151
  def _Candidate_from_vertex(
4345
- api_client: BaseApiClient,
4346
4152
  from_object: Union[dict[str, Any], object],
4347
4153
  parent_object: Optional[dict[str, Any]] = None,
4348
4154
  ) -> dict[str, Any]:
@@ -4351,9 +4157,7 @@ def _Candidate_from_vertex(
4351
4157
  setv(
4352
4158
  to_object,
4353
4159
  ['content'],
4354
- _Content_from_vertex(
4355
- api_client, getv(from_object, ['content']), to_object
4356
- ),
4160
+ _Content_from_vertex(getv(from_object, ['content']), to_object),
4357
4161
  )
4358
4162
 
4359
4163
  if getv(from_object, ['citationMetadata']) is not None:
@@ -4361,7 +4165,7 @@ def _Candidate_from_vertex(
4361
4165
  to_object,
4362
4166
  ['citation_metadata'],
4363
4167
  _CitationMetadata_from_vertex(
4364
- api_client, getv(from_object, ['citationMetadata']), to_object
4168
+ getv(from_object, ['citationMetadata']), to_object
4365
4169
  ),
4366
4170
  )
4367
4171
 
@@ -4376,7 +4180,7 @@ def _Candidate_from_vertex(
4376
4180
  to_object,
4377
4181
  ['url_context_metadata'],
4378
4182
  _UrlContextMetadata_from_vertex(
4379
- api_client, getv(from_object, ['urlContextMetadata']), to_object
4183
+ getv(from_object, ['urlContextMetadata']), to_object
4380
4184
  ),
4381
4185
  )
4382
4186
 
@@ -4403,7 +4207,6 @@ def _Candidate_from_vertex(
4403
4207
 
4404
4208
 
4405
4209
  def _GenerateContentResponse_from_vertex(
4406
- api_client: BaseApiClient,
4407
4210
  from_object: Union[dict[str, Any], object],
4408
4211
  parent_object: Optional[dict[str, Any]] = None,
4409
4212
  ) -> dict[str, Any]:
@@ -4413,7 +4216,7 @@ def _GenerateContentResponse_from_vertex(
4413
4216
  to_object,
4414
4217
  ['candidates'],
4415
4218
  [
4416
- _Candidate_from_vertex(api_client, item, to_object)
4219
+ _Candidate_from_vertex(item, to_object)
4417
4220
  for item in getv(from_object, ['candidates'])
4418
4221
  ],
4419
4222
  )
@@ -4437,7 +4240,6 @@ def _GenerateContentResponse_from_vertex(
4437
4240
 
4438
4241
 
4439
4242
  def _ContentEmbeddingStatistics_from_vertex(
4440
- api_client: BaseApiClient,
4441
4243
  from_object: Union[dict[str, Any], object],
4442
4244
  parent_object: Optional[dict[str, Any]] = None,
4443
4245
  ) -> dict[str, Any]:
@@ -4452,7 +4254,6 @@ def _ContentEmbeddingStatistics_from_vertex(
4452
4254
 
4453
4255
 
4454
4256
  def _ContentEmbedding_from_vertex(
4455
- api_client: BaseApiClient,
4456
4257
  from_object: Union[dict[str, Any], object],
4457
4258
  parent_object: Optional[dict[str, Any]] = None,
4458
4259
  ) -> dict[str, Any]:
@@ -4465,7 +4266,7 @@ def _ContentEmbedding_from_vertex(
4465
4266
  to_object,
4466
4267
  ['statistics'],
4467
4268
  _ContentEmbeddingStatistics_from_vertex(
4468
- api_client, getv(from_object, ['statistics']), to_object
4269
+ getv(from_object, ['statistics']), to_object
4469
4270
  ),
4470
4271
  )
4471
4272
 
@@ -4473,7 +4274,6 @@ def _ContentEmbedding_from_vertex(
4473
4274
 
4474
4275
 
4475
4276
  def _EmbedContentMetadata_from_vertex(
4476
- api_client: BaseApiClient,
4477
4277
  from_object: Union[dict[str, Any], object],
4478
4278
  parent_object: Optional[dict[str, Any]] = None,
4479
4279
  ) -> dict[str, Any]:
@@ -4489,7 +4289,6 @@ def _EmbedContentMetadata_from_vertex(
4489
4289
 
4490
4290
 
4491
4291
  def _EmbedContentResponse_from_vertex(
4492
- api_client: BaseApiClient,
4493
4292
  from_object: Union[dict[str, Any], object],
4494
4293
  parent_object: Optional[dict[str, Any]] = None,
4495
4294
  ) -> dict[str, Any]:
@@ -4499,7 +4298,7 @@ def _EmbedContentResponse_from_vertex(
4499
4298
  to_object,
4500
4299
  ['embeddings'],
4501
4300
  [
4502
- _ContentEmbedding_from_vertex(api_client, item, to_object)
4301
+ _ContentEmbedding_from_vertex(item, to_object)
4503
4302
  for item in getv(from_object, ['predictions[]', 'embeddings'])
4504
4303
  ],
4505
4304
  )
@@ -4509,7 +4308,7 @@ def _EmbedContentResponse_from_vertex(
4509
4308
  to_object,
4510
4309
  ['metadata'],
4511
4310
  _EmbedContentMetadata_from_vertex(
4512
- api_client, getv(from_object, ['metadata']), to_object
4311
+ getv(from_object, ['metadata']), to_object
4513
4312
  ),
4514
4313
  )
4515
4314
 
@@ -4517,7 +4316,6 @@ def _EmbedContentResponse_from_vertex(
4517
4316
 
4518
4317
 
4519
4318
  def _Image_from_vertex(
4520
- api_client: BaseApiClient,
4521
4319
  from_object: Union[dict[str, Any], object],
4522
4320
  parent_object: Optional[dict[str, Any]] = None,
4523
4321
  ) -> dict[str, Any]:
@@ -4529,7 +4327,7 @@ def _Image_from_vertex(
4529
4327
  setv(
4530
4328
  to_object,
4531
4329
  ['image_bytes'],
4532
- t.t_bytes(api_client, getv(from_object, ['bytesBase64Encoded'])),
4330
+ t.t_bytes(getv(from_object, ['bytesBase64Encoded'])),
4533
4331
  )
4534
4332
 
4535
4333
  if getv(from_object, ['mimeType']) is not None:
@@ -4539,7 +4337,6 @@ def _Image_from_vertex(
4539
4337
 
4540
4338
 
4541
4339
  def _SafetyAttributes_from_vertex(
4542
- api_client: BaseApiClient,
4543
4340
  from_object: Union[dict[str, Any], object],
4544
4341
  parent_object: Optional[dict[str, Any]] = None,
4545
4342
  ) -> dict[str, Any]:
@@ -4563,7 +4360,6 @@ def _SafetyAttributes_from_vertex(
4563
4360
 
4564
4361
 
4565
4362
  def _GeneratedImage_from_vertex(
4566
- api_client: BaseApiClient,
4567
4363
  from_object: Union[dict[str, Any], object],
4568
4364
  parent_object: Optional[dict[str, Any]] = None,
4569
4365
  ) -> dict[str, Any]:
@@ -4572,7 +4368,7 @@ def _GeneratedImage_from_vertex(
4572
4368
  setv(
4573
4369
  to_object,
4574
4370
  ['image'],
4575
- _Image_from_vertex(api_client, getv(from_object, ['_self']), to_object),
4371
+ _Image_from_vertex(getv(from_object, ['_self']), to_object),
4576
4372
  )
4577
4373
 
4578
4374
  if getv(from_object, ['raiFilteredReason']) is not None:
@@ -4586,9 +4382,7 @@ def _GeneratedImage_from_vertex(
4586
4382
  setv(
4587
4383
  to_object,
4588
4384
  ['safety_attributes'],
4589
- _SafetyAttributes_from_vertex(
4590
- api_client, getv(from_object, ['_self']), to_object
4591
- ),
4385
+ _SafetyAttributes_from_vertex(getv(from_object, ['_self']), to_object),
4592
4386
  )
4593
4387
 
4594
4388
  if getv(from_object, ['prompt']) is not None:
@@ -4598,7 +4392,6 @@ def _GeneratedImage_from_vertex(
4598
4392
 
4599
4393
 
4600
4394
  def _GenerateImagesResponse_from_vertex(
4601
- api_client: BaseApiClient,
4602
4395
  from_object: Union[dict[str, Any], object],
4603
4396
  parent_object: Optional[dict[str, Any]] = None,
4604
4397
  ) -> dict[str, Any]:
@@ -4608,7 +4401,7 @@ def _GenerateImagesResponse_from_vertex(
4608
4401
  to_object,
4609
4402
  ['generated_images'],
4610
4403
  [
4611
- _GeneratedImage_from_vertex(api_client, item, to_object)
4404
+ _GeneratedImage_from_vertex(item, to_object)
4612
4405
  for item in getv(from_object, ['predictions'])
4613
4406
  ],
4614
4407
  )
@@ -4618,9 +4411,7 @@ def _GenerateImagesResponse_from_vertex(
4618
4411
  to_object,
4619
4412
  ['positive_prompt_safety_attributes'],
4620
4413
  _SafetyAttributes_from_vertex(
4621
- api_client,
4622
- getv(from_object, ['positivePromptSafetyAttributes']),
4623
- to_object,
4414
+ getv(from_object, ['positivePromptSafetyAttributes']), to_object
4624
4415
  ),
4625
4416
  )
4626
4417
 
@@ -4628,7 +4419,6 @@ def _GenerateImagesResponse_from_vertex(
4628
4419
 
4629
4420
 
4630
4421
  def _EditImageResponse_from_vertex(
4631
- api_client: BaseApiClient,
4632
4422
  from_object: Union[dict[str, Any], object],
4633
4423
  parent_object: Optional[dict[str, Any]] = None,
4634
4424
  ) -> dict[str, Any]:
@@ -4638,7 +4428,7 @@ def _EditImageResponse_from_vertex(
4638
4428
  to_object,
4639
4429
  ['generated_images'],
4640
4430
  [
4641
- _GeneratedImage_from_vertex(api_client, item, to_object)
4431
+ _GeneratedImage_from_vertex(item, to_object)
4642
4432
  for item in getv(from_object, ['predictions'])
4643
4433
  ],
4644
4434
  )
@@ -4647,7 +4437,6 @@ def _EditImageResponse_from_vertex(
4647
4437
 
4648
4438
 
4649
4439
  def _UpscaleImageResponse_from_vertex(
4650
- api_client: BaseApiClient,
4651
4440
  from_object: Union[dict[str, Any], object],
4652
4441
  parent_object: Optional[dict[str, Any]] = None,
4653
4442
  ) -> dict[str, Any]:
@@ -4657,7 +4446,7 @@ def _UpscaleImageResponse_from_vertex(
4657
4446
  to_object,
4658
4447
  ['generated_images'],
4659
4448
  [
4660
- _GeneratedImage_from_vertex(api_client, item, to_object)
4449
+ _GeneratedImage_from_vertex(item, to_object)
4661
4450
  for item in getv(from_object, ['predictions'])
4662
4451
  ],
4663
4452
  )
@@ -4666,7 +4455,6 @@ def _UpscaleImageResponse_from_vertex(
4666
4455
 
4667
4456
 
4668
4457
  def _Endpoint_from_vertex(
4669
- api_client: BaseApiClient,
4670
4458
  from_object: Union[dict[str, Any], object],
4671
4459
  parent_object: Optional[dict[str, Any]] = None,
4672
4460
  ) -> dict[str, Any]:
@@ -4683,7 +4471,6 @@ def _Endpoint_from_vertex(
4683
4471
 
4684
4472
 
4685
4473
  def _TunedModelInfo_from_vertex(
4686
- api_client: BaseApiClient,
4687
4474
  from_object: Union[dict[str, Any], object],
4688
4475
  parent_object: Optional[dict[str, Any]] = None,
4689
4476
  ) -> dict[str, Any]:
@@ -4708,7 +4495,6 @@ def _TunedModelInfo_from_vertex(
4708
4495
 
4709
4496
 
4710
4497
  def _Checkpoint_from_vertex(
4711
- api_client: BaseApiClient,
4712
4498
  from_object: Union[dict[str, Any], object],
4713
4499
  parent_object: Optional[dict[str, Any]] = None,
4714
4500
  ) -> dict[str, Any]:
@@ -4726,7 +4512,6 @@ def _Checkpoint_from_vertex(
4726
4512
 
4727
4513
 
4728
4514
  def _Model_from_vertex(
4729
- api_client: BaseApiClient,
4730
4515
  from_object: Union[dict[str, Any], object],
4731
4516
  parent_object: Optional[dict[str, Any]] = None,
4732
4517
  ) -> dict[str, Any]:
@@ -4748,7 +4533,7 @@ def _Model_from_vertex(
4748
4533
  to_object,
4749
4534
  ['endpoints'],
4750
4535
  [
4751
- _Endpoint_from_vertex(api_client, item, to_object)
4536
+ _Endpoint_from_vertex(item, to_object)
4752
4537
  for item in getv(from_object, ['deployedModels'])
4753
4538
  ],
4754
4539
  )
@@ -4760,9 +4545,7 @@ def _Model_from_vertex(
4760
4545
  setv(
4761
4546
  to_object,
4762
4547
  ['tuned_model_info'],
4763
- _TunedModelInfo_from_vertex(
4764
- api_client, getv(from_object, ['_self']), to_object
4765
- ),
4548
+ _TunedModelInfo_from_vertex(getv(from_object, ['_self']), to_object),
4766
4549
  )
4767
4550
 
4768
4551
  if getv(from_object, ['defaultCheckpointId']) is not None:
@@ -4777,7 +4560,7 @@ def _Model_from_vertex(
4777
4560
  to_object,
4778
4561
  ['checkpoints'],
4779
4562
  [
4780
- _Checkpoint_from_vertex(api_client, item, to_object)
4563
+ _Checkpoint_from_vertex(item, to_object)
4781
4564
  for item in getv(from_object, ['checkpoints'])
4782
4565
  ],
4783
4566
  )
@@ -4786,7 +4569,6 @@ def _Model_from_vertex(
4786
4569
 
4787
4570
 
4788
4571
  def _ListModelsResponse_from_vertex(
4789
- api_client: BaseApiClient,
4790
4572
  from_object: Union[dict[str, Any], object],
4791
4573
  parent_object: Optional[dict[str, Any]] = None,
4792
4574
  ) -> dict[str, Any]:
@@ -4799,10 +4581,8 @@ def _ListModelsResponse_from_vertex(
4799
4581
  to_object,
4800
4582
  ['models'],
4801
4583
  [
4802
- _Model_from_vertex(api_client, item, to_object)
4803
- for item in t.t_extract_models(
4804
- api_client, getv(from_object, ['_self'])
4805
- )
4584
+ _Model_from_vertex(item, to_object)
4585
+ for item in t.t_extract_models(getv(from_object, ['_self']))
4806
4586
  ],
4807
4587
  )
4808
4588
 
@@ -4810,7 +4590,6 @@ def _ListModelsResponse_from_vertex(
4810
4590
 
4811
4591
 
4812
4592
  def _DeleteModelResponse_from_vertex(
4813
- api_client: BaseApiClient,
4814
4593
  from_object: Union[dict[str, Any], object],
4815
4594
  parent_object: Optional[dict[str, Any]] = None,
4816
4595
  ) -> dict[str, Any]:
@@ -4820,7 +4599,6 @@ def _DeleteModelResponse_from_vertex(
4820
4599
 
4821
4600
 
4822
4601
  def _CountTokensResponse_from_vertex(
4823
- api_client: BaseApiClient,
4824
4602
  from_object: Union[dict[str, Any], object],
4825
4603
  parent_object: Optional[dict[str, Any]] = None,
4826
4604
  ) -> dict[str, Any]:
@@ -4832,7 +4610,6 @@ def _CountTokensResponse_from_vertex(
4832
4610
 
4833
4611
 
4834
4612
  def _ComputeTokensResponse_from_vertex(
4835
- api_client: BaseApiClient,
4836
4613
  from_object: Union[dict[str, Any], object],
4837
4614
  parent_object: Optional[dict[str, Any]] = None,
4838
4615
  ) -> dict[str, Any]:
@@ -4844,7 +4621,6 @@ def _ComputeTokensResponse_from_vertex(
4844
4621
 
4845
4622
 
4846
4623
  def _Video_from_vertex(
4847
- api_client: BaseApiClient,
4848
4624
  from_object: Union[dict[str, Any], object],
4849
4625
  parent_object: Optional[dict[str, Any]] = None,
4850
4626
  ) -> dict[str, Any]:
@@ -4856,7 +4632,7 @@ def _Video_from_vertex(
4856
4632
  setv(
4857
4633
  to_object,
4858
4634
  ['video_bytes'],
4859
- t.t_bytes(api_client, getv(from_object, ['bytesBase64Encoded'])),
4635
+ t.t_bytes(getv(from_object, ['bytesBase64Encoded'])),
4860
4636
  )
4861
4637
 
4862
4638
  if getv(from_object, ['mimeType']) is not None:
@@ -4866,7 +4642,6 @@ def _Video_from_vertex(
4866
4642
 
4867
4643
 
4868
4644
  def _GeneratedVideo_from_vertex(
4869
- api_client: BaseApiClient,
4870
4645
  from_object: Union[dict[str, Any], object],
4871
4646
  parent_object: Optional[dict[str, Any]] = None,
4872
4647
  ) -> dict[str, Any]:
@@ -4875,14 +4650,13 @@ def _GeneratedVideo_from_vertex(
4875
4650
  setv(
4876
4651
  to_object,
4877
4652
  ['video'],
4878
- _Video_from_vertex(api_client, getv(from_object, ['_self']), to_object),
4653
+ _Video_from_vertex(getv(from_object, ['_self']), to_object),
4879
4654
  )
4880
4655
 
4881
4656
  return to_object
4882
4657
 
4883
4658
 
4884
4659
  def _GenerateVideosResponse_from_vertex(
4885
- api_client: BaseApiClient,
4886
4660
  from_object: Union[dict[str, Any], object],
4887
4661
  parent_object: Optional[dict[str, Any]] = None,
4888
4662
  ) -> dict[str, Any]:
@@ -4892,7 +4666,7 @@ def _GenerateVideosResponse_from_vertex(
4892
4666
  to_object,
4893
4667
  ['generated_videos'],
4894
4668
  [
4895
- _GeneratedVideo_from_vertex(api_client, item, to_object)
4669
+ _GeneratedVideo_from_vertex(item, to_object)
4896
4670
  for item in getv(from_object, ['videos'])
4897
4671
  ],
4898
4672
  )
@@ -4915,7 +4689,6 @@ def _GenerateVideosResponse_from_vertex(
4915
4689
 
4916
4690
 
4917
4691
  def _GenerateVideosOperation_from_vertex(
4918
- api_client: BaseApiClient,
4919
4692
  from_object: Union[dict[str, Any], object],
4920
4693
  parent_object: Optional[dict[str, Any]] = None,
4921
4694
  ) -> dict[str, Any]:
@@ -4937,7 +4710,7 @@ def _GenerateVideosOperation_from_vertex(
4937
4710
  to_object,
4938
4711
  ['response'],
4939
4712
  _GenerateVideosResponse_from_vertex(
4940
- api_client, getv(from_object, ['response']), to_object
4713
+ getv(from_object, ['response']), to_object
4941
4714
  ),
4942
4715
  )
4943
4716
 
@@ -4946,7 +4719,7 @@ def _GenerateVideosOperation_from_vertex(
4946
4719
  to_object,
4947
4720
  ['result'],
4948
4721
  _GenerateVideosResponse_from_vertex(
4949
- api_client, getv(from_object, ['response']), to_object
4722
+ getv(from_object, ['response']), to_object
4950
4723
  ),
4951
4724
  )
4952
4725
 
@@ -5004,19 +4777,17 @@ class Models(_api_module.BaseModule):
5004
4777
  request_dict = _common.convert_to_dict(request_dict)
5005
4778
  request_dict = _common.encode_unserializable_types(request_dict)
5006
4779
 
5007
- response_dict = self._api_client.request(
4780
+ response = self._api_client.request(
5008
4781
  'post', path, request_dict, http_options
5009
4782
  )
5010
4783
 
4784
+ response_dict = '' if not response.body else json.loads(response.body)
4785
+
5011
4786
  if self._api_client.vertexai:
5012
- response_dict = _GenerateContentResponse_from_vertex(
5013
- self._api_client, response_dict
5014
- )
4787
+ response_dict = _GenerateContentResponse_from_vertex(response_dict)
5015
4788
 
5016
4789
  else:
5017
- response_dict = _GenerateContentResponse_from_mldev(
5018
- self._api_client, response_dict
5019
- )
4790
+ response_dict = _GenerateContentResponse_from_mldev(response_dict)
5020
4791
 
5021
4792
  return_value = types.GenerateContentResponse._from_response(
5022
4793
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5077,19 +4848,23 @@ class Models(_api_module.BaseModule):
5077
4848
  request_dict = _common.convert_to_dict(request_dict)
5078
4849
  request_dict = _common.encode_unserializable_types(request_dict)
5079
4850
 
4851
+ if config is not None and getattr(
4852
+ config, 'should_return_http_response', None
4853
+ ):
4854
+ raise ValueError(
4855
+ 'Accessing the raw HTTP response is not supported in streaming'
4856
+ ' methods.'
4857
+ )
4858
+
5080
4859
  for response_dict in self._api_client.request_streamed(
5081
4860
  'post', path, request_dict, http_options
5082
4861
  ):
5083
4862
 
5084
4863
  if self._api_client.vertexai:
5085
- response_dict = _GenerateContentResponse_from_vertex(
5086
- self._api_client, response_dict
5087
- )
4864
+ response_dict = _GenerateContentResponse_from_vertex(response_dict)
5088
4865
 
5089
4866
  else:
5090
- response_dict = _GenerateContentResponse_from_mldev(
5091
- self._api_client, response_dict
5092
- )
4867
+ response_dict = _GenerateContentResponse_from_mldev(response_dict)
5093
4868
 
5094
4869
  return_value = types.GenerateContentResponse._from_response(
5095
4870
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5169,19 +4944,17 @@ class Models(_api_module.BaseModule):
5169
4944
  request_dict = _common.convert_to_dict(request_dict)
5170
4945
  request_dict = _common.encode_unserializable_types(request_dict)
5171
4946
 
5172
- response_dict = self._api_client.request(
4947
+ response = self._api_client.request(
5173
4948
  'post', path, request_dict, http_options
5174
4949
  )
5175
4950
 
4951
+ response_dict = '' if not response.body else json.loads(response.body)
4952
+
5176
4953
  if self._api_client.vertexai:
5177
- response_dict = _EmbedContentResponse_from_vertex(
5178
- self._api_client, response_dict
5179
- )
4954
+ response_dict = _EmbedContentResponse_from_vertex(response_dict)
5180
4955
 
5181
4956
  else:
5182
- response_dict = _EmbedContentResponse_from_mldev(
5183
- self._api_client, response_dict
5184
- )
4957
+ response_dict = _EmbedContentResponse_from_mldev(response_dict)
5185
4958
 
5186
4959
  return_value = types.EmbedContentResponse._from_response(
5187
4960
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5246,19 +5019,17 @@ class Models(_api_module.BaseModule):
5246
5019
  request_dict = _common.convert_to_dict(request_dict)
5247
5020
  request_dict = _common.encode_unserializable_types(request_dict)
5248
5021
 
5249
- response_dict = self._api_client.request(
5022
+ response = self._api_client.request(
5250
5023
  'post', path, request_dict, http_options
5251
5024
  )
5252
5025
 
5026
+ response_dict = '' if not response.body else json.loads(response.body)
5027
+
5253
5028
  if self._api_client.vertexai:
5254
- response_dict = _GenerateImagesResponse_from_vertex(
5255
- self._api_client, response_dict
5256
- )
5029
+ response_dict = _GenerateImagesResponse_from_vertex(response_dict)
5257
5030
 
5258
5031
  else:
5259
- response_dict = _GenerateImagesResponse_from_mldev(
5260
- self._api_client, response_dict
5261
- )
5032
+ response_dict = _GenerateImagesResponse_from_mldev(response_dict)
5262
5033
 
5263
5034
  return_value = types.GenerateImagesResponse._from_response(
5264
5035
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5352,14 +5123,14 @@ class Models(_api_module.BaseModule):
5352
5123
  request_dict = _common.convert_to_dict(request_dict)
5353
5124
  request_dict = _common.encode_unserializable_types(request_dict)
5354
5125
 
5355
- response_dict = self._api_client.request(
5126
+ response = self._api_client.request(
5356
5127
  'post', path, request_dict, http_options
5357
5128
  )
5358
5129
 
5130
+ response_dict = '' if not response.body else json.loads(response.body)
5131
+
5359
5132
  if self._api_client.vertexai:
5360
- response_dict = _EditImageResponse_from_vertex(
5361
- self._api_client, response_dict
5362
- )
5133
+ response_dict = _EditImageResponse_from_vertex(response_dict)
5363
5134
 
5364
5135
  return_value = types.EditImageResponse._from_response(
5365
5136
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5420,14 +5191,14 @@ class Models(_api_module.BaseModule):
5420
5191
  request_dict = _common.convert_to_dict(request_dict)
5421
5192
  request_dict = _common.encode_unserializable_types(request_dict)
5422
5193
 
5423
- response_dict = self._api_client.request(
5194
+ response = self._api_client.request(
5424
5195
  'post', path, request_dict, http_options
5425
5196
  )
5426
5197
 
5198
+ response_dict = '' if not response.body else json.loads(response.body)
5199
+
5427
5200
  if self._api_client.vertexai:
5428
- response_dict = _UpscaleImageResponse_from_vertex(
5429
- self._api_client, response_dict
5430
- )
5201
+ response_dict = _UpscaleImageResponse_from_vertex(response_dict)
5431
5202
 
5432
5203
  return_value = types.UpscaleImageResponse._from_response(
5433
5204
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5479,15 +5250,15 @@ class Models(_api_module.BaseModule):
5479
5250
  request_dict = _common.convert_to_dict(request_dict)
5480
5251
  request_dict = _common.encode_unserializable_types(request_dict)
5481
5252
 
5482
- response_dict = self._api_client.request(
5483
- 'get', path, request_dict, http_options
5484
- )
5253
+ response = self._api_client.request('get', path, request_dict, http_options)
5254
+
5255
+ response_dict = '' if not response.body else json.loads(response.body)
5485
5256
 
5486
5257
  if self._api_client.vertexai:
5487
- response_dict = _Model_from_vertex(self._api_client, response_dict)
5258
+ response_dict = _Model_from_vertex(response_dict)
5488
5259
 
5489
5260
  else:
5490
- response_dict = _Model_from_mldev(self._api_client, response_dict)
5261
+ response_dict = _Model_from_mldev(response_dict)
5491
5262
 
5492
5263
  return_value = types.Model._from_response(
5493
5264
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5538,19 +5309,15 @@ class Models(_api_module.BaseModule):
5538
5309
  request_dict = _common.convert_to_dict(request_dict)
5539
5310
  request_dict = _common.encode_unserializable_types(request_dict)
5540
5311
 
5541
- response_dict = self._api_client.request(
5542
- 'get', path, request_dict, http_options
5543
- )
5312
+ response = self._api_client.request('get', path, request_dict, http_options)
5313
+
5314
+ response_dict = '' if not response.body else json.loads(response.body)
5544
5315
 
5545
5316
  if self._api_client.vertexai:
5546
- response_dict = _ListModelsResponse_from_vertex(
5547
- self._api_client, response_dict
5548
- )
5317
+ response_dict = _ListModelsResponse_from_vertex(response_dict)
5549
5318
 
5550
5319
  else:
5551
- response_dict = _ListModelsResponse_from_mldev(
5552
- self._api_client, response_dict
5553
- )
5320
+ response_dict = _ListModelsResponse_from_mldev(response_dict)
5554
5321
 
5555
5322
  return_value = types.ListModelsResponse._from_response(
5556
5323
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5605,15 +5372,17 @@ class Models(_api_module.BaseModule):
5605
5372
  request_dict = _common.convert_to_dict(request_dict)
5606
5373
  request_dict = _common.encode_unserializable_types(request_dict)
5607
5374
 
5608
- response_dict = self._api_client.request(
5375
+ response = self._api_client.request(
5609
5376
  'patch', path, request_dict, http_options
5610
5377
  )
5611
5378
 
5379
+ response_dict = '' if not response.body else json.loads(response.body)
5380
+
5612
5381
  if self._api_client.vertexai:
5613
- response_dict = _Model_from_vertex(self._api_client, response_dict)
5382
+ response_dict = _Model_from_vertex(response_dict)
5614
5383
 
5615
5384
  else:
5616
- response_dict = _Model_from_mldev(self._api_client, response_dict)
5385
+ response_dict = _Model_from_mldev(response_dict)
5617
5386
 
5618
5387
  return_value = types.Model._from_response(
5619
5388
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5668,19 +5437,17 @@ class Models(_api_module.BaseModule):
5668
5437
  request_dict = _common.convert_to_dict(request_dict)
5669
5438
  request_dict = _common.encode_unserializable_types(request_dict)
5670
5439
 
5671
- response_dict = self._api_client.request(
5440
+ response = self._api_client.request(
5672
5441
  'delete', path, request_dict, http_options
5673
5442
  )
5674
5443
 
5444
+ response_dict = '' if not response.body else json.loads(response.body)
5445
+
5675
5446
  if self._api_client.vertexai:
5676
- response_dict = _DeleteModelResponse_from_vertex(
5677
- self._api_client, response_dict
5678
- )
5447
+ response_dict = _DeleteModelResponse_from_vertex(response_dict)
5679
5448
 
5680
5449
  else:
5681
- response_dict = _DeleteModelResponse_from_mldev(
5682
- self._api_client, response_dict
5683
- )
5450
+ response_dict = _DeleteModelResponse_from_mldev(response_dict)
5684
5451
 
5685
5452
  return_value = types.DeleteModelResponse._from_response(
5686
5453
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5758,19 +5525,17 @@ class Models(_api_module.BaseModule):
5758
5525
  request_dict = _common.convert_to_dict(request_dict)
5759
5526
  request_dict = _common.encode_unserializable_types(request_dict)
5760
5527
 
5761
- response_dict = self._api_client.request(
5528
+ response = self._api_client.request(
5762
5529
  'post', path, request_dict, http_options
5763
5530
  )
5764
5531
 
5532
+ response_dict = '' if not response.body else json.loads(response.body)
5533
+
5765
5534
  if self._api_client.vertexai:
5766
- response_dict = _CountTokensResponse_from_vertex(
5767
- self._api_client, response_dict
5768
- )
5535
+ response_dict = _CountTokensResponse_from_vertex(response_dict)
5769
5536
 
5770
5537
  else:
5771
- response_dict = _CountTokensResponse_from_mldev(
5772
- self._api_client, response_dict
5773
- )
5538
+ response_dict = _CountTokensResponse_from_mldev(response_dict)
5774
5539
 
5775
5540
  return_value = types.CountTokensResponse._from_response(
5776
5541
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5843,14 +5608,14 @@ class Models(_api_module.BaseModule):
5843
5608
  request_dict = _common.convert_to_dict(request_dict)
5844
5609
  request_dict = _common.encode_unserializable_types(request_dict)
5845
5610
 
5846
- response_dict = self._api_client.request(
5611
+ response = self._api_client.request(
5847
5612
  'post', path, request_dict, http_options
5848
5613
  )
5849
5614
 
5615
+ response_dict = '' if not response.body else json.loads(response.body)
5616
+
5850
5617
  if self._api_client.vertexai:
5851
- response_dict = _ComputeTokensResponse_from_vertex(
5852
- self._api_client, response_dict
5853
- )
5618
+ response_dict = _ComputeTokensResponse_from_vertex(response_dict)
5854
5619
 
5855
5620
  return_value = types.ComputeTokensResponse._from_response(
5856
5621
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -5945,19 +5710,17 @@ class Models(_api_module.BaseModule):
5945
5710
  request_dict = _common.convert_to_dict(request_dict)
5946
5711
  request_dict = _common.encode_unserializable_types(request_dict)
5947
5712
 
5948
- response_dict = self._api_client.request(
5713
+ response = self._api_client.request(
5949
5714
  'post', path, request_dict, http_options
5950
5715
  )
5951
5716
 
5717
+ response_dict = '' if not response.body else json.loads(response.body)
5718
+
5952
5719
  if self._api_client.vertexai:
5953
- response_dict = _GenerateVideosOperation_from_vertex(
5954
- self._api_client, response_dict
5955
- )
5720
+ response_dict = _GenerateVideosOperation_from_vertex(response_dict)
5956
5721
 
5957
5722
  else:
5958
- response_dict = _GenerateVideosOperation_from_mldev(
5959
- self._api_client, response_dict
5960
- )
5723
+ response_dict = _GenerateVideosOperation_from_mldev(response_dict)
5961
5724
 
5962
5725
  return_value = types.GenerateVideosOperation._from_response(
5963
5726
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -6084,7 +5847,7 @@ class Models(_api_module.BaseModule):
6084
5847
  role='user',
6085
5848
  parts=func_response_parts,
6086
5849
  )
6087
- contents = t.t_contents(self._api_client, contents) # type: ignore[assignment]
5850
+ contents = t.t_contents(contents) # type: ignore[assignment]
6088
5851
  if not automatic_function_calling_history:
6089
5852
  automatic_function_calling_history.extend(contents) # type: ignore[arg-type]
6090
5853
  if isinstance(contents, list):
@@ -6255,7 +6018,7 @@ class Models(_api_module.BaseModule):
6255
6018
  role='user',
6256
6019
  parts=func_response_parts,
6257
6020
  )
6258
- contents = t.t_contents(self._api_client, contents) # type: ignore[assignment]
6021
+ contents = t.t_contents(contents) # type: ignore[assignment]
6259
6022
  if not automatic_function_calling_history:
6260
6023
  automatic_function_calling_history.extend(contents) # type: ignore[arg-type]
6261
6024
  if isinstance(contents, list) and func_call_content is not None:
@@ -6544,19 +6307,17 @@ class AsyncModels(_api_module.BaseModule):
6544
6307
  request_dict = _common.convert_to_dict(request_dict)
6545
6308
  request_dict = _common.encode_unserializable_types(request_dict)
6546
6309
 
6547
- response_dict = await self._api_client.async_request(
6310
+ response = await self._api_client.async_request(
6548
6311
  'post', path, request_dict, http_options
6549
6312
  )
6550
6313
 
6314
+ response_dict = '' if not response.body else json.loads(response.body)
6315
+
6551
6316
  if self._api_client.vertexai:
6552
- response_dict = _GenerateContentResponse_from_vertex(
6553
- self._api_client, response_dict
6554
- )
6317
+ response_dict = _GenerateContentResponse_from_vertex(response_dict)
6555
6318
 
6556
6319
  else:
6557
- response_dict = _GenerateContentResponse_from_mldev(
6558
- self._api_client, response_dict
6559
- )
6320
+ response_dict = _GenerateContentResponse_from_mldev(response_dict)
6560
6321
 
6561
6322
  return_value = types.GenerateContentResponse._from_response(
6562
6323
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -6617,6 +6378,14 @@ class AsyncModels(_api_module.BaseModule):
6617
6378
  request_dict = _common.convert_to_dict(request_dict)
6618
6379
  request_dict = _common.encode_unserializable_types(request_dict)
6619
6380
 
6381
+ if config is not None and getattr(
6382
+ config, 'should_return_http_response', None
6383
+ ):
6384
+ raise ValueError(
6385
+ 'Accessing the raw HTTP response is not supported in streaming'
6386
+ ' methods.'
6387
+ )
6388
+
6620
6389
  response_stream = await self._api_client.async_request_streamed(
6621
6390
  'post', path, request_dict, http_options
6622
6391
  )
@@ -6625,14 +6394,10 @@ class AsyncModels(_api_module.BaseModule):
6625
6394
  async for response_dict in response_stream:
6626
6395
 
6627
6396
  if self._api_client.vertexai:
6628
- response_dict = _GenerateContentResponse_from_vertex(
6629
- self._api_client, response_dict
6630
- )
6397
+ response_dict = _GenerateContentResponse_from_vertex(response_dict)
6631
6398
 
6632
6399
  else:
6633
- response_dict = _GenerateContentResponse_from_mldev(
6634
- self._api_client, response_dict
6635
- )
6400
+ response_dict = _GenerateContentResponse_from_mldev(response_dict)
6636
6401
 
6637
6402
  return_value = types.GenerateContentResponse._from_response(
6638
6403
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -6714,19 +6479,17 @@ class AsyncModels(_api_module.BaseModule):
6714
6479
  request_dict = _common.convert_to_dict(request_dict)
6715
6480
  request_dict = _common.encode_unserializable_types(request_dict)
6716
6481
 
6717
- response_dict = await self._api_client.async_request(
6482
+ response = await self._api_client.async_request(
6718
6483
  'post', path, request_dict, http_options
6719
6484
  )
6720
6485
 
6486
+ response_dict = '' if not response.body else json.loads(response.body)
6487
+
6721
6488
  if self._api_client.vertexai:
6722
- response_dict = _EmbedContentResponse_from_vertex(
6723
- self._api_client, response_dict
6724
- )
6489
+ response_dict = _EmbedContentResponse_from_vertex(response_dict)
6725
6490
 
6726
6491
  else:
6727
- response_dict = _EmbedContentResponse_from_mldev(
6728
- self._api_client, response_dict
6729
- )
6492
+ response_dict = _EmbedContentResponse_from_mldev(response_dict)
6730
6493
 
6731
6494
  return_value = types.EmbedContentResponse._from_response(
6732
6495
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -6791,19 +6554,17 @@ class AsyncModels(_api_module.BaseModule):
6791
6554
  request_dict = _common.convert_to_dict(request_dict)
6792
6555
  request_dict = _common.encode_unserializable_types(request_dict)
6793
6556
 
6794
- response_dict = await self._api_client.async_request(
6557
+ response = await self._api_client.async_request(
6795
6558
  'post', path, request_dict, http_options
6796
6559
  )
6797
6560
 
6561
+ response_dict = '' if not response.body else json.loads(response.body)
6562
+
6798
6563
  if self._api_client.vertexai:
6799
- response_dict = _GenerateImagesResponse_from_vertex(
6800
- self._api_client, response_dict
6801
- )
6564
+ response_dict = _GenerateImagesResponse_from_vertex(response_dict)
6802
6565
 
6803
6566
  else:
6804
- response_dict = _GenerateImagesResponse_from_mldev(
6805
- self._api_client, response_dict
6806
- )
6567
+ response_dict = _GenerateImagesResponse_from_mldev(response_dict)
6807
6568
 
6808
6569
  return_value = types.GenerateImagesResponse._from_response(
6809
6570
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -6897,14 +6658,14 @@ class AsyncModels(_api_module.BaseModule):
6897
6658
  request_dict = _common.convert_to_dict(request_dict)
6898
6659
  request_dict = _common.encode_unserializable_types(request_dict)
6899
6660
 
6900
- response_dict = await self._api_client.async_request(
6661
+ response = await self._api_client.async_request(
6901
6662
  'post', path, request_dict, http_options
6902
6663
  )
6903
6664
 
6665
+ response_dict = '' if not response.body else json.loads(response.body)
6666
+
6904
6667
  if self._api_client.vertexai:
6905
- response_dict = _EditImageResponse_from_vertex(
6906
- self._api_client, response_dict
6907
- )
6668
+ response_dict = _EditImageResponse_from_vertex(response_dict)
6908
6669
 
6909
6670
  return_value = types.EditImageResponse._from_response(
6910
6671
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -6965,14 +6726,14 @@ class AsyncModels(_api_module.BaseModule):
6965
6726
  request_dict = _common.convert_to_dict(request_dict)
6966
6727
  request_dict = _common.encode_unserializable_types(request_dict)
6967
6728
 
6968
- response_dict = await self._api_client.async_request(
6729
+ response = await self._api_client.async_request(
6969
6730
  'post', path, request_dict, http_options
6970
6731
  )
6971
6732
 
6733
+ response_dict = '' if not response.body else json.loads(response.body)
6734
+
6972
6735
  if self._api_client.vertexai:
6973
- response_dict = _UpscaleImageResponse_from_vertex(
6974
- self._api_client, response_dict
6975
- )
6736
+ response_dict = _UpscaleImageResponse_from_vertex(response_dict)
6976
6737
 
6977
6738
  return_value = types.UpscaleImageResponse._from_response(
6978
6739
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7024,15 +6785,17 @@ class AsyncModels(_api_module.BaseModule):
7024
6785
  request_dict = _common.convert_to_dict(request_dict)
7025
6786
  request_dict = _common.encode_unserializable_types(request_dict)
7026
6787
 
7027
- response_dict = await self._api_client.async_request(
6788
+ response = await self._api_client.async_request(
7028
6789
  'get', path, request_dict, http_options
7029
6790
  )
7030
6791
 
6792
+ response_dict = '' if not response.body else json.loads(response.body)
6793
+
7031
6794
  if self._api_client.vertexai:
7032
- response_dict = _Model_from_vertex(self._api_client, response_dict)
6795
+ response_dict = _Model_from_vertex(response_dict)
7033
6796
 
7034
6797
  else:
7035
- response_dict = _Model_from_mldev(self._api_client, response_dict)
6798
+ response_dict = _Model_from_mldev(response_dict)
7036
6799
 
7037
6800
  return_value = types.Model._from_response(
7038
6801
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7083,19 +6846,17 @@ class AsyncModels(_api_module.BaseModule):
7083
6846
  request_dict = _common.convert_to_dict(request_dict)
7084
6847
  request_dict = _common.encode_unserializable_types(request_dict)
7085
6848
 
7086
- response_dict = await self._api_client.async_request(
6849
+ response = await self._api_client.async_request(
7087
6850
  'get', path, request_dict, http_options
7088
6851
  )
7089
6852
 
6853
+ response_dict = '' if not response.body else json.loads(response.body)
6854
+
7090
6855
  if self._api_client.vertexai:
7091
- response_dict = _ListModelsResponse_from_vertex(
7092
- self._api_client, response_dict
7093
- )
6856
+ response_dict = _ListModelsResponse_from_vertex(response_dict)
7094
6857
 
7095
6858
  else:
7096
- response_dict = _ListModelsResponse_from_mldev(
7097
- self._api_client, response_dict
7098
- )
6859
+ response_dict = _ListModelsResponse_from_mldev(response_dict)
7099
6860
 
7100
6861
  return_value = types.ListModelsResponse._from_response(
7101
6862
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7150,15 +6911,17 @@ class AsyncModels(_api_module.BaseModule):
7150
6911
  request_dict = _common.convert_to_dict(request_dict)
7151
6912
  request_dict = _common.encode_unserializable_types(request_dict)
7152
6913
 
7153
- response_dict = await self._api_client.async_request(
6914
+ response = await self._api_client.async_request(
7154
6915
  'patch', path, request_dict, http_options
7155
6916
  )
7156
6917
 
6918
+ response_dict = '' if not response.body else json.loads(response.body)
6919
+
7157
6920
  if self._api_client.vertexai:
7158
- response_dict = _Model_from_vertex(self._api_client, response_dict)
6921
+ response_dict = _Model_from_vertex(response_dict)
7159
6922
 
7160
6923
  else:
7161
- response_dict = _Model_from_mldev(self._api_client, response_dict)
6924
+ response_dict = _Model_from_mldev(response_dict)
7162
6925
 
7163
6926
  return_value = types.Model._from_response(
7164
6927
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7213,19 +6976,17 @@ class AsyncModels(_api_module.BaseModule):
7213
6976
  request_dict = _common.convert_to_dict(request_dict)
7214
6977
  request_dict = _common.encode_unserializable_types(request_dict)
7215
6978
 
7216
- response_dict = await self._api_client.async_request(
6979
+ response = await self._api_client.async_request(
7217
6980
  'delete', path, request_dict, http_options
7218
6981
  )
7219
6982
 
6983
+ response_dict = '' if not response.body else json.loads(response.body)
6984
+
7220
6985
  if self._api_client.vertexai:
7221
- response_dict = _DeleteModelResponse_from_vertex(
7222
- self._api_client, response_dict
7223
- )
6986
+ response_dict = _DeleteModelResponse_from_vertex(response_dict)
7224
6987
 
7225
6988
  else:
7226
- response_dict = _DeleteModelResponse_from_mldev(
7227
- self._api_client, response_dict
7228
- )
6989
+ response_dict = _DeleteModelResponse_from_mldev(response_dict)
7229
6990
 
7230
6991
  return_value = types.DeleteModelResponse._from_response(
7231
6992
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7303,19 +7064,17 @@ class AsyncModels(_api_module.BaseModule):
7303
7064
  request_dict = _common.convert_to_dict(request_dict)
7304
7065
  request_dict = _common.encode_unserializable_types(request_dict)
7305
7066
 
7306
- response_dict = await self._api_client.async_request(
7067
+ response = await self._api_client.async_request(
7307
7068
  'post', path, request_dict, http_options
7308
7069
  )
7309
7070
 
7071
+ response_dict = '' if not response.body else json.loads(response.body)
7072
+
7310
7073
  if self._api_client.vertexai:
7311
- response_dict = _CountTokensResponse_from_vertex(
7312
- self._api_client, response_dict
7313
- )
7074
+ response_dict = _CountTokensResponse_from_vertex(response_dict)
7314
7075
 
7315
7076
  else:
7316
- response_dict = _CountTokensResponse_from_mldev(
7317
- self._api_client, response_dict
7318
- )
7077
+ response_dict = _CountTokensResponse_from_mldev(response_dict)
7319
7078
 
7320
7079
  return_value = types.CountTokensResponse._from_response(
7321
7080
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7387,14 +7146,14 @@ class AsyncModels(_api_module.BaseModule):
7387
7146
  request_dict = _common.convert_to_dict(request_dict)
7388
7147
  request_dict = _common.encode_unserializable_types(request_dict)
7389
7148
 
7390
- response_dict = await self._api_client.async_request(
7149
+ response = await self._api_client.async_request(
7391
7150
  'post', path, request_dict, http_options
7392
7151
  )
7393
7152
 
7153
+ response_dict = '' if not response.body else json.loads(response.body)
7154
+
7394
7155
  if self._api_client.vertexai:
7395
- response_dict = _ComputeTokensResponse_from_vertex(
7396
- self._api_client, response_dict
7397
- )
7156
+ response_dict = _ComputeTokensResponse_from_vertex(response_dict)
7398
7157
 
7399
7158
  return_value = types.ComputeTokensResponse._from_response(
7400
7159
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7489,19 +7248,17 @@ class AsyncModels(_api_module.BaseModule):
7489
7248
  request_dict = _common.convert_to_dict(request_dict)
7490
7249
  request_dict = _common.encode_unserializable_types(request_dict)
7491
7250
 
7492
- response_dict = await self._api_client.async_request(
7251
+ response = await self._api_client.async_request(
7493
7252
  'post', path, request_dict, http_options
7494
7253
  )
7495
7254
 
7255
+ response_dict = '' if not response.body else json.loads(response.body)
7256
+
7496
7257
  if self._api_client.vertexai:
7497
- response_dict = _GenerateVideosOperation_from_vertex(
7498
- self._api_client, response_dict
7499
- )
7258
+ response_dict = _GenerateVideosOperation_from_vertex(response_dict)
7500
7259
 
7501
7260
  else:
7502
- response_dict = _GenerateVideosOperation_from_mldev(
7503
- self._api_client, response_dict
7504
- )
7261
+ response_dict = _GenerateVideosOperation_from_mldev(response_dict)
7505
7262
 
7506
7263
  return_value = types.GenerateVideosOperation._from_response(
7507
7264
  response=response_dict, kwargs=parameter_model.model_dump()
@@ -7596,7 +7353,7 @@ class AsyncModels(_api_module.BaseModule):
7596
7353
  role='user',
7597
7354
  parts=func_response_parts,
7598
7355
  )
7599
- contents = t.t_contents(self._api_client, contents) # type: ignore[assignment]
7356
+ contents = t.t_contents(contents) # type: ignore[assignment]
7600
7357
  if not automatic_function_calling_history:
7601
7358
  automatic_function_calling_history.extend(contents) # type: ignore[arg-type]
7602
7359
  if isinstance(contents, list):
@@ -7777,7 +7534,7 @@ class AsyncModels(_api_module.BaseModule):
7777
7534
  role='user',
7778
7535
  parts=func_response_parts,
7779
7536
  )
7780
- contents = t.t_contents(self._api_client, contents)
7537
+ contents = t.t_contents(contents)
7781
7538
  if not automatic_function_calling_history:
7782
7539
  automatic_function_calling_history.extend(contents)
7783
7540
  if isinstance(contents, list) and func_call_content is not None: