google-genai 1.15.0__py3-none-any.whl → 1.16.1__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.
@@ -22,6 +22,229 @@ from ._common import get_value_by_path as getv
22
22
  from ._common import set_value_by_path as setv
23
23
 
24
24
 
25
+ def _PrebuiltVoiceConfig_to_mldev(
26
+ api_client: BaseApiClient,
27
+ from_object: Union[dict[str, Any], object],
28
+ parent_object: Optional[dict[str, Any]] = None,
29
+ ) -> dict[str, Any]:
30
+ to_object: dict[str, Any] = {}
31
+ if getv(from_object, ['voice_name']) is not None:
32
+ setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
33
+
34
+ return to_object
35
+
36
+
37
+ def _PrebuiltVoiceConfig_to_vertex(
38
+ api_client: BaseApiClient,
39
+ from_object: Union[dict[str, Any], object],
40
+ parent_object: Optional[dict[str, Any]] = None,
41
+ ) -> dict[str, Any]:
42
+ to_object: dict[str, Any] = {}
43
+ if getv(from_object, ['voice_name']) is not None:
44
+ setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
45
+
46
+ return to_object
47
+
48
+
49
+ def _VoiceConfig_to_mldev(
50
+ api_client: BaseApiClient,
51
+ from_object: Union[dict[str, Any], object],
52
+ parent_object: Optional[dict[str, Any]] = None,
53
+ ) -> dict[str, Any]:
54
+ to_object: dict[str, Any] = {}
55
+ if getv(from_object, ['prebuilt_voice_config']) is not None:
56
+ setv(
57
+ to_object,
58
+ ['prebuiltVoiceConfig'],
59
+ _PrebuiltVoiceConfig_to_mldev(
60
+ api_client, getv(from_object, ['prebuilt_voice_config']), to_object
61
+ ),
62
+ )
63
+
64
+ return to_object
65
+
66
+
67
+ def _VoiceConfig_to_vertex(
68
+ api_client: BaseApiClient,
69
+ from_object: Union[dict[str, Any], object],
70
+ parent_object: Optional[dict[str, Any]] = None,
71
+ ) -> dict[str, Any]:
72
+ to_object: dict[str, Any] = {}
73
+ if getv(from_object, ['prebuilt_voice_config']) is not None:
74
+ setv(
75
+ to_object,
76
+ ['prebuiltVoiceConfig'],
77
+ _PrebuiltVoiceConfig_to_vertex(
78
+ api_client, getv(from_object, ['prebuilt_voice_config']), to_object
79
+ ),
80
+ )
81
+
82
+ return to_object
83
+
84
+
85
+ def _SpeakerVoiceConfig_to_mldev(
86
+ api_client: BaseApiClient,
87
+ from_object: Union[dict[str, Any], object],
88
+ parent_object: Optional[dict[str, Any]] = None,
89
+ ) -> dict[str, Any]:
90
+ to_object: dict[str, Any] = {}
91
+ if getv(from_object, ['speaker']) is not None:
92
+ setv(to_object, ['speaker'], getv(from_object, ['speaker']))
93
+
94
+ if getv(from_object, ['voice_config']) is not None:
95
+ setv(
96
+ to_object,
97
+ ['voiceConfig'],
98
+ _VoiceConfig_to_mldev(
99
+ api_client, getv(from_object, ['voice_config']), to_object
100
+ ),
101
+ )
102
+
103
+ return to_object
104
+
105
+
106
+ def _SpeakerVoiceConfig_to_vertex(
107
+ api_client: BaseApiClient,
108
+ from_object: Union[dict[str, Any], object],
109
+ parent_object: Optional[dict[str, Any]] = None,
110
+ ) -> dict[str, Any]:
111
+ to_object: dict[str, Any] = {}
112
+ if getv(from_object, ['speaker']) is not None:
113
+ raise ValueError('speaker parameter is not supported in Vertex AI.')
114
+
115
+ if getv(from_object, ['voice_config']) is not None:
116
+ raise ValueError('voice_config parameter is not supported in Vertex AI.')
117
+
118
+ return to_object
119
+
120
+
121
+ def _MultiSpeakerVoiceConfig_to_mldev(
122
+ api_client: BaseApiClient,
123
+ from_object: Union[dict[str, Any], object],
124
+ parent_object: Optional[dict[str, Any]] = None,
125
+ ) -> dict[str, Any]:
126
+ to_object: dict[str, Any] = {}
127
+ if getv(from_object, ['speaker_voice_configs']) is not None:
128
+ setv(
129
+ to_object,
130
+ ['speakerVoiceConfigs'],
131
+ [
132
+ _SpeakerVoiceConfig_to_mldev(api_client, item, to_object)
133
+ for item in getv(from_object, ['speaker_voice_configs'])
134
+ ],
135
+ )
136
+
137
+ return to_object
138
+
139
+
140
+ def _MultiSpeakerVoiceConfig_to_vertex(
141
+ api_client: BaseApiClient,
142
+ from_object: Union[dict[str, Any], object],
143
+ parent_object: Optional[dict[str, Any]] = None,
144
+ ) -> dict[str, Any]:
145
+ to_object: dict[str, Any] = {}
146
+ if getv(from_object, ['speaker_voice_configs']) is not None:
147
+ raise ValueError(
148
+ 'speaker_voice_configs parameter is not supported in Vertex AI.'
149
+ )
150
+
151
+ return to_object
152
+
153
+
154
+ def _SpeechConfig_to_mldev(
155
+ api_client: BaseApiClient,
156
+ from_object: Union[dict[str, Any], object],
157
+ parent_object: Optional[dict[str, Any]] = None,
158
+ ) -> dict[str, Any]:
159
+ to_object: dict[str, Any] = {}
160
+ if getv(from_object, ['voice_config']) is not None:
161
+ setv(
162
+ to_object,
163
+ ['voiceConfig'],
164
+ _VoiceConfig_to_mldev(
165
+ api_client, getv(from_object, ['voice_config']), to_object
166
+ ),
167
+ )
168
+
169
+ if getv(from_object, ['multi_speaker_voice_config']) is not None:
170
+ setv(
171
+ to_object,
172
+ ['multiSpeakerVoiceConfig'],
173
+ _MultiSpeakerVoiceConfig_to_mldev(
174
+ api_client,
175
+ getv(from_object, ['multi_speaker_voice_config']),
176
+ to_object,
177
+ ),
178
+ )
179
+
180
+ if getv(from_object, ['language_code']) is not None:
181
+ setv(to_object, ['languageCode'], getv(from_object, ['language_code']))
182
+
183
+ return to_object
184
+
185
+
186
+ def _SpeechConfig_to_vertex(
187
+ api_client: BaseApiClient,
188
+ from_object: Union[dict[str, Any], object],
189
+ parent_object: Optional[dict[str, Any]] = None,
190
+ ) -> dict[str, Any]:
191
+ to_object: dict[str, Any] = {}
192
+ if getv(from_object, ['voice_config']) is not None:
193
+ setv(
194
+ to_object,
195
+ ['voiceConfig'],
196
+ _VoiceConfig_to_vertex(
197
+ api_client, getv(from_object, ['voice_config']), to_object
198
+ ),
199
+ )
200
+
201
+ if getv(from_object, ['multi_speaker_voice_config']) is not None:
202
+ raise ValueError(
203
+ 'multi_speaker_voice_config parameter is not supported in Vertex AI.'
204
+ )
205
+
206
+ if getv(from_object, ['language_code']) is not None:
207
+ setv(to_object, ['languageCode'], getv(from_object, ['language_code']))
208
+
209
+ return to_object
210
+
211
+
212
+ def _VideoMetadata_to_mldev(
213
+ api_client: BaseApiClient,
214
+ from_object: Union[dict[str, Any], object],
215
+ parent_object: Optional[dict[str, Any]] = None,
216
+ ) -> dict[str, Any]:
217
+ to_object: dict[str, Any] = {}
218
+ if getv(from_object, ['fps']) is not None:
219
+ setv(to_object, ['fps'], getv(from_object, ['fps']))
220
+
221
+ if getv(from_object, ['end_offset']) is not None:
222
+ setv(to_object, ['endOffset'], getv(from_object, ['end_offset']))
223
+
224
+ if getv(from_object, ['start_offset']) is not None:
225
+ setv(to_object, ['startOffset'], getv(from_object, ['start_offset']))
226
+
227
+ return to_object
228
+
229
+
230
+ def _VideoMetadata_to_vertex(
231
+ api_client: BaseApiClient,
232
+ from_object: Union[dict[str, Any], object],
233
+ parent_object: Optional[dict[str, Any]] = None,
234
+ ) -> dict[str, Any]:
235
+ to_object: dict[str, Any] = {}
236
+ if getv(from_object, ['fps']) is not None:
237
+ setv(to_object, ['fps'], getv(from_object, ['fps']))
238
+
239
+ if getv(from_object, ['end_offset']) is not None:
240
+ setv(to_object, ['endOffset'], getv(from_object, ['end_offset']))
241
+
242
+ if getv(from_object, ['start_offset']) is not None:
243
+ setv(to_object, ['startOffset'], getv(from_object, ['start_offset']))
244
+
245
+ return to_object
246
+
247
+
25
248
  def _Blob_to_mldev(
26
249
  api_client: BaseApiClient,
27
250
  from_object: Union[dict[str, Any], object],
@@ -65,7 +288,13 @@ def _Part_to_mldev(
65
288
  ) -> dict[str, Any]:
66
289
  to_object: dict[str, Any] = {}
67
290
  if getv(from_object, ['video_metadata']) is not None:
68
- raise ValueError('video_metadata parameter is not supported in Gemini API.')
291
+ setv(
292
+ to_object,
293
+ ['videoMetadata'],
294
+ _VideoMetadata_to_mldev(
295
+ api_client, getv(from_object, ['video_metadata']), to_object
296
+ ),
297
+ )
69
298
 
70
299
  if getv(from_object, ['thought']) is not None:
71
300
  setv(to_object, ['thought'], getv(from_object, ['thought']))
@@ -115,7 +344,13 @@ def _Part_to_vertex(
115
344
  ) -> dict[str, Any]:
116
345
  to_object: dict[str, Any] = {}
117
346
  if getv(from_object, ['video_metadata']) is not None:
118
- setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
347
+ setv(
348
+ to_object,
349
+ ['videoMetadata'],
350
+ _VideoMetadata_to_vertex(
351
+ api_client, getv(from_object, ['video_metadata']), to_object
352
+ ),
353
+ )
119
354
 
120
355
  if getv(from_object, ['thought']) is not None:
121
356
  setv(to_object, ['thought'], getv(from_object, ['thought']))
@@ -202,12 +437,98 @@ def _Content_to_vertex(
202
437
  return to_object
203
438
 
204
439
 
440
+ def _FunctionDeclaration_to_mldev(
441
+ api_client: BaseApiClient,
442
+ from_object: Union[dict[str, Any], object],
443
+ parent_object: Optional[dict[str, Any]] = None,
444
+ ) -> dict[str, Any]:
445
+ to_object: dict[str, Any] = {}
446
+ if getv(from_object, ['behavior']) is not None:
447
+ setv(to_object, ['behavior'], getv(from_object, ['behavior']))
448
+
449
+ if getv(from_object, ['description']) is not None:
450
+ setv(to_object, ['description'], getv(from_object, ['description']))
451
+
452
+ if getv(from_object, ['name']) is not None:
453
+ setv(to_object, ['name'], getv(from_object, ['name']))
454
+
455
+ if getv(from_object, ['parameters']) is not None:
456
+ setv(to_object, ['parameters'], getv(from_object, ['parameters']))
457
+
458
+ if getv(from_object, ['response']) is not None:
459
+ setv(to_object, ['response'], getv(from_object, ['response']))
460
+
461
+ return to_object
462
+
463
+
464
+ def _FunctionDeclaration_to_vertex(
465
+ api_client: BaseApiClient,
466
+ from_object: Union[dict[str, Any], object],
467
+ parent_object: Optional[dict[str, Any]] = None,
468
+ ) -> dict[str, Any]:
469
+ to_object: dict[str, Any] = {}
470
+ if getv(from_object, ['behavior']) is not None:
471
+ raise ValueError('behavior parameter is not supported in Vertex AI.')
472
+
473
+ if getv(from_object, ['description']) is not None:
474
+ setv(to_object, ['description'], getv(from_object, ['description']))
475
+
476
+ if getv(from_object, ['name']) is not None:
477
+ setv(to_object, ['name'], getv(from_object, ['name']))
478
+
479
+ if getv(from_object, ['parameters']) is not None:
480
+ setv(to_object, ['parameters'], getv(from_object, ['parameters']))
481
+
482
+ if getv(from_object, ['response']) is not None:
483
+ setv(to_object, ['response'], getv(from_object, ['response']))
484
+
485
+ return to_object
486
+
487
+
488
+ def _Interval_to_mldev(
489
+ api_client: BaseApiClient,
490
+ from_object: Union[dict[str, Any], object],
491
+ parent_object: Optional[dict[str, Any]] = None,
492
+ ) -> dict[str, Any]:
493
+ to_object: dict[str, Any] = {}
494
+ if getv(from_object, ['start_time']) is not None:
495
+ setv(to_object, ['startTime'], getv(from_object, ['start_time']))
496
+
497
+ if getv(from_object, ['end_time']) is not None:
498
+ setv(to_object, ['endTime'], getv(from_object, ['end_time']))
499
+
500
+ return to_object
501
+
502
+
503
+ def _Interval_to_vertex(
504
+ api_client: BaseApiClient,
505
+ from_object: Union[dict[str, Any], object],
506
+ parent_object: Optional[dict[str, Any]] = None,
507
+ ) -> dict[str, Any]:
508
+ to_object: dict[str, Any] = {}
509
+ if getv(from_object, ['start_time']) is not None:
510
+ setv(to_object, ['startTime'], getv(from_object, ['start_time']))
511
+
512
+ if getv(from_object, ['end_time']) is not None:
513
+ setv(to_object, ['endTime'], getv(from_object, ['end_time']))
514
+
515
+ return to_object
516
+
517
+
205
518
  def _GoogleSearch_to_mldev(
206
519
  api_client: BaseApiClient,
207
520
  from_object: Union[dict[str, Any], object],
208
521
  parent_object: Optional[dict[str, Any]] = None,
209
522
  ) -> dict[str, Any]:
210
523
  to_object: dict[str, Any] = {}
524
+ if getv(from_object, ['time_range_filter']) is not None:
525
+ setv(
526
+ to_object,
527
+ ['timeRangeFilter'],
528
+ _Interval_to_mldev(
529
+ api_client, getv(from_object, ['time_range_filter']), to_object
530
+ ),
531
+ )
211
532
 
212
533
  return to_object
213
534
 
@@ -218,6 +539,14 @@ def _GoogleSearch_to_vertex(
218
539
  parent_object: Optional[dict[str, Any]] = None,
219
540
  ) -> dict[str, Any]:
220
541
  to_object: dict[str, Any] = {}
542
+ if getv(from_object, ['time_range_filter']) is not None:
543
+ setv(
544
+ to_object,
545
+ ['timeRangeFilter'],
546
+ _Interval_to_vertex(
547
+ api_client, getv(from_object, ['time_range_filter']), to_object
548
+ ),
549
+ )
221
550
 
222
551
  return to_object
223
552
 
@@ -450,12 +779,42 @@ def _GoogleMaps_to_vertex(
450
779
  return to_object
451
780
 
452
781
 
782
+ def _UrlContext_to_mldev(
783
+ api_client: BaseApiClient,
784
+ from_object: Union[dict[str, Any], object],
785
+ parent_object: Optional[dict[str, Any]] = None,
786
+ ) -> dict[str, Any]:
787
+ to_object: dict[str, Any] = {}
788
+
789
+ return to_object
790
+
791
+
792
+ def _UrlContext_to_vertex(
793
+ api_client: BaseApiClient,
794
+ from_object: Union[dict[str, Any], object],
795
+ parent_object: Optional[dict[str, Any]] = None,
796
+ ) -> dict[str, Any]:
797
+ to_object: dict[str, Any] = {}
798
+
799
+ return to_object
800
+
801
+
453
802
  def _Tool_to_mldev(
454
803
  api_client: BaseApiClient,
455
804
  from_object: Union[dict[str, Any], object],
456
805
  parent_object: Optional[dict[str, Any]] = None,
457
806
  ) -> dict[str, Any]:
458
807
  to_object: dict[str, Any] = {}
808
+ if getv(from_object, ['function_declarations']) is not None:
809
+ setv(
810
+ to_object,
811
+ ['functionDeclarations'],
812
+ [
813
+ _FunctionDeclaration_to_mldev(api_client, item, to_object)
814
+ for item in getv(from_object, ['function_declarations'])
815
+ ],
816
+ )
817
+
459
818
  if getv(from_object, ['retrieval']) is not None:
460
819
  raise ValueError('retrieval parameter is not supported in Gemini API.')
461
820
 
@@ -487,17 +846,19 @@ def _Tool_to_mldev(
487
846
  if getv(from_object, ['google_maps']) is not None:
488
847
  raise ValueError('google_maps parameter is not supported in Gemini API.')
489
848
 
490
- if getv(from_object, ['code_execution']) is not None:
491
- setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
492
-
493
- if getv(from_object, ['function_declarations']) is not None:
849
+ if getv(from_object, ['url_context']) is not None:
494
850
  setv(
495
851
  to_object,
496
- ['functionDeclarations'],
497
- getv(from_object, ['function_declarations']),
852
+ ['urlContext'],
853
+ _UrlContext_to_mldev(
854
+ api_client, getv(from_object, ['url_context']), to_object
855
+ ),
498
856
  )
499
857
 
500
- return to_object
858
+ if getv(from_object, ['code_execution']) is not None:
859
+ setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
860
+
861
+ return to_object
501
862
 
502
863
 
503
864
  def _Tool_to_vertex(
@@ -506,6 +867,16 @@ def _Tool_to_vertex(
506
867
  parent_object: Optional[dict[str, Any]] = None,
507
868
  ) -> dict[str, Any]:
508
869
  to_object: dict[str, Any] = {}
870
+ if getv(from_object, ['function_declarations']) is not None:
871
+ setv(
872
+ to_object,
873
+ ['functionDeclarations'],
874
+ [
875
+ _FunctionDeclaration_to_vertex(api_client, item, to_object)
876
+ for item in getv(from_object, ['function_declarations'])
877
+ ],
878
+ )
879
+
509
880
  if getv(from_object, ['retrieval']) is not None:
510
881
  setv(to_object, ['retrieval'], getv(from_object, ['retrieval']))
511
882
 
@@ -547,16 +918,12 @@ def _Tool_to_vertex(
547
918
  ),
548
919
  )
549
920
 
921
+ if getv(from_object, ['url_context']) is not None:
922
+ raise ValueError('url_context parameter is not supported in Vertex AI.')
923
+
550
924
  if getv(from_object, ['code_execution']) is not None:
551
925
  setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
552
926
 
553
- if getv(from_object, ['function_declarations']) is not None:
554
- setv(
555
- to_object,
556
- ['functionDeclarations'],
557
- getv(from_object, ['function_declarations']),
558
- )
559
-
560
927
  return to_object
561
928
 
562
929
 
@@ -812,12 +1179,37 @@ def _ContextWindowCompressionConfig_to_vertex(
812
1179
  return to_object
813
1180
 
814
1181
 
1182
+ def _ProactivityConfig_to_mldev(
1183
+ api_client: BaseApiClient,
1184
+ from_object: Union[dict[str, Any], object],
1185
+ parent_object: Optional[dict[str, Any]] = None,
1186
+ ) -> dict[str, Any]:
1187
+ to_object: dict[str, Any] = {}
1188
+ if getv(from_object, ['proactive_audio']) is not None:
1189
+ setv(to_object, ['proactiveAudio'], getv(from_object, ['proactive_audio']))
1190
+
1191
+ return to_object
1192
+
1193
+
1194
+ def _ProactivityConfig_to_vertex(
1195
+ api_client: BaseApiClient,
1196
+ from_object: Union[dict[str, Any], object],
1197
+ parent_object: Optional[dict[str, Any]] = None,
1198
+ ) -> dict[str, Any]:
1199
+ to_object: dict[str, Any] = {}
1200
+ if getv(from_object, ['proactive_audio']) is not None:
1201
+ setv(to_object, ['proactiveAudio'], getv(from_object, ['proactive_audio']))
1202
+
1203
+ return to_object
1204
+
1205
+
815
1206
  def _LiveConnectConfig_to_mldev(
816
1207
  api_client: BaseApiClient,
817
1208
  from_object: Union[dict[str, Any], object],
818
1209
  parent_object: Optional[dict[str, Any]] = None,
819
1210
  ) -> dict[str, Any]:
820
1211
  to_object: dict[str, Any] = {}
1212
+
821
1213
  if getv(from_object, ['generation_config']) is not None:
822
1214
  setv(
823
1215
  parent_object,
@@ -878,7 +1270,20 @@ def _LiveConnectConfig_to_mldev(
878
1270
  setv(
879
1271
  parent_object,
880
1272
  ['setup', 'generationConfig', 'speechConfig'],
881
- getv(from_object, ['speech_config']),
1273
+ _SpeechConfig_to_mldev(
1274
+ api_client,
1275
+ t.t_live_speech_config(
1276
+ api_client, getv(from_object, ['speech_config'])
1277
+ ),
1278
+ to_object,
1279
+ ),
1280
+ )
1281
+
1282
+ if getv(from_object, ['enable_affective_dialog']) is not None:
1283
+ setv(
1284
+ parent_object,
1285
+ ['setup', 'generationConfig', 'enableAffectiveDialog'],
1286
+ getv(from_object, ['enable_affective_dialog']),
882
1287
  )
883
1288
 
884
1289
  if getv(from_object, ['system_instruction']) is not None:
@@ -953,6 +1358,15 @@ def _LiveConnectConfig_to_mldev(
953
1358
  ),
954
1359
  )
955
1360
 
1361
+ if getv(from_object, ['proactivity']) is not None:
1362
+ setv(
1363
+ parent_object,
1364
+ ['setup', 'proactivity'],
1365
+ _ProactivityConfig_to_mldev(
1366
+ api_client, getv(from_object, ['proactivity']), to_object
1367
+ ),
1368
+ )
1369
+
956
1370
  return to_object
957
1371
 
958
1372
 
@@ -962,6 +1376,7 @@ def _LiveConnectConfig_to_vertex(
962
1376
  parent_object: Optional[dict[str, Any]] = None,
963
1377
  ) -> dict[str, Any]:
964
1378
  to_object: dict[str, Any] = {}
1379
+
965
1380
  if getv(from_object, ['generation_config']) is not None:
966
1381
  setv(
967
1382
  parent_object,
@@ -1022,7 +1437,20 @@ def _LiveConnectConfig_to_vertex(
1022
1437
  setv(
1023
1438
  parent_object,
1024
1439
  ['setup', 'generationConfig', 'speechConfig'],
1025
- getv(from_object, ['speech_config']),
1440
+ _SpeechConfig_to_vertex(
1441
+ api_client,
1442
+ t.t_live_speech_config(
1443
+ api_client, getv(from_object, ['speech_config'])
1444
+ ),
1445
+ to_object,
1446
+ ),
1447
+ )
1448
+
1449
+ if getv(from_object, ['enable_affective_dialog']) is not None:
1450
+ setv(
1451
+ parent_object,
1452
+ ['setup', 'generationConfig', 'enableAffectiveDialog'],
1453
+ getv(from_object, ['enable_affective_dialog']),
1026
1454
  )
1027
1455
 
1028
1456
  if getv(from_object, ['system_instruction']) is not None:
@@ -1097,6 +1525,15 @@ def _LiveConnectConfig_to_vertex(
1097
1525
  ),
1098
1526
  )
1099
1527
 
1528
+ if getv(from_object, ['proactivity']) is not None:
1529
+ setv(
1530
+ parent_object,
1531
+ ['setup', 'proactivity'],
1532
+ _ProactivityConfig_to_vertex(
1533
+ api_client, getv(from_object, ['proactivity']), to_object
1534
+ ),
1535
+ )
1536
+
1100
1537
  return to_object
1101
1538
 
1102
1539
 
@@ -1369,6 +1806,15 @@ def _LiveClientSetup_to_mldev(
1369
1806
  ),
1370
1807
  )
1371
1808
 
1809
+ if getv(from_object, ['proactivity']) is not None:
1810
+ setv(
1811
+ to_object,
1812
+ ['proactivity'],
1813
+ _ProactivityConfig_to_mldev(
1814
+ api_client, getv(from_object, ['proactivity']), to_object
1815
+ ),
1816
+ )
1817
+
1372
1818
  return to_object
1373
1819
 
1374
1820
 
@@ -1451,6 +1897,15 @@ def _LiveClientSetup_to_vertex(
1451
1897
  ),
1452
1898
  )
1453
1899
 
1900
+ if getv(from_object, ['proactivity']) is not None:
1901
+ setv(
1902
+ to_object,
1903
+ ['proactivity'],
1904
+ _ProactivityConfig_to_vertex(
1905
+ api_client, getv(from_object, ['proactivity']), to_object
1906
+ ),
1907
+ )
1908
+
1454
1909
  return to_object
1455
1910
 
1456
1911
 
@@ -1590,6 +2045,12 @@ def _FunctionResponse_to_mldev(
1590
2045
  parent_object: Optional[dict[str, Any]] = None,
1591
2046
  ) -> dict[str, Any]:
1592
2047
  to_object: dict[str, Any] = {}
2048
+ if getv(from_object, ['will_continue']) is not None:
2049
+ setv(to_object, ['willContinue'], getv(from_object, ['will_continue']))
2050
+
2051
+ if getv(from_object, ['scheduling']) is not None:
2052
+ setv(to_object, ['scheduling'], getv(from_object, ['scheduling']))
2053
+
1593
2054
  if getv(from_object, ['id']) is not None:
1594
2055
  setv(to_object, ['id'], getv(from_object, ['id']))
1595
2056
 
@@ -1608,8 +2069,14 @@ def _FunctionResponse_to_vertex(
1608
2069
  parent_object: Optional[dict[str, Any]] = None,
1609
2070
  ) -> dict[str, Any]:
1610
2071
  to_object: dict[str, Any] = {}
2072
+ if getv(from_object, ['will_continue']) is not None:
2073
+ raise ValueError('will_continue parameter is not supported in Vertex AI.')
2074
+
2075
+ if getv(from_object, ['scheduling']) is not None:
2076
+ raise ValueError('scheduling parameter is not supported in Vertex AI.')
2077
+
1611
2078
  if getv(from_object, ['id']) is not None:
1612
- raise ValueError('id parameter is not supported in Vertex AI.')
2079
+ setv(to_object, ['id'], getv(from_object, ['id']))
1613
2080
 
1614
2081
  if getv(from_object, ['name']) is not None:
1615
2082
  setv(to_object, ['name'], getv(from_object, ['name']))
@@ -1748,6 +2215,354 @@ def _LiveClientMessage_to_vertex(
1748
2215
  return to_object
1749
2216
 
1750
2217
 
2218
+ def _LiveMusicConnectParameters_to_mldev(
2219
+ api_client: BaseApiClient,
2220
+ from_object: Union[dict[str, Any], object],
2221
+ parent_object: Optional[dict[str, Any]] = None,
2222
+ ) -> dict[str, Any]:
2223
+ to_object: dict[str, Any] = {}
2224
+ if getv(from_object, ['model']) is not None:
2225
+ setv(to_object, ['setup', 'model'], getv(from_object, ['model']))
2226
+
2227
+ return to_object
2228
+
2229
+
2230
+ def _LiveMusicConnectParameters_to_vertex(
2231
+ api_client: BaseApiClient,
2232
+ from_object: Union[dict[str, Any], object],
2233
+ parent_object: Optional[dict[str, Any]] = None,
2234
+ ) -> dict[str, Any]:
2235
+ to_object: dict[str, Any] = {}
2236
+ if getv(from_object, ['model']) is not None:
2237
+ raise ValueError('model parameter is not supported in Vertex AI.')
2238
+
2239
+ return to_object
2240
+
2241
+
2242
+ def _WeightedPrompt_to_mldev(
2243
+ api_client: BaseApiClient,
2244
+ from_object: Union[dict[str, Any], object],
2245
+ parent_object: Optional[dict[str, Any]] = None,
2246
+ ) -> dict[str, Any]:
2247
+ to_object: dict[str, Any] = {}
2248
+ if getv(from_object, ['text']) is not None:
2249
+ setv(to_object, ['text'], getv(from_object, ['text']))
2250
+
2251
+ if getv(from_object, ['weight']) is not None:
2252
+ setv(to_object, ['weight'], getv(from_object, ['weight']))
2253
+
2254
+ return to_object
2255
+
2256
+
2257
+ def _WeightedPrompt_to_vertex(
2258
+ api_client: BaseApiClient,
2259
+ from_object: Union[dict[str, Any], object],
2260
+ parent_object: Optional[dict[str, Any]] = None,
2261
+ ) -> dict[str, Any]:
2262
+ to_object: dict[str, Any] = {}
2263
+ if getv(from_object, ['text']) is not None:
2264
+ raise ValueError('text parameter is not supported in Vertex AI.')
2265
+
2266
+ if getv(from_object, ['weight']) is not None:
2267
+ raise ValueError('weight parameter is not supported in Vertex AI.')
2268
+
2269
+ return to_object
2270
+
2271
+
2272
+ def _LiveMusicSetWeightedPromptsParameters_to_mldev(
2273
+ api_client: BaseApiClient,
2274
+ from_object: Union[dict[str, Any], object],
2275
+ parent_object: Optional[dict[str, Any]] = None,
2276
+ ) -> dict[str, Any]:
2277
+ to_object: dict[str, Any] = {}
2278
+ if getv(from_object, ['weighted_prompts']) is not None:
2279
+ setv(
2280
+ to_object,
2281
+ ['weightedPrompts'],
2282
+ [
2283
+ _WeightedPrompt_to_mldev(api_client, item, to_object)
2284
+ for item in getv(from_object, ['weighted_prompts'])
2285
+ ],
2286
+ )
2287
+
2288
+ return to_object
2289
+
2290
+
2291
+ def _LiveMusicSetWeightedPromptsParameters_to_vertex(
2292
+ api_client: BaseApiClient,
2293
+ from_object: Union[dict[str, Any], object],
2294
+ parent_object: Optional[dict[str, Any]] = None,
2295
+ ) -> dict[str, Any]:
2296
+ to_object: dict[str, Any] = {}
2297
+ if getv(from_object, ['weighted_prompts']) is not None:
2298
+ raise ValueError(
2299
+ 'weighted_prompts parameter is not supported in Vertex AI.'
2300
+ )
2301
+
2302
+ return to_object
2303
+
2304
+
2305
+ def _LiveMusicGenerationConfig_to_mldev(
2306
+ api_client: BaseApiClient,
2307
+ from_object: Union[dict[str, Any], object],
2308
+ parent_object: Optional[dict[str, Any]] = None,
2309
+ ) -> dict[str, Any]:
2310
+ to_object: dict[str, Any] = {}
2311
+ if getv(from_object, ['temperature']) is not None:
2312
+ setv(to_object, ['temperature'], getv(from_object, ['temperature']))
2313
+
2314
+ if getv(from_object, ['top_k']) is not None:
2315
+ setv(to_object, ['topK'], getv(from_object, ['top_k']))
2316
+
2317
+ if getv(from_object, ['seed']) is not None:
2318
+ setv(to_object, ['seed'], getv(from_object, ['seed']))
2319
+
2320
+ if getv(from_object, ['guidance']) is not None:
2321
+ setv(to_object, ['guidance'], getv(from_object, ['guidance']))
2322
+
2323
+ if getv(from_object, ['bpm']) is not None:
2324
+ setv(to_object, ['bpm'], getv(from_object, ['bpm']))
2325
+
2326
+ if getv(from_object, ['density']) is not None:
2327
+ setv(to_object, ['density'], getv(from_object, ['density']))
2328
+
2329
+ if getv(from_object, ['brightness']) is not None:
2330
+ setv(to_object, ['brightness'], getv(from_object, ['brightness']))
2331
+
2332
+ if getv(from_object, ['scale']) is not None:
2333
+ setv(to_object, ['scale'], getv(from_object, ['scale']))
2334
+
2335
+ if getv(from_object, ['mute_bass']) is not None:
2336
+ setv(to_object, ['muteBass'], getv(from_object, ['mute_bass']))
2337
+
2338
+ if getv(from_object, ['mute_drums']) is not None:
2339
+ setv(to_object, ['muteDrums'], getv(from_object, ['mute_drums']))
2340
+
2341
+ if getv(from_object, ['only_bass_and_drums']) is not None:
2342
+ setv(
2343
+ to_object,
2344
+ ['onlyBassAndDrums'],
2345
+ getv(from_object, ['only_bass_and_drums']),
2346
+ )
2347
+
2348
+ if getv(from_object, ['music_generation_mode']) is not None:
2349
+ setv(
2350
+ to_object,
2351
+ ['musicGenerationMode'],
2352
+ getv(from_object, ['music_generation_mode']),
2353
+ )
2354
+
2355
+ return to_object
2356
+
2357
+
2358
+ def _LiveMusicGenerationConfig_to_vertex(
2359
+ api_client: BaseApiClient,
2360
+ from_object: Union[dict[str, Any], object],
2361
+ parent_object: Optional[dict[str, Any]] = None,
2362
+ ) -> dict[str, Any]:
2363
+ to_object: dict[str, Any] = {}
2364
+ if getv(from_object, ['temperature']) is not None:
2365
+ raise ValueError('temperature parameter is not supported in Vertex AI.')
2366
+
2367
+ if getv(from_object, ['top_k']) is not None:
2368
+ raise ValueError('top_k parameter is not supported in Vertex AI.')
2369
+
2370
+ if getv(from_object, ['seed']) is not None:
2371
+ raise ValueError('seed parameter is not supported in Vertex AI.')
2372
+
2373
+ if getv(from_object, ['guidance']) is not None:
2374
+ raise ValueError('guidance parameter is not supported in Vertex AI.')
2375
+
2376
+ if getv(from_object, ['bpm']) is not None:
2377
+ raise ValueError('bpm parameter is not supported in Vertex AI.')
2378
+
2379
+ if getv(from_object, ['density']) is not None:
2380
+ raise ValueError('density parameter is not supported in Vertex AI.')
2381
+
2382
+ if getv(from_object, ['brightness']) is not None:
2383
+ raise ValueError('brightness parameter is not supported in Vertex AI.')
2384
+
2385
+ if getv(from_object, ['scale']) is not None:
2386
+ raise ValueError('scale parameter is not supported in Vertex AI.')
2387
+
2388
+ if getv(from_object, ['mute_bass']) is not None:
2389
+ raise ValueError('mute_bass parameter is not supported in Vertex AI.')
2390
+
2391
+ if getv(from_object, ['mute_drums']) is not None:
2392
+ raise ValueError('mute_drums parameter is not supported in Vertex AI.')
2393
+
2394
+ if getv(from_object, ['only_bass_and_drums']) is not None:
2395
+ raise ValueError(
2396
+ 'only_bass_and_drums parameter is not supported in Vertex AI.'
2397
+ )
2398
+
2399
+ if getv(from_object, ['music_generation_mode']) is not None:
2400
+ raise ValueError(
2401
+ 'music_generation_mode parameter is not supported in Vertex AI.'
2402
+ )
2403
+
2404
+ return to_object
2405
+
2406
+
2407
+ def _LiveMusicSetConfigParameters_to_mldev(
2408
+ api_client: BaseApiClient,
2409
+ from_object: Union[dict[str, Any], object],
2410
+ parent_object: Optional[dict[str, Any]] = None,
2411
+ ) -> dict[str, Any]:
2412
+ to_object: dict[str, Any] = {}
2413
+ if getv(from_object, ['music_generation_config']) is not None:
2414
+ setv(
2415
+ to_object,
2416
+ ['musicGenerationConfig'],
2417
+ _LiveMusicGenerationConfig_to_mldev(
2418
+ api_client,
2419
+ getv(from_object, ['music_generation_config']),
2420
+ to_object,
2421
+ ),
2422
+ )
2423
+
2424
+ return to_object
2425
+
2426
+
2427
+ def _LiveMusicSetConfigParameters_to_vertex(
2428
+ api_client: BaseApiClient,
2429
+ from_object: Union[dict[str, Any], object],
2430
+ parent_object: Optional[dict[str, Any]] = None,
2431
+ ) -> dict[str, Any]:
2432
+ to_object: dict[str, Any] = {}
2433
+ if getv(from_object, ['music_generation_config']) is not None:
2434
+ raise ValueError(
2435
+ 'music_generation_config parameter is not supported in Vertex AI.'
2436
+ )
2437
+
2438
+ return to_object
2439
+
2440
+
2441
+ def _LiveMusicClientSetup_to_mldev(
2442
+ api_client: BaseApiClient,
2443
+ from_object: Union[dict[str, Any], object],
2444
+ parent_object: Optional[dict[str, Any]] = None,
2445
+ ) -> dict[str, Any]:
2446
+ to_object: dict[str, Any] = {}
2447
+ if getv(from_object, ['model']) is not None:
2448
+ setv(to_object, ['model'], getv(from_object, ['model']))
2449
+
2450
+ return to_object
2451
+
2452
+
2453
+ def _LiveMusicClientSetup_to_vertex(
2454
+ api_client: BaseApiClient,
2455
+ from_object: Union[dict[str, Any], object],
2456
+ parent_object: Optional[dict[str, Any]] = None,
2457
+ ) -> dict[str, Any]:
2458
+ to_object: dict[str, Any] = {}
2459
+ if getv(from_object, ['model']) is not None:
2460
+ raise ValueError('model parameter is not supported in Vertex AI.')
2461
+
2462
+ return to_object
2463
+
2464
+
2465
+ def _LiveMusicClientContent_to_mldev(
2466
+ api_client: BaseApiClient,
2467
+ from_object: Union[dict[str, Any], object],
2468
+ parent_object: Optional[dict[str, Any]] = None,
2469
+ ) -> dict[str, Any]:
2470
+ to_object: dict[str, Any] = {}
2471
+ if getv(from_object, ['weighted_prompts']) is not None:
2472
+ setv(
2473
+ to_object,
2474
+ ['weightedPrompts'],
2475
+ [
2476
+ _WeightedPrompt_to_mldev(api_client, item, to_object)
2477
+ for item in getv(from_object, ['weighted_prompts'])
2478
+ ],
2479
+ )
2480
+
2481
+ return to_object
2482
+
2483
+
2484
+ def _LiveMusicClientContent_to_vertex(
2485
+ api_client: BaseApiClient,
2486
+ from_object: Union[dict[str, Any], object],
2487
+ parent_object: Optional[dict[str, Any]] = None,
2488
+ ) -> dict[str, Any]:
2489
+ to_object: dict[str, Any] = {}
2490
+ if getv(from_object, ['weighted_prompts']) is not None:
2491
+ raise ValueError(
2492
+ 'weighted_prompts parameter is not supported in Vertex AI.'
2493
+ )
2494
+
2495
+ return to_object
2496
+
2497
+
2498
+ def _LiveMusicClientMessage_to_mldev(
2499
+ api_client: BaseApiClient,
2500
+ from_object: Union[dict[str, Any], object],
2501
+ parent_object: Optional[dict[str, Any]] = None,
2502
+ ) -> dict[str, Any]:
2503
+ to_object: dict[str, Any] = {}
2504
+ if getv(from_object, ['setup']) is not None:
2505
+ setv(
2506
+ to_object,
2507
+ ['setup'],
2508
+ _LiveMusicClientSetup_to_mldev(
2509
+ api_client, getv(from_object, ['setup']), to_object
2510
+ ),
2511
+ )
2512
+
2513
+ if getv(from_object, ['client_content']) is not None:
2514
+ setv(
2515
+ to_object,
2516
+ ['clientContent'],
2517
+ _LiveMusicClientContent_to_mldev(
2518
+ api_client, getv(from_object, ['client_content']), to_object
2519
+ ),
2520
+ )
2521
+
2522
+ if getv(from_object, ['music_generation_config']) is not None:
2523
+ setv(
2524
+ to_object,
2525
+ ['musicGenerationConfig'],
2526
+ _LiveMusicGenerationConfig_to_mldev(
2527
+ api_client,
2528
+ getv(from_object, ['music_generation_config']),
2529
+ to_object,
2530
+ ),
2531
+ )
2532
+
2533
+ if getv(from_object, ['playback_control']) is not None:
2534
+ setv(
2535
+ to_object, ['playbackControl'], getv(from_object, ['playback_control'])
2536
+ )
2537
+
2538
+ return to_object
2539
+
2540
+
2541
+ def _LiveMusicClientMessage_to_vertex(
2542
+ api_client: BaseApiClient,
2543
+ from_object: Union[dict[str, Any], object],
2544
+ parent_object: Optional[dict[str, Any]] = None,
2545
+ ) -> dict[str, Any]:
2546
+ to_object: dict[str, Any] = {}
2547
+ if getv(from_object, ['setup']) is not None:
2548
+ raise ValueError('setup parameter is not supported in Vertex AI.')
2549
+
2550
+ if getv(from_object, ['client_content']) is not None:
2551
+ raise ValueError('client_content parameter is not supported in Vertex AI.')
2552
+
2553
+ if getv(from_object, ['music_generation_config']) is not None:
2554
+ raise ValueError(
2555
+ 'music_generation_config parameter is not supported in Vertex AI.'
2556
+ )
2557
+
2558
+ if getv(from_object, ['playback_control']) is not None:
2559
+ raise ValueError(
2560
+ 'playback_control parameter is not supported in Vertex AI.'
2561
+ )
2562
+
2563
+ return to_object
2564
+
2565
+
1751
2566
  def _LiveServerSetupComplete_from_mldev(
1752
2567
  api_client: BaseApiClient,
1753
2568
  from_object: Union[dict[str, Any], object],
@@ -1768,6 +2583,42 @@ def _LiveServerSetupComplete_from_vertex(
1768
2583
  return to_object
1769
2584
 
1770
2585
 
2586
+ def _VideoMetadata_from_mldev(
2587
+ api_client: BaseApiClient,
2588
+ from_object: Union[dict[str, Any], object],
2589
+ parent_object: Optional[dict[str, Any]] = None,
2590
+ ) -> dict[str, Any]:
2591
+ to_object: dict[str, Any] = {}
2592
+ if getv(from_object, ['fps']) is not None:
2593
+ setv(to_object, ['fps'], getv(from_object, ['fps']))
2594
+
2595
+ if getv(from_object, ['endOffset']) is not None:
2596
+ setv(to_object, ['end_offset'], getv(from_object, ['endOffset']))
2597
+
2598
+ if getv(from_object, ['startOffset']) is not None:
2599
+ setv(to_object, ['start_offset'], getv(from_object, ['startOffset']))
2600
+
2601
+ return to_object
2602
+
2603
+
2604
+ def _VideoMetadata_from_vertex(
2605
+ api_client: BaseApiClient,
2606
+ from_object: Union[dict[str, Any], object],
2607
+ parent_object: Optional[dict[str, Any]] = None,
2608
+ ) -> dict[str, Any]:
2609
+ to_object: dict[str, Any] = {}
2610
+ if getv(from_object, ['fps']) is not None:
2611
+ setv(to_object, ['fps'], getv(from_object, ['fps']))
2612
+
2613
+ if getv(from_object, ['endOffset']) is not None:
2614
+ setv(to_object, ['end_offset'], getv(from_object, ['endOffset']))
2615
+
2616
+ if getv(from_object, ['startOffset']) is not None:
2617
+ setv(to_object, ['start_offset'], getv(from_object, ['startOffset']))
2618
+
2619
+ return to_object
2620
+
2621
+
1771
2622
  def _Blob_from_mldev(
1772
2623
  api_client: BaseApiClient,
1773
2624
  from_object: Union[dict[str, Any], object],
@@ -1808,6 +2659,14 @@ def _Part_from_mldev(
1808
2659
  parent_object: Optional[dict[str, Any]] = None,
1809
2660
  ) -> dict[str, Any]:
1810
2661
  to_object: dict[str, Any] = {}
2662
+ if getv(from_object, ['videoMetadata']) is not None:
2663
+ setv(
2664
+ to_object,
2665
+ ['video_metadata'],
2666
+ _VideoMetadata_from_mldev(
2667
+ api_client, getv(from_object, ['videoMetadata']), to_object
2668
+ ),
2669
+ )
1811
2670
 
1812
2671
  if getv(from_object, ['thought']) is not None:
1813
2672
  setv(to_object, ['thought'], getv(from_object, ['thought']))
@@ -1857,7 +2716,13 @@ def _Part_from_vertex(
1857
2716
  ) -> dict[str, Any]:
1858
2717
  to_object: dict[str, Any] = {}
1859
2718
  if getv(from_object, ['videoMetadata']) is not None:
1860
- setv(to_object, ['video_metadata'], getv(from_object, ['videoMetadata']))
2719
+ setv(
2720
+ to_object,
2721
+ ['video_metadata'],
2722
+ _VideoMetadata_from_vertex(
2723
+ api_client, getv(from_object, ['videoMetadata']), to_object
2724
+ ),
2725
+ )
1861
2726
 
1862
2727
  if getv(from_object, ['thought']) is not None:
1863
2728
  setv(to_object, ['thought'], getv(from_object, ['thought']))
@@ -1974,6 +2839,82 @@ def _Transcription_from_vertex(
1974
2839
  return to_object
1975
2840
 
1976
2841
 
2842
+ def _UrlMetadata_from_mldev(
2843
+ api_client: BaseApiClient,
2844
+ from_object: Union[dict[str, Any], object],
2845
+ parent_object: Optional[dict[str, Any]] = None,
2846
+ ) -> dict[str, Any]:
2847
+ to_object: dict[str, Any] = {}
2848
+ if getv(from_object, ['retrievedUrl']) is not None:
2849
+ setv(to_object, ['retrieved_url'], getv(from_object, ['retrievedUrl']))
2850
+
2851
+ if getv(from_object, ['urlRetrievalStatus']) is not None:
2852
+ setv(
2853
+ to_object,
2854
+ ['url_retrieval_status'],
2855
+ getv(from_object, ['urlRetrievalStatus']),
2856
+ )
2857
+
2858
+ return to_object
2859
+
2860
+
2861
+ def _UrlMetadata_from_vertex(
2862
+ api_client: BaseApiClient,
2863
+ from_object: Union[dict[str, Any], object],
2864
+ parent_object: Optional[dict[str, Any]] = None,
2865
+ ) -> dict[str, Any]:
2866
+ to_object: dict[str, Any] = {}
2867
+ if getv(from_object, ['retrievedUrl']) is not None:
2868
+ setv(to_object, ['retrieved_url'], getv(from_object, ['retrievedUrl']))
2869
+
2870
+ if getv(from_object, ['urlRetrievalStatus']) is not None:
2871
+ setv(
2872
+ to_object,
2873
+ ['url_retrieval_status'],
2874
+ getv(from_object, ['urlRetrievalStatus']),
2875
+ )
2876
+
2877
+ return to_object
2878
+
2879
+
2880
+ def _UrlContextMetadata_from_mldev(
2881
+ api_client: BaseApiClient,
2882
+ from_object: Union[dict[str, Any], object],
2883
+ parent_object: Optional[dict[str, Any]] = None,
2884
+ ) -> dict[str, Any]:
2885
+ to_object: dict[str, Any] = {}
2886
+ if getv(from_object, ['urlMetadata']) is not None:
2887
+ setv(
2888
+ to_object,
2889
+ ['url_metadata'],
2890
+ [
2891
+ _UrlMetadata_from_mldev(api_client, item, to_object)
2892
+ for item in getv(from_object, ['urlMetadata'])
2893
+ ],
2894
+ )
2895
+
2896
+ return to_object
2897
+
2898
+
2899
+ def _UrlContextMetadata_from_vertex(
2900
+ api_client: BaseApiClient,
2901
+ from_object: Union[dict[str, Any], object],
2902
+ parent_object: Optional[dict[str, Any]] = None,
2903
+ ) -> dict[str, Any]:
2904
+ to_object: dict[str, Any] = {}
2905
+ if getv(from_object, ['urlMetadata']) is not None:
2906
+ setv(
2907
+ to_object,
2908
+ ['url_metadata'],
2909
+ [
2910
+ _UrlMetadata_from_vertex(api_client, item, to_object)
2911
+ for item in getv(from_object, ['urlMetadata'])
2912
+ ],
2913
+ )
2914
+
2915
+ return to_object
2916
+
2917
+
1977
2918
  def _LiveServerContent_from_mldev(
1978
2919
  api_client: BaseApiClient,
1979
2920
  from_object: Union[dict[str, Any], object],
@@ -2027,6 +2968,15 @@ def _LiveServerContent_from_mldev(
2027
2968
  ),
2028
2969
  )
2029
2970
 
2971
+ if getv(from_object, ['urlContextMetadata']) is not None:
2972
+ setv(
2973
+ to_object,
2974
+ ['url_context_metadata'],
2975
+ _UrlContextMetadata_from_mldev(
2976
+ api_client, getv(from_object, ['urlContextMetadata']), to_object
2977
+ ),
2978
+ )
2979
+
2030
2980
  return to_object
2031
2981
 
2032
2982
 
@@ -2607,3 +3557,328 @@ def _LiveServerMessage_from_vertex(
2607
3557
  )
2608
3558
 
2609
3559
  return to_object
3560
+
3561
+
3562
+ def _LiveMusicServerSetupComplete_from_mldev(
3563
+ api_client: BaseApiClient,
3564
+ from_object: Union[dict[str, Any], object],
3565
+ parent_object: Optional[dict[str, Any]] = None,
3566
+ ) -> dict[str, Any]:
3567
+ to_object: dict[str, Any] = {}
3568
+
3569
+ return to_object
3570
+
3571
+
3572
+ def _LiveMusicServerSetupComplete_from_vertex(
3573
+ api_client: BaseApiClient,
3574
+ from_object: Union[dict[str, Any], object],
3575
+ parent_object: Optional[dict[str, Any]] = None,
3576
+ ) -> dict[str, Any]:
3577
+ to_object: dict[str, Any] = {}
3578
+
3579
+ return to_object
3580
+
3581
+
3582
+ def _WeightedPrompt_from_mldev(
3583
+ api_client: BaseApiClient,
3584
+ from_object: Union[dict[str, Any], object],
3585
+ parent_object: Optional[dict[str, Any]] = None,
3586
+ ) -> dict[str, Any]:
3587
+ to_object: dict[str, Any] = {}
3588
+ if getv(from_object, ['text']) is not None:
3589
+ setv(to_object, ['text'], getv(from_object, ['text']))
3590
+
3591
+ if getv(from_object, ['weight']) is not None:
3592
+ setv(to_object, ['weight'], getv(from_object, ['weight']))
3593
+
3594
+ return to_object
3595
+
3596
+
3597
+ def _WeightedPrompt_from_vertex(
3598
+ api_client: BaseApiClient,
3599
+ from_object: Union[dict[str, Any], object],
3600
+ parent_object: Optional[dict[str, Any]] = None,
3601
+ ) -> dict[str, Any]:
3602
+ to_object: dict[str, Any] = {}
3603
+
3604
+ return to_object
3605
+
3606
+
3607
+ def _LiveMusicClientContent_from_mldev(
3608
+ api_client: BaseApiClient,
3609
+ from_object: Union[dict[str, Any], object],
3610
+ parent_object: Optional[dict[str, Any]] = None,
3611
+ ) -> dict[str, Any]:
3612
+ to_object: dict[str, Any] = {}
3613
+ if getv(from_object, ['weightedPrompts']) is not None:
3614
+ setv(
3615
+ to_object,
3616
+ ['weighted_prompts'],
3617
+ [
3618
+ _WeightedPrompt_from_mldev(api_client, item, to_object)
3619
+ for item in getv(from_object, ['weightedPrompts'])
3620
+ ],
3621
+ )
3622
+
3623
+ return to_object
3624
+
3625
+
3626
+ def _LiveMusicClientContent_from_vertex(
3627
+ api_client: BaseApiClient,
3628
+ from_object: Union[dict[str, Any], object],
3629
+ parent_object: Optional[dict[str, Any]] = None,
3630
+ ) -> dict[str, Any]:
3631
+ to_object: dict[str, Any] = {}
3632
+
3633
+ return to_object
3634
+
3635
+
3636
+ def _LiveMusicGenerationConfig_from_mldev(
3637
+ api_client: BaseApiClient,
3638
+ from_object: Union[dict[str, Any], object],
3639
+ parent_object: Optional[dict[str, Any]] = None,
3640
+ ) -> dict[str, Any]:
3641
+ to_object: dict[str, Any] = {}
3642
+ if getv(from_object, ['temperature']) is not None:
3643
+ setv(to_object, ['temperature'], getv(from_object, ['temperature']))
3644
+
3645
+ if getv(from_object, ['topK']) is not None:
3646
+ setv(to_object, ['top_k'], getv(from_object, ['topK']))
3647
+
3648
+ if getv(from_object, ['seed']) is not None:
3649
+ setv(to_object, ['seed'], getv(from_object, ['seed']))
3650
+
3651
+ if getv(from_object, ['guidance']) is not None:
3652
+ setv(to_object, ['guidance'], getv(from_object, ['guidance']))
3653
+
3654
+ if getv(from_object, ['bpm']) is not None:
3655
+ setv(to_object, ['bpm'], getv(from_object, ['bpm']))
3656
+
3657
+ if getv(from_object, ['density']) is not None:
3658
+ setv(to_object, ['density'], getv(from_object, ['density']))
3659
+
3660
+ if getv(from_object, ['brightness']) is not None:
3661
+ setv(to_object, ['brightness'], getv(from_object, ['brightness']))
3662
+
3663
+ if getv(from_object, ['scale']) is not None:
3664
+ setv(to_object, ['scale'], getv(from_object, ['scale']))
3665
+
3666
+ if getv(from_object, ['muteBass']) is not None:
3667
+ setv(to_object, ['mute_bass'], getv(from_object, ['muteBass']))
3668
+
3669
+ if getv(from_object, ['muteDrums']) is not None:
3670
+ setv(to_object, ['mute_drums'], getv(from_object, ['muteDrums']))
3671
+
3672
+ if getv(from_object, ['onlyBassAndDrums']) is not None:
3673
+ setv(
3674
+ to_object,
3675
+ ['only_bass_and_drums'],
3676
+ getv(from_object, ['onlyBassAndDrums']),
3677
+ )
3678
+
3679
+ if getv(from_object, ['musicGenerationMode']) is not None:
3680
+ setv(
3681
+ to_object,
3682
+ ['music_generation_mode'],
3683
+ getv(from_object, ['musicGenerationMode']),
3684
+ )
3685
+
3686
+ return to_object
3687
+
3688
+
3689
+ def _LiveMusicGenerationConfig_from_vertex(
3690
+ api_client: BaseApiClient,
3691
+ from_object: Union[dict[str, Any], object],
3692
+ parent_object: Optional[dict[str, Any]] = None,
3693
+ ) -> dict[str, Any]:
3694
+ to_object: dict[str, Any] = {}
3695
+
3696
+ return to_object
3697
+
3698
+
3699
+ def _LiveMusicSourceMetadata_from_mldev(
3700
+ api_client: BaseApiClient,
3701
+ from_object: Union[dict[str, Any], object],
3702
+ parent_object: Optional[dict[str, Any]] = None,
3703
+ ) -> dict[str, Any]:
3704
+ to_object: dict[str, Any] = {}
3705
+ if getv(from_object, ['clientContent']) is not None:
3706
+ setv(
3707
+ to_object,
3708
+ ['client_content'],
3709
+ _LiveMusicClientContent_from_mldev(
3710
+ api_client, getv(from_object, ['clientContent']), to_object
3711
+ ),
3712
+ )
3713
+
3714
+ if getv(from_object, ['musicGenerationConfig']) is not None:
3715
+ setv(
3716
+ to_object,
3717
+ ['music_generation_config'],
3718
+ _LiveMusicGenerationConfig_from_mldev(
3719
+ api_client, getv(from_object, ['musicGenerationConfig']), to_object
3720
+ ),
3721
+ )
3722
+
3723
+ return to_object
3724
+
3725
+
3726
+ def _LiveMusicSourceMetadata_from_vertex(
3727
+ api_client: BaseApiClient,
3728
+ from_object: Union[dict[str, Any], object],
3729
+ parent_object: Optional[dict[str, Any]] = None,
3730
+ ) -> dict[str, Any]:
3731
+ to_object: dict[str, Any] = {}
3732
+ if getv(from_object, ['clientContent']) is not None:
3733
+ setv(
3734
+ to_object,
3735
+ ['client_content'],
3736
+ _LiveMusicClientContent_from_vertex(
3737
+ api_client, getv(from_object, ['clientContent']), to_object
3738
+ ),
3739
+ )
3740
+
3741
+ if getv(from_object, ['musicGenerationConfig']) is not None:
3742
+ setv(
3743
+ to_object,
3744
+ ['music_generation_config'],
3745
+ _LiveMusicGenerationConfig_from_vertex(
3746
+ api_client, getv(from_object, ['musicGenerationConfig']), to_object
3747
+ ),
3748
+ )
3749
+
3750
+ return to_object
3751
+
3752
+
3753
+ def _AudioChunk_from_mldev(
3754
+ api_client: BaseApiClient,
3755
+ from_object: Union[dict[str, Any], object],
3756
+ parent_object: Optional[dict[str, Any]] = None,
3757
+ ) -> dict[str, Any]:
3758
+ to_object: dict[str, Any] = {}
3759
+ if getv(from_object, ['data']) is not None:
3760
+ setv(to_object, ['data'], getv(from_object, ['data']))
3761
+
3762
+ if getv(from_object, ['mimeType']) is not None:
3763
+ setv(to_object, ['mime_type'], getv(from_object, ['mimeType']))
3764
+
3765
+ if getv(from_object, ['sourceMetadata']) is not None:
3766
+ setv(
3767
+ to_object,
3768
+ ['source_metadata'],
3769
+ _LiveMusicSourceMetadata_from_mldev(
3770
+ api_client, getv(from_object, ['sourceMetadata']), to_object
3771
+ ),
3772
+ )
3773
+
3774
+ return to_object
3775
+
3776
+
3777
+ def _AudioChunk_from_vertex(
3778
+ api_client: BaseApiClient,
3779
+ from_object: Union[dict[str, Any], object],
3780
+ parent_object: Optional[dict[str, Any]] = None,
3781
+ ) -> dict[str, Any]:
3782
+ to_object: dict[str, Any] = {}
3783
+
3784
+ return to_object
3785
+
3786
+
3787
+ def _LiveMusicServerContent_from_mldev(
3788
+ api_client: BaseApiClient,
3789
+ from_object: Union[dict[str, Any], object],
3790
+ parent_object: Optional[dict[str, Any]] = None,
3791
+ ) -> dict[str, Any]:
3792
+ to_object: dict[str, Any] = {}
3793
+ if getv(from_object, ['audioChunks']) is not None:
3794
+ setv(
3795
+ to_object,
3796
+ ['audio_chunks'],
3797
+ [
3798
+ _AudioChunk_from_mldev(api_client, item, to_object)
3799
+ for item in getv(from_object, ['audioChunks'])
3800
+ ],
3801
+ )
3802
+
3803
+ return to_object
3804
+
3805
+
3806
+ def _LiveMusicServerContent_from_vertex(
3807
+ api_client: BaseApiClient,
3808
+ from_object: Union[dict[str, Any], object],
3809
+ parent_object: Optional[dict[str, Any]] = None,
3810
+ ) -> dict[str, Any]:
3811
+ to_object: dict[str, Any] = {}
3812
+
3813
+ return to_object
3814
+
3815
+
3816
+ def _LiveMusicFilteredPrompt_from_mldev(
3817
+ api_client: BaseApiClient,
3818
+ from_object: Union[dict[str, Any], object],
3819
+ parent_object: Optional[dict[str, Any]] = None,
3820
+ ) -> dict[str, Any]:
3821
+ to_object: dict[str, Any] = {}
3822
+ if getv(from_object, ['text']) is not None:
3823
+ setv(to_object, ['text'], getv(from_object, ['text']))
3824
+
3825
+ if getv(from_object, ['filteredReason']) is not None:
3826
+ setv(to_object, ['filtered_reason'], getv(from_object, ['filteredReason']))
3827
+
3828
+ return to_object
3829
+
3830
+
3831
+ def _LiveMusicFilteredPrompt_from_vertex(
3832
+ api_client: BaseApiClient,
3833
+ from_object: Union[dict[str, Any], object],
3834
+ parent_object: Optional[dict[str, Any]] = None,
3835
+ ) -> dict[str, Any]:
3836
+ to_object: dict[str, Any] = {}
3837
+
3838
+ return to_object
3839
+
3840
+
3841
+ def _LiveMusicServerMessage_from_mldev(
3842
+ api_client: BaseApiClient,
3843
+ from_object: Union[dict[str, Any], object],
3844
+ parent_object: Optional[dict[str, Any]] = None,
3845
+ ) -> dict[str, Any]:
3846
+ to_object: dict[str, Any] = {}
3847
+ if getv(from_object, ['setupComplete']) is not None:
3848
+ setv(
3849
+ to_object,
3850
+ ['setup_complete'],
3851
+ _LiveMusicServerSetupComplete_from_mldev(
3852
+ api_client, getv(from_object, ['setupComplete']), to_object
3853
+ ),
3854
+ )
3855
+
3856
+ if getv(from_object, ['serverContent']) is not None:
3857
+ setv(
3858
+ to_object,
3859
+ ['server_content'],
3860
+ _LiveMusicServerContent_from_mldev(
3861
+ api_client, getv(from_object, ['serverContent']), to_object
3862
+ ),
3863
+ )
3864
+
3865
+ if getv(from_object, ['filteredPrompt']) is not None:
3866
+ setv(
3867
+ to_object,
3868
+ ['filtered_prompt'],
3869
+ _LiveMusicFilteredPrompt_from_mldev(
3870
+ api_client, getv(from_object, ['filteredPrompt']), to_object
3871
+ ),
3872
+ )
3873
+
3874
+ return to_object
3875
+
3876
+
3877
+ def _LiveMusicServerMessage_from_vertex(
3878
+ api_client: BaseApiClient,
3879
+ from_object: Union[dict[str, Any], object],
3880
+ parent_object: Optional[dict[str, Any]] = None,
3881
+ ) -> dict[str, Any]:
3882
+ to_object: dict[str, Any] = {}
3883
+
3884
+ return to_object