google-genai 1.14.0__py3-none-any.whl → 1.16.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/__init__.py +5 -3
- google/genai/_adapters.py +55 -0
- google/genai/_api_client.py +24 -20
- google/genai/_api_module.py +1 -1
- google/genai/_automatic_function_calling_util.py +2 -2
- google/genai/_common.py +1 -1
- google/genai/_extra_utils.py +117 -9
- google/genai/_live_converters.py +2127 -758
- google/genai/_mcp_utils.py +117 -0
- google/genai/_replay_api_client.py +1 -1
- google/genai/_test_api_client.py +1 -1
- google/genai/_tokens_converters.py +1701 -0
- google/genai/_transformers.py +66 -33
- google/genai/caches.py +277 -26
- google/genai/chats.py +1 -1
- google/genai/client.py +12 -1
- google/genai/errors.py +1 -1
- google/genai/live.py +218 -35
- google/genai/live_music.py +201 -0
- google/genai/models.py +670 -56
- google/genai/pagers.py +1 -1
- google/genai/tokens.py +357 -0
- google/genai/tunings.py +53 -0
- google/genai/types.py +4892 -3606
- google/genai/version.py +2 -2
- {google_genai-1.14.0.dist-info → google_genai-1.16.0.dist-info}/METADATA +111 -22
- google_genai-1.16.0.dist-info/RECORD +35 -0
- {google_genai-1.14.0.dist-info → google_genai-1.16.0.dist-info}/WHEEL +1 -1
- google_genai-1.14.0.dist-info/RECORD +0 -30
- {google_genai-1.14.0.dist-info → google_genai-1.16.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.14.0.dist-info → google_genai-1.16.0.dist-info}/top_level.txt +0 -0
google/genai/_live_converters.py
CHANGED
@@ -22,715 +22,1130 @@ 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
|
25
|
+
def _PrebuiltVoiceConfig_to_mldev(
|
26
26
|
api_client: BaseApiClient,
|
27
27
|
from_object: Union[dict[str, Any], object],
|
28
28
|
parent_object: Optional[dict[str, Any]] = None,
|
29
29
|
) -> dict[str, Any]:
|
30
30
|
to_object: dict[str, Any] = {}
|
31
|
-
if getv(from_object, ['
|
32
|
-
|
33
|
-
|
34
|
-
if getv(from_object, ['thought']) is not None:
|
35
|
-
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
36
|
-
|
37
|
-
if getv(from_object, ['code_execution_result']) is not None:
|
38
|
-
setv(
|
39
|
-
to_object,
|
40
|
-
['codeExecutionResult'],
|
41
|
-
getv(from_object, ['code_execution_result']),
|
42
|
-
)
|
43
|
-
|
44
|
-
if getv(from_object, ['executable_code']) is not None:
|
45
|
-
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
46
|
-
|
47
|
-
if getv(from_object, ['file_data']) is not None:
|
48
|
-
setv(to_object, ['fileData'], getv(from_object, ['file_data']))
|
49
|
-
|
50
|
-
if getv(from_object, ['function_call']) is not None:
|
51
|
-
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
52
|
-
|
53
|
-
if getv(from_object, ['function_response']) is not None:
|
54
|
-
setv(
|
55
|
-
to_object,
|
56
|
-
['functionResponse'],
|
57
|
-
getv(from_object, ['function_response']),
|
58
|
-
)
|
59
|
-
|
60
|
-
if getv(from_object, ['inline_data']) is not None:
|
61
|
-
setv(to_object, ['inlineData'], getv(from_object, ['inline_data']))
|
62
|
-
|
63
|
-
if getv(from_object, ['text']) is not None:
|
64
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
31
|
+
if getv(from_object, ['voice_name']) is not None:
|
32
|
+
setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
|
65
33
|
|
66
34
|
return to_object
|
67
35
|
|
68
36
|
|
69
|
-
def
|
37
|
+
def _PrebuiltVoiceConfig_to_vertex(
|
70
38
|
api_client: BaseApiClient,
|
71
39
|
from_object: Union[dict[str, Any], object],
|
72
40
|
parent_object: Optional[dict[str, Any]] = None,
|
73
41
|
) -> dict[str, Any]:
|
74
42
|
to_object: dict[str, Any] = {}
|
75
|
-
if getv(from_object, ['
|
76
|
-
setv(to_object, ['
|
77
|
-
|
78
|
-
if getv(from_object, ['thought']) is not None:
|
79
|
-
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
80
|
-
|
81
|
-
if getv(from_object, ['code_execution_result']) is not None:
|
82
|
-
setv(
|
83
|
-
to_object,
|
84
|
-
['codeExecutionResult'],
|
85
|
-
getv(from_object, ['code_execution_result']),
|
86
|
-
)
|
87
|
-
|
88
|
-
if getv(from_object, ['executable_code']) is not None:
|
89
|
-
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
90
|
-
|
91
|
-
if getv(from_object, ['file_data']) is not None:
|
92
|
-
setv(to_object, ['fileData'], getv(from_object, ['file_data']))
|
93
|
-
|
94
|
-
if getv(from_object, ['function_call']) is not None:
|
95
|
-
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
96
|
-
|
97
|
-
if getv(from_object, ['function_response']) is not None:
|
98
|
-
setv(
|
99
|
-
to_object,
|
100
|
-
['functionResponse'],
|
101
|
-
getv(from_object, ['function_response']),
|
102
|
-
)
|
103
|
-
|
104
|
-
if getv(from_object, ['inline_data']) is not None:
|
105
|
-
setv(to_object, ['inlineData'], getv(from_object, ['inline_data']))
|
106
|
-
|
107
|
-
if getv(from_object, ['text']) is not None:
|
108
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
43
|
+
if getv(from_object, ['voice_name']) is not None:
|
44
|
+
setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
|
109
45
|
|
110
46
|
return to_object
|
111
47
|
|
112
48
|
|
113
|
-
def
|
49
|
+
def _VoiceConfig_to_mldev(
|
114
50
|
api_client: BaseApiClient,
|
115
51
|
from_object: Union[dict[str, Any], object],
|
116
52
|
parent_object: Optional[dict[str, Any]] = None,
|
117
53
|
) -> dict[str, Any]:
|
118
54
|
to_object: dict[str, Any] = {}
|
119
|
-
if getv(from_object, ['
|
55
|
+
if getv(from_object, ['prebuilt_voice_config']) is not None:
|
120
56
|
setv(
|
121
57
|
to_object,
|
122
|
-
['
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
],
|
58
|
+
['prebuiltVoiceConfig'],
|
59
|
+
_PrebuiltVoiceConfig_to_mldev(
|
60
|
+
api_client, getv(from_object, ['prebuilt_voice_config']), to_object
|
61
|
+
),
|
127
62
|
)
|
128
63
|
|
129
|
-
if getv(from_object, ['role']) is not None:
|
130
|
-
setv(to_object, ['role'], getv(from_object, ['role']))
|
131
|
-
|
132
64
|
return to_object
|
133
65
|
|
134
66
|
|
135
|
-
def
|
67
|
+
def _VoiceConfig_to_vertex(
|
136
68
|
api_client: BaseApiClient,
|
137
69
|
from_object: Union[dict[str, Any], object],
|
138
70
|
parent_object: Optional[dict[str, Any]] = None,
|
139
71
|
) -> dict[str, Any]:
|
140
72
|
to_object: dict[str, Any] = {}
|
141
|
-
if getv(from_object, ['
|
73
|
+
if getv(from_object, ['prebuilt_voice_config']) is not None:
|
142
74
|
setv(
|
143
75
|
to_object,
|
144
|
-
['
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
],
|
76
|
+
['prebuiltVoiceConfig'],
|
77
|
+
_PrebuiltVoiceConfig_to_vertex(
|
78
|
+
api_client, getv(from_object, ['prebuilt_voice_config']), to_object
|
79
|
+
),
|
149
80
|
)
|
150
81
|
|
151
|
-
if getv(from_object, ['role']) is not None:
|
152
|
-
setv(to_object, ['role'], getv(from_object, ['role']))
|
153
|
-
|
154
82
|
return to_object
|
155
83
|
|
156
84
|
|
157
|
-
def
|
85
|
+
def _SpeakerVoiceConfig_to_mldev(
|
158
86
|
api_client: BaseApiClient,
|
159
87
|
from_object: Union[dict[str, Any], object],
|
160
88
|
parent_object: Optional[dict[str, Any]] = None,
|
161
89
|
) -> dict[str, Any]:
|
162
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
|
+
)
|
163
102
|
|
164
103
|
return to_object
|
165
104
|
|
166
105
|
|
167
|
-
def
|
106
|
+
def _SpeakerVoiceConfig_to_vertex(
|
168
107
|
api_client: BaseApiClient,
|
169
108
|
from_object: Union[dict[str, Any], object],
|
170
109
|
parent_object: Optional[dict[str, Any]] = None,
|
171
110
|
) -> dict[str, Any]:
|
172
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.')
|
173
117
|
|
174
118
|
return to_object
|
175
119
|
|
176
120
|
|
177
|
-
def
|
121
|
+
def _MultiSpeakerVoiceConfig_to_mldev(
|
178
122
|
api_client: BaseApiClient,
|
179
123
|
from_object: Union[dict[str, Any], object],
|
180
124
|
parent_object: Optional[dict[str, Any]] = None,
|
181
125
|
) -> dict[str, Any]:
|
182
126
|
to_object: dict[str, Any] = {}
|
183
|
-
if getv(from_object, ['
|
184
|
-
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
185
|
-
|
186
|
-
if getv(from_object, ['dynamic_threshold']) is not None:
|
127
|
+
if getv(from_object, ['speaker_voice_configs']) is not None:
|
187
128
|
setv(
|
188
129
|
to_object,
|
189
|
-
['
|
190
|
-
|
130
|
+
['speakerVoiceConfigs'],
|
131
|
+
[
|
132
|
+
_SpeakerVoiceConfig_to_mldev(api_client, item, to_object)
|
133
|
+
for item in getv(from_object, ['speaker_voice_configs'])
|
134
|
+
],
|
191
135
|
)
|
192
136
|
|
193
137
|
return to_object
|
194
138
|
|
195
139
|
|
196
|
-
def
|
140
|
+
def _MultiSpeakerVoiceConfig_to_vertex(
|
197
141
|
api_client: BaseApiClient,
|
198
142
|
from_object: Union[dict[str, Any], object],
|
199
143
|
parent_object: Optional[dict[str, Any]] = None,
|
200
144
|
) -> dict[str, Any]:
|
201
145
|
to_object: dict[str, Any] = {}
|
202
|
-
if getv(from_object, ['
|
203
|
-
|
204
|
-
|
205
|
-
if getv(from_object, ['dynamic_threshold']) is not None:
|
206
|
-
setv(
|
207
|
-
to_object,
|
208
|
-
['dynamicThreshold'],
|
209
|
-
getv(from_object, ['dynamic_threshold']),
|
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.'
|
210
149
|
)
|
211
150
|
|
212
151
|
return to_object
|
213
152
|
|
214
153
|
|
215
|
-
def
|
154
|
+
def _SpeechConfig_to_mldev(
|
216
155
|
api_client: BaseApiClient,
|
217
156
|
from_object: Union[dict[str, Any], object],
|
218
157
|
parent_object: Optional[dict[str, Any]] = None,
|
219
158
|
) -> dict[str, Any]:
|
220
159
|
to_object: dict[str, Any] = {}
|
221
|
-
if getv(from_object, ['
|
160
|
+
if getv(from_object, ['voice_config']) is not None:
|
222
161
|
setv(
|
223
162
|
to_object,
|
224
|
-
['
|
225
|
-
|
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(
|
226
174
|
api_client,
|
227
|
-
getv(from_object, ['
|
175
|
+
getv(from_object, ['multi_speaker_voice_config']),
|
228
176
|
to_object,
|
229
177
|
),
|
230
178
|
)
|
231
179
|
|
180
|
+
if getv(from_object, ['language_code']) is not None:
|
181
|
+
setv(to_object, ['languageCode'], getv(from_object, ['language_code']))
|
182
|
+
|
232
183
|
return to_object
|
233
184
|
|
234
185
|
|
235
|
-
def
|
186
|
+
def _SpeechConfig_to_vertex(
|
236
187
|
api_client: BaseApiClient,
|
237
188
|
from_object: Union[dict[str, Any], object],
|
238
189
|
parent_object: Optional[dict[str, Any]] = None,
|
239
190
|
) -> dict[str, Any]:
|
240
191
|
to_object: dict[str, Any] = {}
|
241
|
-
if getv(from_object, ['
|
192
|
+
if getv(from_object, ['voice_config']) is not None:
|
242
193
|
setv(
|
243
194
|
to_object,
|
244
|
-
['
|
245
|
-
|
246
|
-
api_client,
|
247
|
-
getv(from_object, ['dynamic_retrieval_config']),
|
248
|
-
to_object,
|
195
|
+
['voiceConfig'],
|
196
|
+
_VoiceConfig_to_vertex(
|
197
|
+
api_client, getv(from_object, ['voice_config']), to_object
|
249
198
|
),
|
250
199
|
)
|
251
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
|
+
|
252
209
|
return to_object
|
253
210
|
|
254
211
|
|
255
|
-
def
|
212
|
+
def _VideoMetadata_to_mldev(
|
256
213
|
api_client: BaseApiClient,
|
257
214
|
from_object: Union[dict[str, Any], object],
|
258
215
|
parent_object: Optional[dict[str, Any]] = None,
|
259
216
|
) -> dict[str, Any]:
|
260
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']))
|
261
226
|
|
262
227
|
return to_object
|
263
228
|
|
264
229
|
|
265
|
-
def
|
230
|
+
def _VideoMetadata_to_vertex(
|
266
231
|
api_client: BaseApiClient,
|
267
232
|
from_object: Union[dict[str, Any], object],
|
268
233
|
parent_object: Optional[dict[str, Any]] = None,
|
269
234
|
) -> dict[str, Any]:
|
270
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']))
|
271
244
|
|
272
245
|
return to_object
|
273
246
|
|
274
247
|
|
275
|
-
def
|
248
|
+
def _Blob_to_mldev(
|
276
249
|
api_client: BaseApiClient,
|
277
250
|
from_object: Union[dict[str, Any], object],
|
278
251
|
parent_object: Optional[dict[str, Any]] = None,
|
279
252
|
) -> dict[str, Any]:
|
280
253
|
to_object: dict[str, Any] = {}
|
281
|
-
if getv(from_object, ['
|
282
|
-
raise ValueError('
|
254
|
+
if getv(from_object, ['display_name']) is not None:
|
255
|
+
raise ValueError('display_name parameter is not supported in Gemini API.')
|
256
|
+
|
257
|
+
if getv(from_object, ['data']) is not None:
|
258
|
+
setv(to_object, ['data'], getv(from_object, ['data']))
|
259
|
+
|
260
|
+
if getv(from_object, ['mime_type']) is not None:
|
261
|
+
setv(to_object, ['mimeType'], getv(from_object, ['mime_type']))
|
283
262
|
|
284
263
|
return to_object
|
285
264
|
|
286
265
|
|
287
|
-
def
|
266
|
+
def _Blob_to_vertex(
|
288
267
|
api_client: BaseApiClient,
|
289
268
|
from_object: Union[dict[str, Any], object],
|
290
269
|
parent_object: Optional[dict[str, Any]] = None,
|
291
270
|
) -> dict[str, Any]:
|
292
271
|
to_object: dict[str, Any] = {}
|
293
|
-
if getv(from_object, ['
|
294
|
-
setv(to_object, ['
|
272
|
+
if getv(from_object, ['display_name']) is not None:
|
273
|
+
setv(to_object, ['displayName'], getv(from_object, ['display_name']))
|
274
|
+
|
275
|
+
if getv(from_object, ['data']) is not None:
|
276
|
+
setv(to_object, ['data'], getv(from_object, ['data']))
|
277
|
+
|
278
|
+
if getv(from_object, ['mime_type']) is not None:
|
279
|
+
setv(to_object, ['mimeType'], getv(from_object, ['mime_type']))
|
295
280
|
|
296
281
|
return to_object
|
297
282
|
|
298
283
|
|
299
|
-
def
|
284
|
+
def _Part_to_mldev(
|
300
285
|
api_client: BaseApiClient,
|
301
286
|
from_object: Union[dict[str, Any], object],
|
302
287
|
parent_object: Optional[dict[str, Any]] = None,
|
303
288
|
) -> dict[str, Any]:
|
304
289
|
to_object: dict[str, Any] = {}
|
305
|
-
if getv(from_object, ['
|
306
|
-
|
290
|
+
if getv(from_object, ['video_metadata']) is not None:
|
291
|
+
setv(
|
292
|
+
to_object,
|
293
|
+
['videoMetadata'],
|
294
|
+
_VideoMetadata_to_mldev(
|
295
|
+
api_client, getv(from_object, ['video_metadata']), to_object
|
296
|
+
),
|
297
|
+
)
|
307
298
|
|
308
|
-
if getv(from_object, ['
|
309
|
-
setv(to_object, ['
|
299
|
+
if getv(from_object, ['thought']) is not None:
|
300
|
+
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
310
301
|
|
311
|
-
if getv(from_object, ['
|
302
|
+
if getv(from_object, ['inline_data']) is not None:
|
312
303
|
setv(
|
313
304
|
to_object,
|
314
|
-
['
|
315
|
-
|
305
|
+
['inlineData'],
|
306
|
+
_Blob_to_mldev(
|
307
|
+
api_client, getv(from_object, ['inline_data']), to_object
|
308
|
+
),
|
316
309
|
)
|
317
310
|
|
318
|
-
if getv(from_object, ['
|
311
|
+
if getv(from_object, ['code_execution_result']) is not None:
|
319
312
|
setv(
|
320
313
|
to_object,
|
321
|
-
['
|
322
|
-
getv(from_object, ['
|
314
|
+
['codeExecutionResult'],
|
315
|
+
getv(from_object, ['code_execution_result']),
|
323
316
|
)
|
324
317
|
|
325
|
-
if getv(from_object, ['
|
326
|
-
setv(to_object, ['
|
318
|
+
if getv(from_object, ['executable_code']) is not None:
|
319
|
+
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
327
320
|
|
328
|
-
if getv(from_object, ['
|
329
|
-
setv(to_object, ['
|
321
|
+
if getv(from_object, ['file_data']) is not None:
|
322
|
+
setv(to_object, ['fileData'], getv(from_object, ['file_data']))
|
323
|
+
|
324
|
+
if getv(from_object, ['function_call']) is not None:
|
325
|
+
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
326
|
+
|
327
|
+
if getv(from_object, ['function_response']) is not None:
|
328
|
+
setv(
|
329
|
+
to_object,
|
330
|
+
['functionResponse'],
|
331
|
+
getv(from_object, ['function_response']),
|
332
|
+
)
|
333
|
+
|
334
|
+
if getv(from_object, ['text']) is not None:
|
335
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
330
336
|
|
331
337
|
return to_object
|
332
338
|
|
333
339
|
|
334
|
-
def
|
340
|
+
def _Part_to_vertex(
|
335
341
|
api_client: BaseApiClient,
|
336
342
|
from_object: Union[dict[str, Any], object],
|
337
343
|
parent_object: Optional[dict[str, Any]] = None,
|
338
344
|
) -> dict[str, Any]:
|
339
345
|
to_object: dict[str, Any] = {}
|
340
|
-
if getv(from_object, ['
|
346
|
+
if getv(from_object, ['video_metadata']) is not None:
|
341
347
|
setv(
|
342
348
|
to_object,
|
343
|
-
['
|
344
|
-
|
345
|
-
api_client, getv(from_object, ['
|
349
|
+
['videoMetadata'],
|
350
|
+
_VideoMetadata_to_vertex(
|
351
|
+
api_client, getv(from_object, ['video_metadata']), to_object
|
346
352
|
),
|
347
353
|
)
|
348
354
|
|
349
|
-
if getv(from_object, ['
|
350
|
-
setv(to_object, ['
|
355
|
+
if getv(from_object, ['thought']) is not None:
|
356
|
+
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
351
357
|
|
352
|
-
if getv(from_object, ['
|
358
|
+
if getv(from_object, ['inline_data']) is not None:
|
353
359
|
setv(
|
354
360
|
to_object,
|
355
|
-
['
|
356
|
-
|
361
|
+
['inlineData'],
|
362
|
+
_Blob_to_vertex(
|
363
|
+
api_client, getv(from_object, ['inline_data']), to_object
|
364
|
+
),
|
357
365
|
)
|
358
366
|
|
359
|
-
if getv(from_object, ['
|
367
|
+
if getv(from_object, ['code_execution_result']) is not None:
|
360
368
|
setv(
|
361
369
|
to_object,
|
362
|
-
['
|
363
|
-
getv(from_object, ['
|
370
|
+
['codeExecutionResult'],
|
371
|
+
getv(from_object, ['code_execution_result']),
|
364
372
|
)
|
365
373
|
|
366
|
-
if getv(from_object, ['
|
367
|
-
setv(to_object, ['
|
374
|
+
if getv(from_object, ['executable_code']) is not None:
|
375
|
+
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
368
376
|
|
369
|
-
if getv(from_object, ['
|
370
|
-
setv(to_object, ['
|
377
|
+
if getv(from_object, ['file_data']) is not None:
|
378
|
+
setv(to_object, ['fileData'], getv(from_object, ['file_data']))
|
371
379
|
|
372
|
-
|
380
|
+
if getv(from_object, ['function_call']) is not None:
|
381
|
+
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
373
382
|
|
383
|
+
if getv(from_object, ['function_response']) is not None:
|
384
|
+
setv(
|
385
|
+
to_object,
|
386
|
+
['functionResponse'],
|
387
|
+
getv(from_object, ['function_response']),
|
388
|
+
)
|
374
389
|
|
375
|
-
|
376
|
-
|
377
|
-
from_object: Union[dict[str, Any], object],
|
378
|
-
parent_object: Optional[dict[str, Any]] = None,
|
379
|
-
) -> dict[str, Any]:
|
380
|
-
to_object: dict[str, Any] = {}
|
381
|
-
if getv(from_object, ['auth_config']) is not None:
|
382
|
-
raise ValueError('auth_config parameter is not supported in Gemini API.')
|
390
|
+
if getv(from_object, ['text']) is not None:
|
391
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
383
392
|
|
384
393
|
return to_object
|
385
394
|
|
386
395
|
|
387
|
-
def
|
396
|
+
def _Content_to_mldev(
|
388
397
|
api_client: BaseApiClient,
|
389
398
|
from_object: Union[dict[str, Any], object],
|
390
399
|
parent_object: Optional[dict[str, Any]] = None,
|
391
400
|
) -> dict[str, Any]:
|
392
401
|
to_object: dict[str, Any] = {}
|
393
|
-
if getv(from_object, ['
|
402
|
+
if getv(from_object, ['parts']) is not None:
|
394
403
|
setv(
|
395
404
|
to_object,
|
396
|
-
['
|
397
|
-
|
398
|
-
api_client,
|
399
|
-
|
400
|
-
|
405
|
+
['parts'],
|
406
|
+
[
|
407
|
+
_Part_to_mldev(api_client, item, to_object)
|
408
|
+
for item in getv(from_object, ['parts'])
|
409
|
+
],
|
410
|
+
)
|
411
|
+
|
412
|
+
if getv(from_object, ['role']) is not None:
|
413
|
+
setv(to_object, ['role'], getv(from_object, ['role']))
|
401
414
|
|
402
415
|
return to_object
|
403
416
|
|
404
417
|
|
405
|
-
def
|
418
|
+
def _Content_to_vertex(
|
406
419
|
api_client: BaseApiClient,
|
407
420
|
from_object: Union[dict[str, Any], object],
|
408
421
|
parent_object: Optional[dict[str, Any]] = None,
|
409
422
|
) -> dict[str, Any]:
|
410
423
|
to_object: dict[str, Any] = {}
|
411
|
-
if getv(from_object, ['
|
412
|
-
raise ValueError('retrieval parameter is not supported in Gemini API.')
|
413
|
-
|
414
|
-
if getv(from_object, ['google_search']) is not None:
|
415
|
-
setv(
|
416
|
-
to_object,
|
417
|
-
['googleSearch'],
|
418
|
-
_GoogleSearch_to_mldev(
|
419
|
-
api_client, getv(from_object, ['google_search']), to_object
|
420
|
-
),
|
421
|
-
)
|
422
|
-
|
423
|
-
if getv(from_object, ['google_search_retrieval']) is not None:
|
424
|
+
if getv(from_object, ['parts']) is not None:
|
424
425
|
setv(
|
425
426
|
to_object,
|
426
|
-
['
|
427
|
-
|
428
|
-
api_client,
|
429
|
-
getv(from_object, ['
|
430
|
-
|
431
|
-
),
|
432
|
-
)
|
433
|
-
|
434
|
-
if getv(from_object, ['enterprise_web_search']) is not None:
|
435
|
-
raise ValueError(
|
436
|
-
'enterprise_web_search parameter is not supported in Gemini API.'
|
427
|
+
['parts'],
|
428
|
+
[
|
429
|
+
_Part_to_vertex(api_client, item, to_object)
|
430
|
+
for item in getv(from_object, ['parts'])
|
431
|
+
],
|
437
432
|
)
|
438
433
|
|
439
|
-
if getv(from_object, ['
|
440
|
-
|
441
|
-
|
442
|
-
if getv(from_object, ['code_execution']) is not None:
|
443
|
-
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
444
|
-
|
445
|
-
if getv(from_object, ['function_declarations']) is not None:
|
446
|
-
setv(
|
447
|
-
to_object,
|
448
|
-
['functionDeclarations'],
|
449
|
-
getv(from_object, ['function_declarations']),
|
450
|
-
)
|
434
|
+
if getv(from_object, ['role']) is not None:
|
435
|
+
setv(to_object, ['role'], getv(from_object, ['role']))
|
451
436
|
|
452
437
|
return to_object
|
453
438
|
|
454
439
|
|
455
|
-
def
|
440
|
+
def _FunctionDeclaration_to_mldev(
|
456
441
|
api_client: BaseApiClient,
|
457
442
|
from_object: Union[dict[str, Any], object],
|
458
443
|
parent_object: Optional[dict[str, Any]] = None,
|
459
444
|
) -> dict[str, Any]:
|
460
445
|
to_object: dict[str, Any] = {}
|
461
|
-
if getv(from_object, ['
|
462
|
-
setv(to_object, ['
|
463
|
-
|
464
|
-
if getv(from_object, ['google_search']) is not None:
|
465
|
-
setv(
|
466
|
-
to_object,
|
467
|
-
['googleSearch'],
|
468
|
-
_GoogleSearch_to_vertex(
|
469
|
-
api_client, getv(from_object, ['google_search']), to_object
|
470
|
-
),
|
471
|
-
)
|
472
|
-
|
473
|
-
if getv(from_object, ['google_search_retrieval']) is not None:
|
474
|
-
setv(
|
475
|
-
to_object,
|
476
|
-
['googleSearchRetrieval'],
|
477
|
-
_GoogleSearchRetrieval_to_vertex(
|
478
|
-
api_client,
|
479
|
-
getv(from_object, ['google_search_retrieval']),
|
480
|
-
to_object,
|
481
|
-
),
|
482
|
-
)
|
446
|
+
if getv(from_object, ['behavior']) is not None:
|
447
|
+
setv(to_object, ['behavior'], getv(from_object, ['behavior']))
|
483
448
|
|
484
|
-
if getv(from_object, ['
|
485
|
-
setv(
|
486
|
-
to_object,
|
487
|
-
['enterpriseWebSearch'],
|
488
|
-
_EnterpriseWebSearch_to_vertex(
|
489
|
-
api_client, getv(from_object, ['enterprise_web_search']), to_object
|
490
|
-
),
|
491
|
-
)
|
449
|
+
if getv(from_object, ['description']) is not None:
|
450
|
+
setv(to_object, ['description'], getv(from_object, ['description']))
|
492
451
|
|
493
|
-
if getv(from_object, ['
|
494
|
-
setv(
|
495
|
-
to_object,
|
496
|
-
['googleMaps'],
|
497
|
-
_GoogleMaps_to_vertex(
|
498
|
-
api_client, getv(from_object, ['google_maps']), to_object
|
499
|
-
),
|
500
|
-
)
|
452
|
+
if getv(from_object, ['name']) is not None:
|
453
|
+
setv(to_object, ['name'], getv(from_object, ['name']))
|
501
454
|
|
502
|
-
if getv(from_object, ['
|
503
|
-
setv(to_object, ['
|
455
|
+
if getv(from_object, ['parameters']) is not None:
|
456
|
+
setv(to_object, ['parameters'], getv(from_object, ['parameters']))
|
504
457
|
|
505
|
-
if getv(from_object, ['
|
506
|
-
setv(
|
507
|
-
to_object,
|
508
|
-
['functionDeclarations'],
|
509
|
-
getv(from_object, ['function_declarations']),
|
510
|
-
)
|
458
|
+
if getv(from_object, ['response']) is not None:
|
459
|
+
setv(to_object, ['response'], getv(from_object, ['response']))
|
511
460
|
|
512
461
|
return to_object
|
513
462
|
|
514
463
|
|
515
|
-
def
|
464
|
+
def _FunctionDeclaration_to_vertex(
|
516
465
|
api_client: BaseApiClient,
|
517
466
|
from_object: Union[dict[str, Any], object],
|
518
467
|
parent_object: Optional[dict[str, Any]] = None,
|
519
468
|
) -> dict[str, Any]:
|
520
469
|
to_object: dict[str, Any] = {}
|
521
|
-
if getv(from_object, ['
|
522
|
-
|
470
|
+
if getv(from_object, ['behavior']) is not None:
|
471
|
+
raise ValueError('behavior parameter is not supported in Vertex AI.')
|
523
472
|
|
524
|
-
if getv(from_object, ['
|
525
|
-
|
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']))
|
526
484
|
|
527
485
|
return to_object
|
528
486
|
|
529
487
|
|
530
|
-
def
|
488
|
+
def _Interval_to_mldev(
|
531
489
|
api_client: BaseApiClient,
|
532
490
|
from_object: Union[dict[str, Any], object],
|
533
491
|
parent_object: Optional[dict[str, Any]] = None,
|
534
492
|
) -> dict[str, Any]:
|
535
493
|
to_object: dict[str, Any] = {}
|
536
|
-
if getv(from_object, ['
|
537
|
-
setv(to_object, ['
|
494
|
+
if getv(from_object, ['start_time']) is not None:
|
495
|
+
setv(to_object, ['startTime'], getv(from_object, ['start_time']))
|
538
496
|
|
539
|
-
if getv(from_object, ['
|
540
|
-
setv(to_object, ['
|
497
|
+
if getv(from_object, ['end_time']) is not None:
|
498
|
+
setv(to_object, ['endTime'], getv(from_object, ['end_time']))
|
541
499
|
|
542
500
|
return to_object
|
543
501
|
|
544
502
|
|
545
|
-
def
|
503
|
+
def _Interval_to_vertex(
|
546
504
|
api_client: BaseApiClient,
|
547
505
|
from_object: Union[dict[str, Any], object],
|
548
506
|
parent_object: Optional[dict[str, Any]] = None,
|
549
507
|
) -> dict[str, Any]:
|
550
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']))
|
551
514
|
|
552
515
|
return to_object
|
553
516
|
|
554
517
|
|
555
|
-
def
|
518
|
+
def _GoogleSearch_to_mldev(
|
556
519
|
api_client: BaseApiClient,
|
557
520
|
from_object: Union[dict[str, Any], object],
|
558
521
|
parent_object: Optional[dict[str, Any]] = None,
|
559
522
|
) -> dict[str, Any]:
|
560
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
|
+
)
|
561
532
|
|
562
533
|
return to_object
|
563
534
|
|
564
535
|
|
565
|
-
def
|
536
|
+
def _GoogleSearch_to_vertex(
|
566
537
|
api_client: BaseApiClient,
|
567
538
|
from_object: Union[dict[str, Any], object],
|
568
539
|
parent_object: Optional[dict[str, Any]] = None,
|
569
540
|
) -> dict[str, Any]:
|
570
541
|
to_object: dict[str, Any] = {}
|
571
|
-
if getv(from_object, ['
|
572
|
-
setv(to_object, ['disabled'], getv(from_object, ['disabled']))
|
573
|
-
|
574
|
-
if getv(from_object, ['start_of_speech_sensitivity']) is not None:
|
575
|
-
setv(
|
576
|
-
to_object,
|
577
|
-
['startOfSpeechSensitivity'],
|
578
|
-
getv(from_object, ['start_of_speech_sensitivity']),
|
579
|
-
)
|
580
|
-
|
581
|
-
if getv(from_object, ['end_of_speech_sensitivity']) is not None:
|
582
|
-
setv(
|
583
|
-
to_object,
|
584
|
-
['endOfSpeechSensitivity'],
|
585
|
-
getv(from_object, ['end_of_speech_sensitivity']),
|
586
|
-
)
|
587
|
-
|
588
|
-
if getv(from_object, ['prefix_padding_ms']) is not None:
|
589
|
-
setv(
|
590
|
-
to_object, ['prefixPaddingMs'], getv(from_object, ['prefix_padding_ms'])
|
591
|
-
)
|
592
|
-
|
593
|
-
if getv(from_object, ['silence_duration_ms']) is not None:
|
542
|
+
if getv(from_object, ['time_range_filter']) is not None:
|
594
543
|
setv(
|
595
544
|
to_object,
|
596
|
-
['
|
597
|
-
|
545
|
+
['timeRangeFilter'],
|
546
|
+
_Interval_to_vertex(
|
547
|
+
api_client, getv(from_object, ['time_range_filter']), to_object
|
548
|
+
),
|
598
549
|
)
|
599
550
|
|
600
551
|
return to_object
|
601
552
|
|
602
553
|
|
603
|
-
def
|
554
|
+
def _DynamicRetrievalConfig_to_mldev(
|
604
555
|
api_client: BaseApiClient,
|
605
556
|
from_object: Union[dict[str, Any], object],
|
606
557
|
parent_object: Optional[dict[str, Any]] = None,
|
607
558
|
) -> dict[str, Any]:
|
608
559
|
to_object: dict[str, Any] = {}
|
609
|
-
if getv(from_object, ['
|
610
|
-
setv(to_object, ['
|
560
|
+
if getv(from_object, ['mode']) is not None:
|
561
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
611
562
|
|
612
|
-
if getv(from_object, ['
|
563
|
+
if getv(from_object, ['dynamic_threshold']) is not None:
|
613
564
|
setv(
|
614
565
|
to_object,
|
615
|
-
['
|
616
|
-
getv(from_object, ['
|
566
|
+
['dynamicThreshold'],
|
567
|
+
getv(from_object, ['dynamic_threshold']),
|
617
568
|
)
|
618
569
|
|
619
|
-
|
620
|
-
setv(
|
621
|
-
to_object,
|
622
|
-
['endOfSpeechSensitivity'],
|
623
|
-
getv(from_object, ['end_of_speech_sensitivity']),
|
624
|
-
)
|
570
|
+
return to_object
|
625
571
|
|
626
|
-
if getv(from_object, ['prefix_padding_ms']) is not None:
|
627
|
-
setv(
|
628
|
-
to_object, ['prefixPaddingMs'], getv(from_object, ['prefix_padding_ms'])
|
629
|
-
)
|
630
572
|
|
631
|
-
|
573
|
+
def _DynamicRetrievalConfig_to_vertex(
|
574
|
+
api_client: BaseApiClient,
|
575
|
+
from_object: Union[dict[str, Any], object],
|
576
|
+
parent_object: Optional[dict[str, Any]] = None,
|
577
|
+
) -> dict[str, Any]:
|
578
|
+
to_object: dict[str, Any] = {}
|
579
|
+
if getv(from_object, ['mode']) is not None:
|
580
|
+
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
581
|
+
|
582
|
+
if getv(from_object, ['dynamic_threshold']) is not None:
|
632
583
|
setv(
|
633
584
|
to_object,
|
634
|
-
['
|
635
|
-
getv(from_object, ['
|
585
|
+
['dynamicThreshold'],
|
586
|
+
getv(from_object, ['dynamic_threshold']),
|
636
587
|
)
|
637
588
|
|
638
589
|
return to_object
|
639
590
|
|
640
591
|
|
641
|
-
def
|
592
|
+
def _GoogleSearchRetrieval_to_mldev(
|
642
593
|
api_client: BaseApiClient,
|
643
594
|
from_object: Union[dict[str, Any], object],
|
644
595
|
parent_object: Optional[dict[str, Any]] = None,
|
645
596
|
) -> dict[str, Any]:
|
646
597
|
to_object: dict[str, Any] = {}
|
647
|
-
if getv(from_object, ['
|
598
|
+
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
648
599
|
setv(
|
649
600
|
to_object,
|
650
|
-
['
|
651
|
-
|
601
|
+
['dynamicRetrievalConfig'],
|
602
|
+
_DynamicRetrievalConfig_to_mldev(
|
652
603
|
api_client,
|
653
|
-
getv(from_object, ['
|
604
|
+
getv(from_object, ['dynamic_retrieval_config']),
|
654
605
|
to_object,
|
655
606
|
),
|
656
607
|
)
|
657
608
|
|
658
|
-
if getv(from_object, ['activity_handling']) is not None:
|
659
|
-
setv(
|
660
|
-
to_object,
|
661
|
-
['activityHandling'],
|
662
|
-
getv(from_object, ['activity_handling']),
|
663
|
-
)
|
664
|
-
|
665
|
-
if getv(from_object, ['turn_coverage']) is not None:
|
666
|
-
setv(to_object, ['turnCoverage'], getv(from_object, ['turn_coverage']))
|
667
|
-
|
668
609
|
return to_object
|
669
610
|
|
670
611
|
|
671
|
-
def
|
612
|
+
def _GoogleSearchRetrieval_to_vertex(
|
672
613
|
api_client: BaseApiClient,
|
673
614
|
from_object: Union[dict[str, Any], object],
|
674
615
|
parent_object: Optional[dict[str, Any]] = None,
|
675
616
|
) -> dict[str, Any]:
|
676
617
|
to_object: dict[str, Any] = {}
|
677
|
-
if getv(from_object, ['
|
618
|
+
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
678
619
|
setv(
|
679
620
|
to_object,
|
680
|
-
['
|
681
|
-
|
621
|
+
['dynamicRetrievalConfig'],
|
622
|
+
_DynamicRetrievalConfig_to_vertex(
|
682
623
|
api_client,
|
683
|
-
getv(from_object, ['
|
624
|
+
getv(from_object, ['dynamic_retrieval_config']),
|
684
625
|
to_object,
|
685
626
|
),
|
686
627
|
)
|
687
628
|
|
688
|
-
|
689
|
-
setv(
|
690
|
-
to_object,
|
691
|
-
['activityHandling'],
|
692
|
-
getv(from_object, ['activity_handling']),
|
693
|
-
)
|
629
|
+
return to_object
|
694
630
|
|
695
|
-
|
696
|
-
|
631
|
+
|
632
|
+
def _EnterpriseWebSearch_to_mldev(
|
633
|
+
api_client: BaseApiClient,
|
634
|
+
from_object: Union[dict[str, Any], object],
|
635
|
+
parent_object: Optional[dict[str, Any]] = None,
|
636
|
+
) -> dict[str, Any]:
|
637
|
+
to_object: dict[str, Any] = {}
|
697
638
|
|
698
639
|
return to_object
|
699
640
|
|
700
641
|
|
701
|
-
def
|
642
|
+
def _EnterpriseWebSearch_to_vertex(
|
702
643
|
api_client: BaseApiClient,
|
703
644
|
from_object: Union[dict[str, Any], object],
|
704
645
|
parent_object: Optional[dict[str, Any]] = None,
|
705
646
|
) -> dict[str, Any]:
|
706
647
|
to_object: dict[str, Any] = {}
|
707
|
-
if getv(from_object, ['target_tokens']) is not None:
|
708
|
-
setv(to_object, ['targetTokens'], getv(from_object, ['target_tokens']))
|
709
648
|
|
710
649
|
return to_object
|
711
650
|
|
712
651
|
|
713
|
-
def
|
652
|
+
def _ApiKeyConfig_to_mldev(
|
714
653
|
api_client: BaseApiClient,
|
715
654
|
from_object: Union[dict[str, Any], object],
|
716
655
|
parent_object: Optional[dict[str, Any]] = None,
|
717
656
|
) -> dict[str, Any]:
|
718
657
|
to_object: dict[str, Any] = {}
|
719
|
-
if getv(from_object, ['
|
720
|
-
|
658
|
+
if getv(from_object, ['api_key_string']) is not None:
|
659
|
+
raise ValueError('api_key_string parameter is not supported in Gemini API.')
|
721
660
|
|
722
661
|
return to_object
|
723
662
|
|
724
663
|
|
725
|
-
def
|
664
|
+
def _ApiKeyConfig_to_vertex(
|
726
665
|
api_client: BaseApiClient,
|
727
666
|
from_object: Union[dict[str, Any], object],
|
728
667
|
parent_object: Optional[dict[str, Any]] = None,
|
729
668
|
) -> dict[str, Any]:
|
730
669
|
to_object: dict[str, Any] = {}
|
731
|
-
if getv(from_object, ['
|
732
|
-
setv(to_object, ['
|
733
|
-
|
670
|
+
if getv(from_object, ['api_key_string']) is not None:
|
671
|
+
setv(to_object, ['apiKeyString'], getv(from_object, ['api_key_string']))
|
672
|
+
|
673
|
+
return to_object
|
674
|
+
|
675
|
+
|
676
|
+
def _AuthConfig_to_mldev(
|
677
|
+
api_client: BaseApiClient,
|
678
|
+
from_object: Union[dict[str, Any], object],
|
679
|
+
parent_object: Optional[dict[str, Any]] = None,
|
680
|
+
) -> dict[str, Any]:
|
681
|
+
to_object: dict[str, Any] = {}
|
682
|
+
if getv(from_object, ['api_key_config']) is not None:
|
683
|
+
raise ValueError('api_key_config parameter is not supported in Gemini API.')
|
684
|
+
|
685
|
+
if getv(from_object, ['auth_type']) is not None:
|
686
|
+
setv(to_object, ['authType'], getv(from_object, ['auth_type']))
|
687
|
+
|
688
|
+
if getv(from_object, ['google_service_account_config']) is not None:
|
689
|
+
setv(
|
690
|
+
to_object,
|
691
|
+
['googleServiceAccountConfig'],
|
692
|
+
getv(from_object, ['google_service_account_config']),
|
693
|
+
)
|
694
|
+
|
695
|
+
if getv(from_object, ['http_basic_auth_config']) is not None:
|
696
|
+
setv(
|
697
|
+
to_object,
|
698
|
+
['httpBasicAuthConfig'],
|
699
|
+
getv(from_object, ['http_basic_auth_config']),
|
700
|
+
)
|
701
|
+
|
702
|
+
if getv(from_object, ['oauth_config']) is not None:
|
703
|
+
setv(to_object, ['oauthConfig'], getv(from_object, ['oauth_config']))
|
704
|
+
|
705
|
+
if getv(from_object, ['oidc_config']) is not None:
|
706
|
+
setv(to_object, ['oidcConfig'], getv(from_object, ['oidc_config']))
|
707
|
+
|
708
|
+
return to_object
|
709
|
+
|
710
|
+
|
711
|
+
def _AuthConfig_to_vertex(
|
712
|
+
api_client: BaseApiClient,
|
713
|
+
from_object: Union[dict[str, Any], object],
|
714
|
+
parent_object: Optional[dict[str, Any]] = None,
|
715
|
+
) -> dict[str, Any]:
|
716
|
+
to_object: dict[str, Any] = {}
|
717
|
+
if getv(from_object, ['api_key_config']) is not None:
|
718
|
+
setv(
|
719
|
+
to_object,
|
720
|
+
['apiKeyConfig'],
|
721
|
+
_ApiKeyConfig_to_vertex(
|
722
|
+
api_client, getv(from_object, ['api_key_config']), to_object
|
723
|
+
),
|
724
|
+
)
|
725
|
+
|
726
|
+
if getv(from_object, ['auth_type']) is not None:
|
727
|
+
setv(to_object, ['authType'], getv(from_object, ['auth_type']))
|
728
|
+
|
729
|
+
if getv(from_object, ['google_service_account_config']) is not None:
|
730
|
+
setv(
|
731
|
+
to_object,
|
732
|
+
['googleServiceAccountConfig'],
|
733
|
+
getv(from_object, ['google_service_account_config']),
|
734
|
+
)
|
735
|
+
|
736
|
+
if getv(from_object, ['http_basic_auth_config']) is not None:
|
737
|
+
setv(
|
738
|
+
to_object,
|
739
|
+
['httpBasicAuthConfig'],
|
740
|
+
getv(from_object, ['http_basic_auth_config']),
|
741
|
+
)
|
742
|
+
|
743
|
+
if getv(from_object, ['oauth_config']) is not None:
|
744
|
+
setv(to_object, ['oauthConfig'], getv(from_object, ['oauth_config']))
|
745
|
+
|
746
|
+
if getv(from_object, ['oidc_config']) is not None:
|
747
|
+
setv(to_object, ['oidcConfig'], getv(from_object, ['oidc_config']))
|
748
|
+
|
749
|
+
return to_object
|
750
|
+
|
751
|
+
|
752
|
+
def _GoogleMaps_to_mldev(
|
753
|
+
api_client: BaseApiClient,
|
754
|
+
from_object: Union[dict[str, Any], object],
|
755
|
+
parent_object: Optional[dict[str, Any]] = None,
|
756
|
+
) -> dict[str, Any]:
|
757
|
+
to_object: dict[str, Any] = {}
|
758
|
+
if getv(from_object, ['auth_config']) is not None:
|
759
|
+
raise ValueError('auth_config parameter is not supported in Gemini API.')
|
760
|
+
|
761
|
+
return to_object
|
762
|
+
|
763
|
+
|
764
|
+
def _GoogleMaps_to_vertex(
|
765
|
+
api_client: BaseApiClient,
|
766
|
+
from_object: Union[dict[str, Any], object],
|
767
|
+
parent_object: Optional[dict[str, Any]] = None,
|
768
|
+
) -> dict[str, Any]:
|
769
|
+
to_object: dict[str, Any] = {}
|
770
|
+
if getv(from_object, ['auth_config']) is not None:
|
771
|
+
setv(
|
772
|
+
to_object,
|
773
|
+
['authConfig'],
|
774
|
+
_AuthConfig_to_vertex(
|
775
|
+
api_client, getv(from_object, ['auth_config']), to_object
|
776
|
+
),
|
777
|
+
)
|
778
|
+
|
779
|
+
return to_object
|
780
|
+
|
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
|
+
|
802
|
+
def _Tool_to_mldev(
|
803
|
+
api_client: BaseApiClient,
|
804
|
+
from_object: Union[dict[str, Any], object],
|
805
|
+
parent_object: Optional[dict[str, Any]] = None,
|
806
|
+
) -> dict[str, Any]:
|
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
|
+
|
818
|
+
if getv(from_object, ['retrieval']) is not None:
|
819
|
+
raise ValueError('retrieval parameter is not supported in Gemini API.')
|
820
|
+
|
821
|
+
if getv(from_object, ['google_search']) is not None:
|
822
|
+
setv(
|
823
|
+
to_object,
|
824
|
+
['googleSearch'],
|
825
|
+
_GoogleSearch_to_mldev(
|
826
|
+
api_client, getv(from_object, ['google_search']), to_object
|
827
|
+
),
|
828
|
+
)
|
829
|
+
|
830
|
+
if getv(from_object, ['google_search_retrieval']) is not None:
|
831
|
+
setv(
|
832
|
+
to_object,
|
833
|
+
['googleSearchRetrieval'],
|
834
|
+
_GoogleSearchRetrieval_to_mldev(
|
835
|
+
api_client,
|
836
|
+
getv(from_object, ['google_search_retrieval']),
|
837
|
+
to_object,
|
838
|
+
),
|
839
|
+
)
|
840
|
+
|
841
|
+
if getv(from_object, ['enterprise_web_search']) is not None:
|
842
|
+
raise ValueError(
|
843
|
+
'enterprise_web_search parameter is not supported in Gemini API.'
|
844
|
+
)
|
845
|
+
|
846
|
+
if getv(from_object, ['google_maps']) is not None:
|
847
|
+
raise ValueError('google_maps parameter is not supported in Gemini API.')
|
848
|
+
|
849
|
+
if getv(from_object, ['url_context']) is not None:
|
850
|
+
setv(
|
851
|
+
to_object,
|
852
|
+
['urlContext'],
|
853
|
+
_UrlContext_to_mldev(
|
854
|
+
api_client, getv(from_object, ['url_context']), to_object
|
855
|
+
),
|
856
|
+
)
|
857
|
+
|
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
|
862
|
+
|
863
|
+
|
864
|
+
def _Tool_to_vertex(
|
865
|
+
api_client: BaseApiClient,
|
866
|
+
from_object: Union[dict[str, Any], object],
|
867
|
+
parent_object: Optional[dict[str, Any]] = None,
|
868
|
+
) -> dict[str, Any]:
|
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
|
+
|
880
|
+
if getv(from_object, ['retrieval']) is not None:
|
881
|
+
setv(to_object, ['retrieval'], getv(from_object, ['retrieval']))
|
882
|
+
|
883
|
+
if getv(from_object, ['google_search']) is not None:
|
884
|
+
setv(
|
885
|
+
to_object,
|
886
|
+
['googleSearch'],
|
887
|
+
_GoogleSearch_to_vertex(
|
888
|
+
api_client, getv(from_object, ['google_search']), to_object
|
889
|
+
),
|
890
|
+
)
|
891
|
+
|
892
|
+
if getv(from_object, ['google_search_retrieval']) is not None:
|
893
|
+
setv(
|
894
|
+
to_object,
|
895
|
+
['googleSearchRetrieval'],
|
896
|
+
_GoogleSearchRetrieval_to_vertex(
|
897
|
+
api_client,
|
898
|
+
getv(from_object, ['google_search_retrieval']),
|
899
|
+
to_object,
|
900
|
+
),
|
901
|
+
)
|
902
|
+
|
903
|
+
if getv(from_object, ['enterprise_web_search']) is not None:
|
904
|
+
setv(
|
905
|
+
to_object,
|
906
|
+
['enterpriseWebSearch'],
|
907
|
+
_EnterpriseWebSearch_to_vertex(
|
908
|
+
api_client, getv(from_object, ['enterprise_web_search']), to_object
|
909
|
+
),
|
910
|
+
)
|
911
|
+
|
912
|
+
if getv(from_object, ['google_maps']) is not None:
|
913
|
+
setv(
|
914
|
+
to_object,
|
915
|
+
['googleMaps'],
|
916
|
+
_GoogleMaps_to_vertex(
|
917
|
+
api_client, getv(from_object, ['google_maps']), to_object
|
918
|
+
),
|
919
|
+
)
|
920
|
+
|
921
|
+
if getv(from_object, ['url_context']) is not None:
|
922
|
+
raise ValueError('url_context parameter is not supported in Vertex AI.')
|
923
|
+
|
924
|
+
if getv(from_object, ['code_execution']) is not None:
|
925
|
+
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
926
|
+
|
927
|
+
return to_object
|
928
|
+
|
929
|
+
|
930
|
+
def _SessionResumptionConfig_to_mldev(
|
931
|
+
api_client: BaseApiClient,
|
932
|
+
from_object: Union[dict[str, Any], object],
|
933
|
+
parent_object: Optional[dict[str, Any]] = None,
|
934
|
+
) -> dict[str, Any]:
|
935
|
+
to_object: dict[str, Any] = {}
|
936
|
+
if getv(from_object, ['handle']) is not None:
|
937
|
+
setv(to_object, ['handle'], getv(from_object, ['handle']))
|
938
|
+
|
939
|
+
if getv(from_object, ['transparent']) is not None:
|
940
|
+
raise ValueError('transparent parameter is not supported in Gemini API.')
|
941
|
+
|
942
|
+
return to_object
|
943
|
+
|
944
|
+
|
945
|
+
def _SessionResumptionConfig_to_vertex(
|
946
|
+
api_client: BaseApiClient,
|
947
|
+
from_object: Union[dict[str, Any], object],
|
948
|
+
parent_object: Optional[dict[str, Any]] = None,
|
949
|
+
) -> dict[str, Any]:
|
950
|
+
to_object: dict[str, Any] = {}
|
951
|
+
if getv(from_object, ['handle']) is not None:
|
952
|
+
setv(to_object, ['handle'], getv(from_object, ['handle']))
|
953
|
+
|
954
|
+
if getv(from_object, ['transparent']) is not None:
|
955
|
+
setv(to_object, ['transparent'], getv(from_object, ['transparent']))
|
956
|
+
|
957
|
+
return to_object
|
958
|
+
|
959
|
+
|
960
|
+
def _AudioTranscriptionConfig_to_mldev(
|
961
|
+
api_client: BaseApiClient,
|
962
|
+
from_object: Union[dict[str, Any], object],
|
963
|
+
parent_object: Optional[dict[str, Any]] = None,
|
964
|
+
) -> dict[str, Any]:
|
965
|
+
to_object: dict[str, Any] = {}
|
966
|
+
|
967
|
+
return to_object
|
968
|
+
|
969
|
+
|
970
|
+
def _AudioTranscriptionConfig_to_vertex(
|
971
|
+
api_client: BaseApiClient,
|
972
|
+
from_object: Union[dict[str, Any], object],
|
973
|
+
parent_object: Optional[dict[str, Any]] = None,
|
974
|
+
) -> dict[str, Any]:
|
975
|
+
to_object: dict[str, Any] = {}
|
976
|
+
|
977
|
+
return to_object
|
978
|
+
|
979
|
+
|
980
|
+
def _AutomaticActivityDetection_to_mldev(
|
981
|
+
api_client: BaseApiClient,
|
982
|
+
from_object: Union[dict[str, Any], object],
|
983
|
+
parent_object: Optional[dict[str, Any]] = None,
|
984
|
+
) -> dict[str, Any]:
|
985
|
+
to_object: dict[str, Any] = {}
|
986
|
+
if getv(from_object, ['disabled']) is not None:
|
987
|
+
setv(to_object, ['disabled'], getv(from_object, ['disabled']))
|
988
|
+
|
989
|
+
if getv(from_object, ['start_of_speech_sensitivity']) is not None:
|
990
|
+
setv(
|
991
|
+
to_object,
|
992
|
+
['startOfSpeechSensitivity'],
|
993
|
+
getv(from_object, ['start_of_speech_sensitivity']),
|
994
|
+
)
|
995
|
+
|
996
|
+
if getv(from_object, ['end_of_speech_sensitivity']) is not None:
|
997
|
+
setv(
|
998
|
+
to_object,
|
999
|
+
['endOfSpeechSensitivity'],
|
1000
|
+
getv(from_object, ['end_of_speech_sensitivity']),
|
1001
|
+
)
|
1002
|
+
|
1003
|
+
if getv(from_object, ['prefix_padding_ms']) is not None:
|
1004
|
+
setv(
|
1005
|
+
to_object, ['prefixPaddingMs'], getv(from_object, ['prefix_padding_ms'])
|
1006
|
+
)
|
1007
|
+
|
1008
|
+
if getv(from_object, ['silence_duration_ms']) is not None:
|
1009
|
+
setv(
|
1010
|
+
to_object,
|
1011
|
+
['silenceDurationMs'],
|
1012
|
+
getv(from_object, ['silence_duration_ms']),
|
1013
|
+
)
|
1014
|
+
|
1015
|
+
return to_object
|
1016
|
+
|
1017
|
+
|
1018
|
+
def _AutomaticActivityDetection_to_vertex(
|
1019
|
+
api_client: BaseApiClient,
|
1020
|
+
from_object: Union[dict[str, Any], object],
|
1021
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1022
|
+
) -> dict[str, Any]:
|
1023
|
+
to_object: dict[str, Any] = {}
|
1024
|
+
if getv(from_object, ['disabled']) is not None:
|
1025
|
+
setv(to_object, ['disabled'], getv(from_object, ['disabled']))
|
1026
|
+
|
1027
|
+
if getv(from_object, ['start_of_speech_sensitivity']) is not None:
|
1028
|
+
setv(
|
1029
|
+
to_object,
|
1030
|
+
['startOfSpeechSensitivity'],
|
1031
|
+
getv(from_object, ['start_of_speech_sensitivity']),
|
1032
|
+
)
|
1033
|
+
|
1034
|
+
if getv(from_object, ['end_of_speech_sensitivity']) is not None:
|
1035
|
+
setv(
|
1036
|
+
to_object,
|
1037
|
+
['endOfSpeechSensitivity'],
|
1038
|
+
getv(from_object, ['end_of_speech_sensitivity']),
|
1039
|
+
)
|
1040
|
+
|
1041
|
+
if getv(from_object, ['prefix_padding_ms']) is not None:
|
1042
|
+
setv(
|
1043
|
+
to_object, ['prefixPaddingMs'], getv(from_object, ['prefix_padding_ms'])
|
1044
|
+
)
|
1045
|
+
|
1046
|
+
if getv(from_object, ['silence_duration_ms']) is not None:
|
1047
|
+
setv(
|
1048
|
+
to_object,
|
1049
|
+
['silenceDurationMs'],
|
1050
|
+
getv(from_object, ['silence_duration_ms']),
|
1051
|
+
)
|
1052
|
+
|
1053
|
+
return to_object
|
1054
|
+
|
1055
|
+
|
1056
|
+
def _RealtimeInputConfig_to_mldev(
|
1057
|
+
api_client: BaseApiClient,
|
1058
|
+
from_object: Union[dict[str, Any], object],
|
1059
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1060
|
+
) -> dict[str, Any]:
|
1061
|
+
to_object: dict[str, Any] = {}
|
1062
|
+
if getv(from_object, ['automatic_activity_detection']) is not None:
|
1063
|
+
setv(
|
1064
|
+
to_object,
|
1065
|
+
['automaticActivityDetection'],
|
1066
|
+
_AutomaticActivityDetection_to_mldev(
|
1067
|
+
api_client,
|
1068
|
+
getv(from_object, ['automatic_activity_detection']),
|
1069
|
+
to_object,
|
1070
|
+
),
|
1071
|
+
)
|
1072
|
+
|
1073
|
+
if getv(from_object, ['activity_handling']) is not None:
|
1074
|
+
setv(
|
1075
|
+
to_object,
|
1076
|
+
['activityHandling'],
|
1077
|
+
getv(from_object, ['activity_handling']),
|
1078
|
+
)
|
1079
|
+
|
1080
|
+
if getv(from_object, ['turn_coverage']) is not None:
|
1081
|
+
setv(to_object, ['turnCoverage'], getv(from_object, ['turn_coverage']))
|
1082
|
+
|
1083
|
+
return to_object
|
1084
|
+
|
1085
|
+
|
1086
|
+
def _RealtimeInputConfig_to_vertex(
|
1087
|
+
api_client: BaseApiClient,
|
1088
|
+
from_object: Union[dict[str, Any], object],
|
1089
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1090
|
+
) -> dict[str, Any]:
|
1091
|
+
to_object: dict[str, Any] = {}
|
1092
|
+
if getv(from_object, ['automatic_activity_detection']) is not None:
|
1093
|
+
setv(
|
1094
|
+
to_object,
|
1095
|
+
['automaticActivityDetection'],
|
1096
|
+
_AutomaticActivityDetection_to_vertex(
|
1097
|
+
api_client,
|
1098
|
+
getv(from_object, ['automatic_activity_detection']),
|
1099
|
+
to_object,
|
1100
|
+
),
|
1101
|
+
)
|
1102
|
+
|
1103
|
+
if getv(from_object, ['activity_handling']) is not None:
|
1104
|
+
setv(
|
1105
|
+
to_object,
|
1106
|
+
['activityHandling'],
|
1107
|
+
getv(from_object, ['activity_handling']),
|
1108
|
+
)
|
1109
|
+
|
1110
|
+
if getv(from_object, ['turn_coverage']) is not None:
|
1111
|
+
setv(to_object, ['turnCoverage'], getv(from_object, ['turn_coverage']))
|
1112
|
+
|
1113
|
+
return to_object
|
1114
|
+
|
1115
|
+
|
1116
|
+
def _SlidingWindow_to_mldev(
|
1117
|
+
api_client: BaseApiClient,
|
1118
|
+
from_object: Union[dict[str, Any], object],
|
1119
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1120
|
+
) -> dict[str, Any]:
|
1121
|
+
to_object: dict[str, Any] = {}
|
1122
|
+
if getv(from_object, ['target_tokens']) is not None:
|
1123
|
+
setv(to_object, ['targetTokens'], getv(from_object, ['target_tokens']))
|
1124
|
+
|
1125
|
+
return to_object
|
1126
|
+
|
1127
|
+
|
1128
|
+
def _SlidingWindow_to_vertex(
|
1129
|
+
api_client: BaseApiClient,
|
1130
|
+
from_object: Union[dict[str, Any], object],
|
1131
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1132
|
+
) -> dict[str, Any]:
|
1133
|
+
to_object: dict[str, Any] = {}
|
1134
|
+
if getv(from_object, ['target_tokens']) is not None:
|
1135
|
+
setv(to_object, ['targetTokens'], getv(from_object, ['target_tokens']))
|
1136
|
+
|
1137
|
+
return to_object
|
1138
|
+
|
1139
|
+
|
1140
|
+
def _ContextWindowCompressionConfig_to_mldev(
|
1141
|
+
api_client: BaseApiClient,
|
1142
|
+
from_object: Union[dict[str, Any], object],
|
1143
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1144
|
+
) -> dict[str, Any]:
|
1145
|
+
to_object: dict[str, Any] = {}
|
1146
|
+
if getv(from_object, ['trigger_tokens']) is not None:
|
1147
|
+
setv(to_object, ['triggerTokens'], getv(from_object, ['trigger_tokens']))
|
1148
|
+
|
734
1149
|
if getv(from_object, ['sliding_window']) is not None:
|
735
1150
|
setv(
|
736
1151
|
to_object,
|
@@ -740,36 +1155,228 @@ def _ContextWindowCompressionConfig_to_mldev(
|
|
740
1155
|
),
|
741
1156
|
)
|
742
1157
|
|
743
|
-
return to_object
|
744
|
-
|
745
|
-
|
746
|
-
def _ContextWindowCompressionConfig_to_vertex(
|
747
|
-
api_client: BaseApiClient,
|
748
|
-
from_object: Union[dict[str, Any], object],
|
749
|
-
parent_object: Optional[dict[str, Any]] = None,
|
750
|
-
) -> dict[str, Any]:
|
751
|
-
to_object: dict[str, Any] = {}
|
752
|
-
if getv(from_object, ['trigger_tokens']) is not None:
|
753
|
-
setv(to_object, ['triggerTokens'], getv(from_object, ['trigger_tokens']))
|
754
|
-
|
755
|
-
if getv(from_object, ['sliding_window']) is not None:
|
1158
|
+
return to_object
|
1159
|
+
|
1160
|
+
|
1161
|
+
def _ContextWindowCompressionConfig_to_vertex(
|
1162
|
+
api_client: BaseApiClient,
|
1163
|
+
from_object: Union[dict[str, Any], object],
|
1164
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1165
|
+
) -> dict[str, Any]:
|
1166
|
+
to_object: dict[str, Any] = {}
|
1167
|
+
if getv(from_object, ['trigger_tokens']) is not None:
|
1168
|
+
setv(to_object, ['triggerTokens'], getv(from_object, ['trigger_tokens']))
|
1169
|
+
|
1170
|
+
if getv(from_object, ['sliding_window']) is not None:
|
1171
|
+
setv(
|
1172
|
+
to_object,
|
1173
|
+
['slidingWindow'],
|
1174
|
+
_SlidingWindow_to_vertex(
|
1175
|
+
api_client, getv(from_object, ['sliding_window']), to_object
|
1176
|
+
),
|
1177
|
+
)
|
1178
|
+
|
1179
|
+
return to_object
|
1180
|
+
|
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
|
+
|
1206
|
+
def _LiveConnectConfig_to_mldev(
|
1207
|
+
api_client: BaseApiClient,
|
1208
|
+
from_object: Union[dict[str, Any], object],
|
1209
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1210
|
+
) -> dict[str, Any]:
|
1211
|
+
to_object: dict[str, Any] = {}
|
1212
|
+
|
1213
|
+
if getv(from_object, ['generation_config']) is not None:
|
1214
|
+
setv(
|
1215
|
+
parent_object,
|
1216
|
+
['setup', 'generationConfig'],
|
1217
|
+
getv(from_object, ['generation_config']),
|
1218
|
+
)
|
1219
|
+
|
1220
|
+
if getv(from_object, ['response_modalities']) is not None:
|
1221
|
+
setv(
|
1222
|
+
parent_object,
|
1223
|
+
['setup', 'generationConfig', 'responseModalities'],
|
1224
|
+
getv(from_object, ['response_modalities']),
|
1225
|
+
)
|
1226
|
+
|
1227
|
+
if getv(from_object, ['temperature']) is not None:
|
1228
|
+
setv(
|
1229
|
+
parent_object,
|
1230
|
+
['setup', 'generationConfig', 'temperature'],
|
1231
|
+
getv(from_object, ['temperature']),
|
1232
|
+
)
|
1233
|
+
|
1234
|
+
if getv(from_object, ['top_p']) is not None:
|
1235
|
+
setv(
|
1236
|
+
parent_object,
|
1237
|
+
['setup', 'generationConfig', 'topP'],
|
1238
|
+
getv(from_object, ['top_p']),
|
1239
|
+
)
|
1240
|
+
|
1241
|
+
if getv(from_object, ['top_k']) is not None:
|
1242
|
+
setv(
|
1243
|
+
parent_object,
|
1244
|
+
['setup', 'generationConfig', 'topK'],
|
1245
|
+
getv(from_object, ['top_k']),
|
1246
|
+
)
|
1247
|
+
|
1248
|
+
if getv(from_object, ['max_output_tokens']) is not None:
|
1249
|
+
setv(
|
1250
|
+
parent_object,
|
1251
|
+
['setup', 'generationConfig', 'maxOutputTokens'],
|
1252
|
+
getv(from_object, ['max_output_tokens']),
|
1253
|
+
)
|
1254
|
+
|
1255
|
+
if getv(from_object, ['media_resolution']) is not None:
|
1256
|
+
setv(
|
1257
|
+
parent_object,
|
1258
|
+
['setup', 'generationConfig', 'mediaResolution'],
|
1259
|
+
getv(from_object, ['media_resolution']),
|
1260
|
+
)
|
1261
|
+
|
1262
|
+
if getv(from_object, ['seed']) is not None:
|
1263
|
+
setv(
|
1264
|
+
parent_object,
|
1265
|
+
['setup', 'generationConfig', 'seed'],
|
1266
|
+
getv(from_object, ['seed']),
|
1267
|
+
)
|
1268
|
+
|
1269
|
+
if getv(from_object, ['speech_config']) is not None:
|
1270
|
+
setv(
|
1271
|
+
parent_object,
|
1272
|
+
['setup', 'generationConfig', 'speechConfig'],
|
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']),
|
1287
|
+
)
|
1288
|
+
|
1289
|
+
if getv(from_object, ['system_instruction']) is not None:
|
1290
|
+
setv(
|
1291
|
+
parent_object,
|
1292
|
+
['setup', 'systemInstruction'],
|
1293
|
+
_Content_to_mldev(
|
1294
|
+
api_client,
|
1295
|
+
t.t_content(api_client, getv(from_object, ['system_instruction'])),
|
1296
|
+
to_object,
|
1297
|
+
),
|
1298
|
+
)
|
1299
|
+
|
1300
|
+
if getv(from_object, ['tools']) is not None:
|
1301
|
+
setv(
|
1302
|
+
parent_object,
|
1303
|
+
['setup', 'tools'],
|
1304
|
+
[
|
1305
|
+
_Tool_to_mldev(api_client, t.t_tool(api_client, item), to_object)
|
1306
|
+
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
1307
|
+
],
|
1308
|
+
)
|
1309
|
+
|
1310
|
+
if getv(from_object, ['session_resumption']) is not None:
|
1311
|
+
setv(
|
1312
|
+
parent_object,
|
1313
|
+
['setup', 'sessionResumption'],
|
1314
|
+
_SessionResumptionConfig_to_mldev(
|
1315
|
+
api_client, getv(from_object, ['session_resumption']), to_object
|
1316
|
+
),
|
1317
|
+
)
|
1318
|
+
|
1319
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
1320
|
+
setv(
|
1321
|
+
parent_object,
|
1322
|
+
['setup', 'inputAudioTranscription'],
|
1323
|
+
_AudioTranscriptionConfig_to_mldev(
|
1324
|
+
api_client,
|
1325
|
+
getv(from_object, ['input_audio_transcription']),
|
1326
|
+
to_object,
|
1327
|
+
),
|
1328
|
+
)
|
1329
|
+
|
1330
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
1331
|
+
setv(
|
1332
|
+
parent_object,
|
1333
|
+
['setup', 'outputAudioTranscription'],
|
1334
|
+
_AudioTranscriptionConfig_to_mldev(
|
1335
|
+
api_client,
|
1336
|
+
getv(from_object, ['output_audio_transcription']),
|
1337
|
+
to_object,
|
1338
|
+
),
|
1339
|
+
)
|
1340
|
+
|
1341
|
+
if getv(from_object, ['realtime_input_config']) is not None:
|
1342
|
+
setv(
|
1343
|
+
parent_object,
|
1344
|
+
['setup', 'realtimeInputConfig'],
|
1345
|
+
_RealtimeInputConfig_to_mldev(
|
1346
|
+
api_client, getv(from_object, ['realtime_input_config']), to_object
|
1347
|
+
),
|
1348
|
+
)
|
1349
|
+
|
1350
|
+
if getv(from_object, ['context_window_compression']) is not None:
|
1351
|
+
setv(
|
1352
|
+
parent_object,
|
1353
|
+
['setup', 'contextWindowCompression'],
|
1354
|
+
_ContextWindowCompressionConfig_to_mldev(
|
1355
|
+
api_client,
|
1356
|
+
getv(from_object, ['context_window_compression']),
|
1357
|
+
to_object,
|
1358
|
+
),
|
1359
|
+
)
|
1360
|
+
|
1361
|
+
if getv(from_object, ['proactivity']) is not None:
|
756
1362
|
setv(
|
757
|
-
|
758
|
-
['
|
759
|
-
|
760
|
-
api_client, getv(from_object, ['
|
1363
|
+
parent_object,
|
1364
|
+
['setup', 'proactivity'],
|
1365
|
+
_ProactivityConfig_to_mldev(
|
1366
|
+
api_client, getv(from_object, ['proactivity']), to_object
|
761
1367
|
),
|
762
1368
|
)
|
763
1369
|
|
764
1370
|
return to_object
|
765
1371
|
|
766
1372
|
|
767
|
-
def
|
1373
|
+
def _LiveConnectConfig_to_vertex(
|
768
1374
|
api_client: BaseApiClient,
|
769
1375
|
from_object: Union[dict[str, Any], object],
|
770
1376
|
parent_object: Optional[dict[str, Any]] = None,
|
771
1377
|
) -> dict[str, Any]:
|
772
1378
|
to_object: dict[str, Any] = {}
|
1379
|
+
|
773
1380
|
if getv(from_object, ['generation_config']) is not None:
|
774
1381
|
setv(
|
775
1382
|
parent_object,
|
@@ -830,14 +1437,27 @@ def _LiveConnectConfig_to_mldev(
|
|
830
1437
|
setv(
|
831
1438
|
parent_object,
|
832
1439
|
['setup', 'generationConfig', 'speechConfig'],
|
833
|
-
|
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']),
|
834
1454
|
)
|
835
1455
|
|
836
1456
|
if getv(from_object, ['system_instruction']) is not None:
|
837
1457
|
setv(
|
838
1458
|
parent_object,
|
839
1459
|
['setup', 'systemInstruction'],
|
840
|
-
|
1460
|
+
_Content_to_vertex(
|
841
1461
|
api_client,
|
842
1462
|
t.t_content(api_client, getv(from_object, ['system_instruction'])),
|
843
1463
|
to_object,
|
@@ -849,7 +1469,7 @@ def _LiveConnectConfig_to_mldev(
|
|
849
1469
|
parent_object,
|
850
1470
|
['setup', 'tools'],
|
851
1471
|
[
|
852
|
-
|
1472
|
+
_Tool_to_vertex(api_client, t.t_tool(api_client, item), to_object)
|
853
1473
|
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
854
1474
|
],
|
855
1475
|
)
|
@@ -858,7 +1478,7 @@ def _LiveConnectConfig_to_mldev(
|
|
858
1478
|
setv(
|
859
1479
|
parent_object,
|
860
1480
|
['setup', 'sessionResumption'],
|
861
|
-
|
1481
|
+
_SessionResumptionConfig_to_vertex(
|
862
1482
|
api_client, getv(from_object, ['session_resumption']), to_object
|
863
1483
|
),
|
864
1484
|
)
|
@@ -867,7 +1487,7 @@ def _LiveConnectConfig_to_mldev(
|
|
867
1487
|
setv(
|
868
1488
|
parent_object,
|
869
1489
|
['setup', 'inputAudioTranscription'],
|
870
|
-
|
1490
|
+
_AudioTranscriptionConfig_to_vertex(
|
871
1491
|
api_client,
|
872
1492
|
getv(from_object, ['input_audio_transcription']),
|
873
1493
|
to_object,
|
@@ -878,7 +1498,7 @@ def _LiveConnectConfig_to_mldev(
|
|
878
1498
|
setv(
|
879
1499
|
parent_object,
|
880
1500
|
['setup', 'outputAudioTranscription'],
|
881
|
-
|
1501
|
+
_AudioTranscriptionConfig_to_vertex(
|
882
1502
|
api_client,
|
883
1503
|
getv(from_object, ['output_audio_transcription']),
|
884
1504
|
to_object,
|
@@ -889,7 +1509,7 @@ def _LiveConnectConfig_to_mldev(
|
|
889
1509
|
setv(
|
890
1510
|
parent_object,
|
891
1511
|
['setup', 'realtimeInputConfig'],
|
892
|
-
|
1512
|
+
_RealtimeInputConfig_to_vertex(
|
893
1513
|
api_client, getv(from_object, ['realtime_input_config']), to_object
|
894
1514
|
),
|
895
1515
|
)
|
@@ -898,90 +1518,236 @@ def _LiveConnectConfig_to_mldev(
|
|
898
1518
|
setv(
|
899
1519
|
parent_object,
|
900
1520
|
['setup', 'contextWindowCompression'],
|
901
|
-
|
1521
|
+
_ContextWindowCompressionConfig_to_vertex(
|
902
1522
|
api_client,
|
903
1523
|
getv(from_object, ['context_window_compression']),
|
904
1524
|
to_object,
|
905
1525
|
),
|
906
1526
|
)
|
907
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
|
+
|
908
1537
|
return to_object
|
909
1538
|
|
910
1539
|
|
911
|
-
def
|
1540
|
+
def _LiveConnectParameters_to_mldev(
|
912
1541
|
api_client: BaseApiClient,
|
913
1542
|
from_object: Union[dict[str, Any], object],
|
914
1543
|
parent_object: Optional[dict[str, Any]] = None,
|
915
1544
|
) -> dict[str, Any]:
|
916
1545
|
to_object: dict[str, Any] = {}
|
917
|
-
if getv(from_object, ['
|
1546
|
+
if getv(from_object, ['model']) is not None:
|
918
1547
|
setv(
|
919
|
-
|
920
|
-
['setup', '
|
921
|
-
getv(from_object, ['
|
1548
|
+
to_object,
|
1549
|
+
['setup', 'model'],
|
1550
|
+
t.t_model(api_client, getv(from_object, ['model'])),
|
922
1551
|
)
|
923
1552
|
|
924
|
-
if getv(from_object, ['
|
1553
|
+
if getv(from_object, ['config']) is not None:
|
925
1554
|
setv(
|
926
|
-
|
927
|
-
['
|
928
|
-
|
1555
|
+
to_object,
|
1556
|
+
['config'],
|
1557
|
+
_LiveConnectConfig_to_mldev(
|
1558
|
+
api_client, getv(from_object, ['config']), to_object
|
1559
|
+
),
|
929
1560
|
)
|
930
1561
|
|
931
|
-
|
1562
|
+
return to_object
|
1563
|
+
|
1564
|
+
|
1565
|
+
def _LiveConnectParameters_to_vertex(
|
1566
|
+
api_client: BaseApiClient,
|
1567
|
+
from_object: Union[dict[str, Any], object],
|
1568
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1569
|
+
) -> dict[str, Any]:
|
1570
|
+
to_object: dict[str, Any] = {}
|
1571
|
+
if getv(from_object, ['model']) is not None:
|
932
1572
|
setv(
|
933
|
-
|
934
|
-
['setup', '
|
935
|
-
getv(from_object, ['
|
1573
|
+
to_object,
|
1574
|
+
['setup', 'model'],
|
1575
|
+
t.t_model(api_client, getv(from_object, ['model'])),
|
936
1576
|
)
|
937
1577
|
|
938
|
-
if getv(from_object, ['
|
1578
|
+
if getv(from_object, ['config']) is not None:
|
939
1579
|
setv(
|
940
|
-
|
941
|
-
['
|
942
|
-
|
1580
|
+
to_object,
|
1581
|
+
['config'],
|
1582
|
+
_LiveConnectConfig_to_vertex(
|
1583
|
+
api_client, getv(from_object, ['config']), to_object
|
1584
|
+
),
|
943
1585
|
)
|
944
1586
|
|
945
|
-
|
1587
|
+
return to_object
|
1588
|
+
|
1589
|
+
|
1590
|
+
def _ActivityStart_to_mldev(
|
1591
|
+
api_client: BaseApiClient,
|
1592
|
+
from_object: Union[dict[str, Any], object],
|
1593
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1594
|
+
) -> dict[str, Any]:
|
1595
|
+
to_object: dict[str, Any] = {}
|
1596
|
+
|
1597
|
+
return to_object
|
1598
|
+
|
1599
|
+
|
1600
|
+
def _ActivityStart_to_vertex(
|
1601
|
+
api_client: BaseApiClient,
|
1602
|
+
from_object: Union[dict[str, Any], object],
|
1603
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1604
|
+
) -> dict[str, Any]:
|
1605
|
+
to_object: dict[str, Any] = {}
|
1606
|
+
|
1607
|
+
return to_object
|
1608
|
+
|
1609
|
+
|
1610
|
+
def _ActivityEnd_to_mldev(
|
1611
|
+
api_client: BaseApiClient,
|
1612
|
+
from_object: Union[dict[str, Any], object],
|
1613
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1614
|
+
) -> dict[str, Any]:
|
1615
|
+
to_object: dict[str, Any] = {}
|
1616
|
+
|
1617
|
+
return to_object
|
1618
|
+
|
1619
|
+
|
1620
|
+
def _ActivityEnd_to_vertex(
|
1621
|
+
api_client: BaseApiClient,
|
1622
|
+
from_object: Union[dict[str, Any], object],
|
1623
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1624
|
+
) -> dict[str, Any]:
|
1625
|
+
to_object: dict[str, Any] = {}
|
1626
|
+
|
1627
|
+
return to_object
|
1628
|
+
|
1629
|
+
|
1630
|
+
def _LiveSendRealtimeInputParameters_to_mldev(
|
1631
|
+
api_client: BaseApiClient,
|
1632
|
+
from_object: Union[dict[str, Any], object],
|
1633
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1634
|
+
) -> dict[str, Any]:
|
1635
|
+
to_object: dict[str, Any] = {}
|
1636
|
+
if getv(from_object, ['media']) is not None:
|
946
1637
|
setv(
|
947
|
-
|
948
|
-
['
|
949
|
-
getv(from_object, ['
|
1638
|
+
to_object,
|
1639
|
+
['mediaChunks'],
|
1640
|
+
t.t_blobs(api_client, getv(from_object, ['media'])),
|
950
1641
|
)
|
951
1642
|
|
952
|
-
if getv(from_object, ['
|
1643
|
+
if getv(from_object, ['audio']) is not None:
|
953
1644
|
setv(
|
954
|
-
|
955
|
-
['
|
956
|
-
getv(from_object, ['
|
1645
|
+
to_object,
|
1646
|
+
['audio'],
|
1647
|
+
t.t_audio_blob(api_client, getv(from_object, ['audio'])),
|
957
1648
|
)
|
958
1649
|
|
959
|
-
if getv(from_object, ['
|
1650
|
+
if getv(from_object, ['audio_stream_end']) is not None:
|
1651
|
+
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
1652
|
+
|
1653
|
+
if getv(from_object, ['video']) is not None:
|
960
1654
|
setv(
|
961
|
-
|
962
|
-
['
|
963
|
-
getv(from_object, ['
|
1655
|
+
to_object,
|
1656
|
+
['video'],
|
1657
|
+
t.t_image_blob(api_client, getv(from_object, ['video'])),
|
964
1658
|
)
|
965
1659
|
|
966
|
-
if getv(from_object, ['
|
1660
|
+
if getv(from_object, ['text']) is not None:
|
1661
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
1662
|
+
|
1663
|
+
if getv(from_object, ['activity_start']) is not None:
|
967
1664
|
setv(
|
968
|
-
|
969
|
-
['
|
970
|
-
|
1665
|
+
to_object,
|
1666
|
+
['activityStart'],
|
1667
|
+
_ActivityStart_to_mldev(
|
1668
|
+
api_client, getv(from_object, ['activity_start']), to_object
|
1669
|
+
),
|
1670
|
+
)
|
1671
|
+
|
1672
|
+
if getv(from_object, ['activity_end']) is not None:
|
1673
|
+
setv(
|
1674
|
+
to_object,
|
1675
|
+
['activityEnd'],
|
1676
|
+
_ActivityEnd_to_mldev(
|
1677
|
+
api_client, getv(from_object, ['activity_end']), to_object
|
1678
|
+
),
|
1679
|
+
)
|
1680
|
+
|
1681
|
+
return to_object
|
1682
|
+
|
1683
|
+
|
1684
|
+
def _LiveSendRealtimeInputParameters_to_vertex(
|
1685
|
+
api_client: BaseApiClient,
|
1686
|
+
from_object: Union[dict[str, Any], object],
|
1687
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1688
|
+
) -> dict[str, Any]:
|
1689
|
+
to_object: dict[str, Any] = {}
|
1690
|
+
if getv(from_object, ['media']) is not None:
|
1691
|
+
setv(
|
1692
|
+
to_object,
|
1693
|
+
['mediaChunks'],
|
1694
|
+
t.t_blobs(api_client, getv(from_object, ['media'])),
|
1695
|
+
)
|
1696
|
+
|
1697
|
+
if getv(from_object, ['audio']) is not None:
|
1698
|
+
raise ValueError('audio parameter is not supported in Vertex AI.')
|
1699
|
+
|
1700
|
+
if getv(from_object, ['audio_stream_end']) is not None:
|
1701
|
+
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
1702
|
+
|
1703
|
+
if getv(from_object, ['video']) is not None:
|
1704
|
+
raise ValueError('video parameter is not supported in Vertex AI.')
|
1705
|
+
|
1706
|
+
if getv(from_object, ['text']) is not None:
|
1707
|
+
raise ValueError('text parameter is not supported in Vertex AI.')
|
1708
|
+
|
1709
|
+
if getv(from_object, ['activity_start']) is not None:
|
1710
|
+
setv(
|
1711
|
+
to_object,
|
1712
|
+
['activityStart'],
|
1713
|
+
_ActivityStart_to_vertex(
|
1714
|
+
api_client, getv(from_object, ['activity_start']), to_object
|
1715
|
+
),
|
1716
|
+
)
|
1717
|
+
|
1718
|
+
if getv(from_object, ['activity_end']) is not None:
|
1719
|
+
setv(
|
1720
|
+
to_object,
|
1721
|
+
['activityEnd'],
|
1722
|
+
_ActivityEnd_to_vertex(
|
1723
|
+
api_client, getv(from_object, ['activity_end']), to_object
|
1724
|
+
),
|
971
1725
|
)
|
972
1726
|
|
973
|
-
|
1727
|
+
return to_object
|
1728
|
+
|
1729
|
+
|
1730
|
+
def _LiveClientSetup_to_mldev(
|
1731
|
+
api_client: BaseApiClient,
|
1732
|
+
from_object: Union[dict[str, Any], object],
|
1733
|
+
parent_object: Optional[dict[str, Any]] = None,
|
1734
|
+
) -> dict[str, Any]:
|
1735
|
+
to_object: dict[str, Any] = {}
|
1736
|
+
if getv(from_object, ['model']) is not None:
|
1737
|
+
setv(to_object, ['model'], getv(from_object, ['model']))
|
1738
|
+
|
1739
|
+
if getv(from_object, ['generation_config']) is not None:
|
974
1740
|
setv(
|
975
|
-
|
976
|
-
['
|
977
|
-
getv(from_object, ['
|
1741
|
+
to_object,
|
1742
|
+
['generationConfig'],
|
1743
|
+
getv(from_object, ['generation_config']),
|
978
1744
|
)
|
979
1745
|
|
980
1746
|
if getv(from_object, ['system_instruction']) is not None:
|
981
1747
|
setv(
|
982
|
-
|
983
|
-
['
|
984
|
-
|
1748
|
+
to_object,
|
1749
|
+
['systemInstruction'],
|
1750
|
+
_Content_to_mldev(
|
985
1751
|
api_client,
|
986
1752
|
t.t_content(api_client, getv(from_object, ['system_instruction'])),
|
987
1753
|
to_object,
|
@@ -990,187 +1756,220 @@ def _LiveConnectConfig_to_vertex(
|
|
990
1756
|
|
991
1757
|
if getv(from_object, ['tools']) is not None:
|
992
1758
|
setv(
|
993
|
-
|
994
|
-
['
|
1759
|
+
to_object,
|
1760
|
+
['tools'],
|
995
1761
|
[
|
996
|
-
|
1762
|
+
_Tool_to_mldev(api_client, t.t_tool(api_client, item), to_object)
|
997
1763
|
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
998
1764
|
],
|
999
1765
|
)
|
1000
1766
|
|
1001
1767
|
if getv(from_object, ['session_resumption']) is not None:
|
1002
1768
|
setv(
|
1003
|
-
|
1004
|
-
['
|
1005
|
-
|
1769
|
+
to_object,
|
1770
|
+
['sessionResumption'],
|
1771
|
+
_SessionResumptionConfig_to_mldev(
|
1006
1772
|
api_client, getv(from_object, ['session_resumption']), to_object
|
1007
1773
|
),
|
1008
1774
|
)
|
1009
1775
|
|
1010
|
-
if getv(from_object, ['
|
1776
|
+
if getv(from_object, ['context_window_compression']) is not None:
|
1011
1777
|
setv(
|
1012
|
-
|
1013
|
-
['
|
1014
|
-
|
1778
|
+
to_object,
|
1779
|
+
['contextWindowCompression'],
|
1780
|
+
_ContextWindowCompressionConfig_to_mldev(
|
1015
1781
|
api_client,
|
1016
|
-
getv(from_object, ['
|
1782
|
+
getv(from_object, ['context_window_compression']),
|
1017
1783
|
to_object,
|
1018
1784
|
),
|
1019
1785
|
)
|
1020
1786
|
|
1021
|
-
if getv(from_object, ['
|
1787
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
1022
1788
|
setv(
|
1023
|
-
|
1024
|
-
['
|
1025
|
-
|
1789
|
+
to_object,
|
1790
|
+
['inputAudioTranscription'],
|
1791
|
+
_AudioTranscriptionConfig_to_mldev(
|
1026
1792
|
api_client,
|
1027
|
-
getv(from_object, ['
|
1793
|
+
getv(from_object, ['input_audio_transcription']),
|
1028
1794
|
to_object,
|
1029
1795
|
),
|
1030
1796
|
)
|
1031
1797
|
|
1032
|
-
if getv(from_object, ['
|
1798
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
1033
1799
|
setv(
|
1034
|
-
|
1035
|
-
['
|
1036
|
-
|
1037
|
-
api_client,
|
1800
|
+
to_object,
|
1801
|
+
['outputAudioTranscription'],
|
1802
|
+
_AudioTranscriptionConfig_to_mldev(
|
1803
|
+
api_client,
|
1804
|
+
getv(from_object, ['output_audio_transcription']),
|
1805
|
+
to_object,
|
1038
1806
|
),
|
1039
1807
|
)
|
1040
1808
|
|
1041
|
-
if getv(from_object, ['
|
1809
|
+
if getv(from_object, ['proactivity']) is not None:
|
1042
1810
|
setv(
|
1043
|
-
|
1044
|
-
['
|
1045
|
-
|
1046
|
-
api_client,
|
1047
|
-
getv(from_object, ['context_window_compression']),
|
1048
|
-
to_object,
|
1811
|
+
to_object,
|
1812
|
+
['proactivity'],
|
1813
|
+
_ProactivityConfig_to_mldev(
|
1814
|
+
api_client, getv(from_object, ['proactivity']), to_object
|
1049
1815
|
),
|
1050
1816
|
)
|
1051
1817
|
|
1052
1818
|
return to_object
|
1053
1819
|
|
1054
1820
|
|
1055
|
-
def
|
1821
|
+
def _LiveClientSetup_to_vertex(
|
1056
1822
|
api_client: BaseApiClient,
|
1057
1823
|
from_object: Union[dict[str, Any], object],
|
1058
1824
|
parent_object: Optional[dict[str, Any]] = None,
|
1059
1825
|
) -> dict[str, Any]:
|
1060
1826
|
to_object: dict[str, Any] = {}
|
1061
1827
|
if getv(from_object, ['model']) is not None:
|
1828
|
+
setv(to_object, ['model'], getv(from_object, ['model']))
|
1829
|
+
|
1830
|
+
if getv(from_object, ['generation_config']) is not None:
|
1062
1831
|
setv(
|
1063
1832
|
to_object,
|
1064
|
-
['
|
1065
|
-
|
1833
|
+
['generationConfig'],
|
1834
|
+
getv(from_object, ['generation_config']),
|
1066
1835
|
)
|
1067
1836
|
|
1068
|
-
if getv(from_object, ['
|
1837
|
+
if getv(from_object, ['system_instruction']) is not None:
|
1069
1838
|
setv(
|
1070
1839
|
to_object,
|
1071
|
-
['
|
1072
|
-
|
1073
|
-
api_client,
|
1840
|
+
['systemInstruction'],
|
1841
|
+
_Content_to_vertex(
|
1842
|
+
api_client,
|
1843
|
+
t.t_content(api_client, getv(from_object, ['system_instruction'])),
|
1844
|
+
to_object,
|
1074
1845
|
),
|
1075
1846
|
)
|
1076
1847
|
|
1077
|
-
|
1078
|
-
|
1848
|
+
if getv(from_object, ['tools']) is not None:
|
1849
|
+
setv(
|
1850
|
+
to_object,
|
1851
|
+
['tools'],
|
1852
|
+
[
|
1853
|
+
_Tool_to_vertex(api_client, t.t_tool(api_client, item), to_object)
|
1854
|
+
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
1855
|
+
],
|
1856
|
+
)
|
1079
1857
|
|
1080
|
-
|
1081
|
-
api_client: BaseApiClient,
|
1082
|
-
from_object: Union[dict[str, Any], object],
|
1083
|
-
parent_object: Optional[dict[str, Any]] = None,
|
1084
|
-
) -> dict[str, Any]:
|
1085
|
-
to_object: dict[str, Any] = {}
|
1086
|
-
if getv(from_object, ['model']) is not None:
|
1858
|
+
if getv(from_object, ['session_resumption']) is not None:
|
1087
1859
|
setv(
|
1088
1860
|
to_object,
|
1089
|
-
['
|
1090
|
-
|
1861
|
+
['sessionResumption'],
|
1862
|
+
_SessionResumptionConfig_to_vertex(
|
1863
|
+
api_client, getv(from_object, ['session_resumption']), to_object
|
1864
|
+
),
|
1091
1865
|
)
|
1092
1866
|
|
1093
|
-
if getv(from_object, ['
|
1867
|
+
if getv(from_object, ['context_window_compression']) is not None:
|
1094
1868
|
setv(
|
1095
1869
|
to_object,
|
1096
|
-
['
|
1097
|
-
|
1098
|
-
api_client,
|
1870
|
+
['contextWindowCompression'],
|
1871
|
+
_ContextWindowCompressionConfig_to_vertex(
|
1872
|
+
api_client,
|
1873
|
+
getv(from_object, ['context_window_compression']),
|
1874
|
+
to_object,
|
1099
1875
|
),
|
1100
1876
|
)
|
1101
1877
|
|
1102
|
-
|
1878
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
1879
|
+
setv(
|
1880
|
+
to_object,
|
1881
|
+
['inputAudioTranscription'],
|
1882
|
+
_AudioTranscriptionConfig_to_vertex(
|
1883
|
+
api_client,
|
1884
|
+
getv(from_object, ['input_audio_transcription']),
|
1885
|
+
to_object,
|
1886
|
+
),
|
1887
|
+
)
|
1103
1888
|
|
1889
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
1890
|
+
setv(
|
1891
|
+
to_object,
|
1892
|
+
['outputAudioTranscription'],
|
1893
|
+
_AudioTranscriptionConfig_to_vertex(
|
1894
|
+
api_client,
|
1895
|
+
getv(from_object, ['output_audio_transcription']),
|
1896
|
+
to_object,
|
1897
|
+
),
|
1898
|
+
)
|
1104
1899
|
|
1105
|
-
|
1106
|
-
|
1107
|
-
|
1108
|
-
|
1109
|
-
|
1110
|
-
|
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
|
+
)
|
1111
1908
|
|
1112
1909
|
return to_object
|
1113
1910
|
|
1114
1911
|
|
1115
|
-
def
|
1912
|
+
def _LiveClientContent_to_mldev(
|
1116
1913
|
api_client: BaseApiClient,
|
1117
1914
|
from_object: Union[dict[str, Any], object],
|
1118
1915
|
parent_object: Optional[dict[str, Any]] = None,
|
1119
1916
|
) -> dict[str, Any]:
|
1120
1917
|
to_object: dict[str, Any] = {}
|
1918
|
+
if getv(from_object, ['turns']) is not None:
|
1919
|
+
setv(
|
1920
|
+
to_object,
|
1921
|
+
['turns'],
|
1922
|
+
[
|
1923
|
+
_Content_to_mldev(api_client, item, to_object)
|
1924
|
+
for item in getv(from_object, ['turns'])
|
1925
|
+
],
|
1926
|
+
)
|
1121
1927
|
|
1122
|
-
|
1123
|
-
|
1124
|
-
|
1125
|
-
def _ActivityEnd_to_mldev(
|
1126
|
-
api_client: BaseApiClient,
|
1127
|
-
from_object: Union[dict[str, Any], object],
|
1128
|
-
parent_object: Optional[dict[str, Any]] = None,
|
1129
|
-
) -> dict[str, Any]:
|
1130
|
-
to_object: dict[str, Any] = {}
|
1928
|
+
if getv(from_object, ['turn_complete']) is not None:
|
1929
|
+
setv(to_object, ['turnComplete'], getv(from_object, ['turn_complete']))
|
1131
1930
|
|
1132
1931
|
return to_object
|
1133
1932
|
|
1134
1933
|
|
1135
|
-
def
|
1934
|
+
def _LiveClientContent_to_vertex(
|
1136
1935
|
api_client: BaseApiClient,
|
1137
1936
|
from_object: Union[dict[str, Any], object],
|
1138
1937
|
parent_object: Optional[dict[str, Any]] = None,
|
1139
1938
|
) -> dict[str, Any]:
|
1140
1939
|
to_object: dict[str, Any] = {}
|
1940
|
+
if getv(from_object, ['turns']) is not None:
|
1941
|
+
setv(
|
1942
|
+
to_object,
|
1943
|
+
['turns'],
|
1944
|
+
[
|
1945
|
+
_Content_to_vertex(api_client, item, to_object)
|
1946
|
+
for item in getv(from_object, ['turns'])
|
1947
|
+
],
|
1948
|
+
)
|
1949
|
+
|
1950
|
+
if getv(from_object, ['turn_complete']) is not None:
|
1951
|
+
setv(to_object, ['turnComplete'], getv(from_object, ['turn_complete']))
|
1141
1952
|
|
1142
1953
|
return to_object
|
1143
1954
|
|
1144
1955
|
|
1145
|
-
def
|
1956
|
+
def _LiveClientRealtimeInput_to_mldev(
|
1146
1957
|
api_client: BaseApiClient,
|
1147
1958
|
from_object: Union[dict[str, Any], object],
|
1148
1959
|
parent_object: Optional[dict[str, Any]] = None,
|
1149
1960
|
) -> dict[str, Any]:
|
1150
1961
|
to_object: dict[str, Any] = {}
|
1151
|
-
if getv(from_object, ['
|
1152
|
-
setv(
|
1153
|
-
to_object,
|
1154
|
-
['mediaChunks'],
|
1155
|
-
t.t_blobs(api_client, getv(from_object, ['media'])),
|
1156
|
-
)
|
1962
|
+
if getv(from_object, ['media_chunks']) is not None:
|
1963
|
+
setv(to_object, ['mediaChunks'], getv(from_object, ['media_chunks']))
|
1157
1964
|
|
1158
1965
|
if getv(from_object, ['audio']) is not None:
|
1159
|
-
setv(
|
1160
|
-
to_object,
|
1161
|
-
['audio'],
|
1162
|
-
t.t_audio_blob(api_client, getv(from_object, ['audio'])),
|
1163
|
-
)
|
1966
|
+
setv(to_object, ['audio'], getv(from_object, ['audio']))
|
1164
1967
|
|
1165
1968
|
if getv(from_object, ['audio_stream_end']) is not None:
|
1166
1969
|
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
1167
1970
|
|
1168
1971
|
if getv(from_object, ['video']) is not None:
|
1169
|
-
setv(
|
1170
|
-
to_object,
|
1171
|
-
['video'],
|
1172
|
-
t.t_image_blob(api_client, getv(from_object, ['video'])),
|
1173
|
-
)
|
1972
|
+
setv(to_object, ['video'], getv(from_object, ['video']))
|
1174
1973
|
|
1175
1974
|
if getv(from_object, ['text']) is not None:
|
1176
1975
|
setv(to_object, ['text'], getv(from_object, ['text']))
|
@@ -1196,24 +1995,22 @@ def _LiveSendRealtimeInputParameters_to_mldev(
|
|
1196
1995
|
return to_object
|
1197
1996
|
|
1198
1997
|
|
1199
|
-
def
|
1998
|
+
def _LiveClientRealtimeInput_to_vertex(
|
1200
1999
|
api_client: BaseApiClient,
|
1201
2000
|
from_object: Union[dict[str, Any], object],
|
1202
2001
|
parent_object: Optional[dict[str, Any]] = None,
|
1203
2002
|
) -> dict[str, Any]:
|
1204
2003
|
to_object: dict[str, Any] = {}
|
1205
|
-
if getv(from_object, ['
|
1206
|
-
setv(
|
1207
|
-
to_object,
|
1208
|
-
['mediaChunks'],
|
1209
|
-
t.t_blobs(api_client, getv(from_object, ['media'])),
|
1210
|
-
)
|
2004
|
+
if getv(from_object, ['media_chunks']) is not None:
|
2005
|
+
setv(to_object, ['mediaChunks'], getv(from_object, ['media_chunks']))
|
1211
2006
|
|
1212
2007
|
if getv(from_object, ['audio']) is not None:
|
1213
2008
|
raise ValueError('audio parameter is not supported in Vertex AI.')
|
1214
2009
|
|
1215
2010
|
if getv(from_object, ['audio_stream_end']) is not None:
|
1216
|
-
|
2011
|
+
raise ValueError(
|
2012
|
+
'audio_stream_end parameter is not supported in Vertex AI.'
|
2013
|
+
)
|
1217
2014
|
|
1218
2015
|
if getv(from_object, ['video']) is not None:
|
1219
2016
|
raise ValueError('video parameter is not supported in Vertex AI.')
|
@@ -1242,375 +2039,463 @@ def _LiveSendRealtimeInputParameters_to_vertex(
|
|
1242
2039
|
return to_object
|
1243
2040
|
|
1244
2041
|
|
1245
|
-
def
|
2042
|
+
def _FunctionResponse_to_mldev(
|
2043
|
+
api_client: BaseApiClient,
|
2044
|
+
from_object: Union[dict[str, Any], object],
|
2045
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2046
|
+
) -> dict[str, Any]:
|
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
|
+
|
2054
|
+
if getv(from_object, ['id']) is not None:
|
2055
|
+
setv(to_object, ['id'], getv(from_object, ['id']))
|
2056
|
+
|
2057
|
+
if getv(from_object, ['name']) is not None:
|
2058
|
+
setv(to_object, ['name'], getv(from_object, ['name']))
|
2059
|
+
|
2060
|
+
if getv(from_object, ['response']) is not None:
|
2061
|
+
setv(to_object, ['response'], getv(from_object, ['response']))
|
2062
|
+
|
2063
|
+
return to_object
|
2064
|
+
|
2065
|
+
|
2066
|
+
def _FunctionResponse_to_vertex(
|
2067
|
+
api_client: BaseApiClient,
|
2068
|
+
from_object: Union[dict[str, Any], object],
|
2069
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2070
|
+
) -> dict[str, Any]:
|
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
|
+
|
2078
|
+
if getv(from_object, ['id']) is not None:
|
2079
|
+
setv(to_object, ['id'], getv(from_object, ['id']))
|
2080
|
+
|
2081
|
+
if getv(from_object, ['name']) is not None:
|
2082
|
+
setv(to_object, ['name'], getv(from_object, ['name']))
|
2083
|
+
|
2084
|
+
if getv(from_object, ['response']) is not None:
|
2085
|
+
setv(to_object, ['response'], getv(from_object, ['response']))
|
2086
|
+
|
2087
|
+
return to_object
|
2088
|
+
|
2089
|
+
|
2090
|
+
def _LiveClientToolResponse_to_mldev(
|
1246
2091
|
api_client: BaseApiClient,
|
1247
2092
|
from_object: Union[dict[str, Any], object],
|
1248
2093
|
parent_object: Optional[dict[str, Any]] = None,
|
1249
2094
|
) -> dict[str, Any]:
|
1250
2095
|
to_object: dict[str, Any] = {}
|
1251
|
-
if getv(from_object, ['
|
1252
|
-
setv(to_object, ['model'], getv(from_object, ['model']))
|
1253
|
-
|
1254
|
-
if getv(from_object, ['generation_config']) is not None:
|
2096
|
+
if getv(from_object, ['function_responses']) is not None:
|
1255
2097
|
setv(
|
1256
2098
|
to_object,
|
1257
|
-
['
|
1258
|
-
|
2099
|
+
['functionResponses'],
|
2100
|
+
[
|
2101
|
+
_FunctionResponse_to_mldev(api_client, item, to_object)
|
2102
|
+
for item in getv(from_object, ['function_responses'])
|
2103
|
+
],
|
1259
2104
|
)
|
1260
2105
|
|
1261
|
-
|
1262
|
-
setv(
|
1263
|
-
to_object,
|
1264
|
-
['systemInstruction'],
|
1265
|
-
_Content_to_mldev(
|
1266
|
-
api_client,
|
1267
|
-
t.t_content(api_client, getv(from_object, ['system_instruction'])),
|
1268
|
-
to_object,
|
1269
|
-
),
|
1270
|
-
)
|
2106
|
+
return to_object
|
1271
2107
|
|
1272
|
-
|
2108
|
+
|
2109
|
+
def _LiveClientToolResponse_to_vertex(
|
2110
|
+
api_client: BaseApiClient,
|
2111
|
+
from_object: Union[dict[str, Any], object],
|
2112
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2113
|
+
) -> dict[str, Any]:
|
2114
|
+
to_object: dict[str, Any] = {}
|
2115
|
+
if getv(from_object, ['function_responses']) is not None:
|
1273
2116
|
setv(
|
1274
2117
|
to_object,
|
1275
|
-
['
|
2118
|
+
['functionResponses'],
|
1276
2119
|
[
|
1277
|
-
|
1278
|
-
for item in
|
2120
|
+
_FunctionResponse_to_vertex(api_client, item, to_object)
|
2121
|
+
for item in getv(from_object, ['function_responses'])
|
1279
2122
|
],
|
1280
2123
|
)
|
1281
2124
|
|
1282
|
-
|
2125
|
+
return to_object
|
2126
|
+
|
2127
|
+
|
2128
|
+
def _LiveClientMessage_to_mldev(
|
2129
|
+
api_client: BaseApiClient,
|
2130
|
+
from_object: Union[dict[str, Any], object],
|
2131
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2132
|
+
) -> dict[str, Any]:
|
2133
|
+
to_object: dict[str, Any] = {}
|
2134
|
+
if getv(from_object, ['setup']) is not None:
|
1283
2135
|
setv(
|
1284
2136
|
to_object,
|
1285
|
-
['
|
1286
|
-
|
1287
|
-
api_client, getv(from_object, ['
|
2137
|
+
['setup'],
|
2138
|
+
_LiveClientSetup_to_mldev(
|
2139
|
+
api_client, getv(from_object, ['setup']), to_object
|
1288
2140
|
),
|
1289
2141
|
)
|
1290
2142
|
|
1291
|
-
if getv(from_object, ['
|
2143
|
+
if getv(from_object, ['client_content']) is not None:
|
1292
2144
|
setv(
|
1293
2145
|
to_object,
|
1294
|
-
['
|
1295
|
-
|
1296
|
-
api_client,
|
1297
|
-
getv(from_object, ['context_window_compression']),
|
1298
|
-
to_object,
|
2146
|
+
['clientContent'],
|
2147
|
+
_LiveClientContent_to_mldev(
|
2148
|
+
api_client, getv(from_object, ['client_content']), to_object
|
1299
2149
|
),
|
1300
2150
|
)
|
1301
2151
|
|
1302
|
-
if getv(from_object, ['
|
2152
|
+
if getv(from_object, ['realtime_input']) is not None:
|
1303
2153
|
setv(
|
1304
2154
|
to_object,
|
1305
|
-
['
|
1306
|
-
|
1307
|
-
api_client,
|
1308
|
-
getv(from_object, ['input_audio_transcription']),
|
1309
|
-
to_object,
|
2155
|
+
['realtimeInput'],
|
2156
|
+
_LiveClientRealtimeInput_to_mldev(
|
2157
|
+
api_client, getv(from_object, ['realtime_input']), to_object
|
1310
2158
|
),
|
1311
2159
|
)
|
1312
2160
|
|
1313
|
-
if getv(from_object, ['
|
2161
|
+
if getv(from_object, ['tool_response']) is not None:
|
1314
2162
|
setv(
|
1315
2163
|
to_object,
|
1316
|
-
['
|
1317
|
-
|
1318
|
-
api_client,
|
1319
|
-
getv(from_object, ['output_audio_transcription']),
|
1320
|
-
to_object,
|
2164
|
+
['toolResponse'],
|
2165
|
+
_LiveClientToolResponse_to_mldev(
|
2166
|
+
api_client, getv(from_object, ['tool_response']), to_object
|
1321
2167
|
),
|
1322
2168
|
)
|
1323
2169
|
|
1324
2170
|
return to_object
|
1325
2171
|
|
1326
2172
|
|
1327
|
-
def
|
2173
|
+
def _LiveClientMessage_to_vertex(
|
1328
2174
|
api_client: BaseApiClient,
|
1329
2175
|
from_object: Union[dict[str, Any], object],
|
1330
2176
|
parent_object: Optional[dict[str, Any]] = None,
|
1331
2177
|
) -> dict[str, Any]:
|
1332
2178
|
to_object: dict[str, Any] = {}
|
1333
|
-
if getv(from_object, ['
|
1334
|
-
setv(to_object, ['model'], getv(from_object, ['model']))
|
1335
|
-
|
1336
|
-
if getv(from_object, ['generation_config']) is not None:
|
1337
|
-
setv(
|
1338
|
-
to_object,
|
1339
|
-
['generationConfig'],
|
1340
|
-
getv(from_object, ['generation_config']),
|
1341
|
-
)
|
1342
|
-
|
1343
|
-
if getv(from_object, ['system_instruction']) is not None:
|
2179
|
+
if getv(from_object, ['setup']) is not None:
|
1344
2180
|
setv(
|
1345
2181
|
to_object,
|
1346
|
-
['
|
1347
|
-
|
1348
|
-
api_client,
|
1349
|
-
t.t_content(api_client, getv(from_object, ['system_instruction'])),
|
1350
|
-
to_object,
|
2182
|
+
['setup'],
|
2183
|
+
_LiveClientSetup_to_vertex(
|
2184
|
+
api_client, getv(from_object, ['setup']), to_object
|
1351
2185
|
),
|
1352
2186
|
)
|
1353
2187
|
|
1354
|
-
if getv(from_object, ['
|
1355
|
-
setv(
|
1356
|
-
to_object,
|
1357
|
-
['tools'],
|
1358
|
-
[
|
1359
|
-
_Tool_to_vertex(api_client, t.t_tool(api_client, item), to_object)
|
1360
|
-
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
1361
|
-
],
|
1362
|
-
)
|
1363
|
-
|
1364
|
-
if getv(from_object, ['session_resumption']) is not None:
|
2188
|
+
if getv(from_object, ['client_content']) is not None:
|
1365
2189
|
setv(
|
1366
2190
|
to_object,
|
1367
|
-
['
|
1368
|
-
|
1369
|
-
api_client, getv(from_object, ['
|
2191
|
+
['clientContent'],
|
2192
|
+
_LiveClientContent_to_vertex(
|
2193
|
+
api_client, getv(from_object, ['client_content']), to_object
|
1370
2194
|
),
|
1371
2195
|
)
|
1372
2196
|
|
1373
|
-
if getv(from_object, ['
|
2197
|
+
if getv(from_object, ['realtime_input']) is not None:
|
1374
2198
|
setv(
|
1375
2199
|
to_object,
|
1376
|
-
['
|
1377
|
-
|
1378
|
-
api_client,
|
1379
|
-
getv(from_object, ['context_window_compression']),
|
1380
|
-
to_object,
|
2200
|
+
['realtimeInput'],
|
2201
|
+
_LiveClientRealtimeInput_to_vertex(
|
2202
|
+
api_client, getv(from_object, ['realtime_input']), to_object
|
1381
2203
|
),
|
1382
2204
|
)
|
1383
2205
|
|
1384
|
-
if getv(from_object, ['
|
2206
|
+
if getv(from_object, ['tool_response']) is not None:
|
1385
2207
|
setv(
|
1386
2208
|
to_object,
|
1387
|
-
['
|
1388
|
-
|
1389
|
-
api_client,
|
1390
|
-
getv(from_object, ['input_audio_transcription']),
|
1391
|
-
to_object,
|
2209
|
+
['toolResponse'],
|
2210
|
+
_LiveClientToolResponse_to_vertex(
|
2211
|
+
api_client, getv(from_object, ['tool_response']), to_object
|
1392
2212
|
),
|
1393
2213
|
)
|
1394
2214
|
|
1395
|
-
|
1396
|
-
|
1397
|
-
|
1398
|
-
|
1399
|
-
|
1400
|
-
|
1401
|
-
|
1402
|
-
|
1403
|
-
|
1404
|
-
|
2215
|
+
return to_object
|
2216
|
+
|
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']))
|
1405
2226
|
|
1406
2227
|
return to_object
|
1407
2228
|
|
1408
2229
|
|
1409
|
-
def
|
2230
|
+
def _LiveMusicConnectParameters_to_vertex(
|
1410
2231
|
api_client: BaseApiClient,
|
1411
2232
|
from_object: Union[dict[str, Any], object],
|
1412
2233
|
parent_object: Optional[dict[str, Any]] = None,
|
1413
2234
|
) -> dict[str, Any]:
|
1414
2235
|
to_object: dict[str, Any] = {}
|
1415
|
-
if getv(from_object, ['
|
1416
|
-
|
1417
|
-
to_object,
|
1418
|
-
['turns'],
|
1419
|
-
[
|
1420
|
-
_Content_to_mldev(api_client, item, to_object)
|
1421
|
-
for item in getv(from_object, ['turns'])
|
1422
|
-
],
|
1423
|
-
)
|
2236
|
+
if getv(from_object, ['model']) is not None:
|
2237
|
+
raise ValueError('model parameter is not supported in Vertex AI.')
|
1424
2238
|
|
1425
|
-
|
1426
|
-
|
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']))
|
1427
2253
|
|
1428
2254
|
return to_object
|
1429
2255
|
|
1430
2256
|
|
1431
|
-
def
|
2257
|
+
def _WeightedPrompt_to_vertex(
|
1432
2258
|
api_client: BaseApiClient,
|
1433
2259
|
from_object: Union[dict[str, Any], object],
|
1434
2260
|
parent_object: Optional[dict[str, Any]] = None,
|
1435
2261
|
) -> dict[str, Any]:
|
1436
2262
|
to_object: dict[str, Any] = {}
|
1437
|
-
if getv(from_object, ['
|
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:
|
1438
2279
|
setv(
|
1439
2280
|
to_object,
|
1440
|
-
['
|
2281
|
+
['weightedPrompts'],
|
1441
2282
|
[
|
1442
|
-
|
1443
|
-
for item in getv(from_object, ['
|
2283
|
+
_WeightedPrompt_to_mldev(api_client, item, to_object)
|
2284
|
+
for item in getv(from_object, ['weighted_prompts'])
|
1444
2285
|
],
|
1445
2286
|
)
|
1446
2287
|
|
1447
|
-
|
1448
|
-
|
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
|
+
)
|
1449
2301
|
|
1450
2302
|
return to_object
|
1451
2303
|
|
1452
2304
|
|
1453
|
-
def
|
2305
|
+
def _LiveMusicGenerationConfig_to_mldev(
|
1454
2306
|
api_client: BaseApiClient,
|
1455
2307
|
from_object: Union[dict[str, Any], object],
|
1456
2308
|
parent_object: Optional[dict[str, Any]] = None,
|
1457
2309
|
) -> dict[str, Any]:
|
1458
2310
|
to_object: dict[str, Any] = {}
|
1459
|
-
if getv(from_object, ['
|
1460
|
-
setv(to_object, ['
|
2311
|
+
if getv(from_object, ['temperature']) is not None:
|
2312
|
+
setv(to_object, ['temperature'], getv(from_object, ['temperature']))
|
1461
2313
|
|
1462
|
-
if getv(from_object, ['
|
1463
|
-
setv(to_object, ['
|
2314
|
+
if getv(from_object, ['top_k']) is not None:
|
2315
|
+
setv(to_object, ['topK'], getv(from_object, ['top_k']))
|
1464
2316
|
|
1465
|
-
if getv(from_object, ['
|
1466
|
-
setv(to_object, ['
|
2317
|
+
if getv(from_object, ['seed']) is not None:
|
2318
|
+
setv(to_object, ['seed'], getv(from_object, ['seed']))
|
1467
2319
|
|
1468
|
-
if getv(from_object, ['
|
1469
|
-
setv(to_object, ['
|
2320
|
+
if getv(from_object, ['guidance']) is not None:
|
2321
|
+
setv(to_object, ['guidance'], getv(from_object, ['guidance']))
|
1470
2322
|
|
1471
|
-
if getv(from_object, ['
|
1472
|
-
setv(to_object, ['
|
2323
|
+
if getv(from_object, ['bpm']) is not None:
|
2324
|
+
setv(to_object, ['bpm'], getv(from_object, ['bpm']))
|
1473
2325
|
|
1474
|
-
if getv(from_object, ['
|
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:
|
1475
2342
|
setv(
|
1476
2343
|
to_object,
|
1477
|
-
['
|
1478
|
-
|
1479
|
-
api_client, getv(from_object, ['activity_start']), to_object
|
1480
|
-
),
|
2344
|
+
['onlyBassAndDrums'],
|
2345
|
+
getv(from_object, ['only_bass_and_drums']),
|
1481
2346
|
)
|
1482
2347
|
|
1483
|
-
if getv(from_object, ['
|
2348
|
+
if getv(from_object, ['music_generation_mode']) is not None:
|
1484
2349
|
setv(
|
1485
|
-
to_object,
|
1486
|
-
['
|
1487
|
-
|
1488
|
-
api_client, getv(from_object, ['activity_end']), to_object
|
1489
|
-
),
|
2350
|
+
to_object,
|
2351
|
+
['musicGenerationMode'],
|
2352
|
+
getv(from_object, ['music_generation_mode']),
|
1490
2353
|
)
|
1491
2354
|
|
1492
2355
|
return to_object
|
1493
2356
|
|
1494
2357
|
|
1495
|
-
def
|
2358
|
+
def _LiveMusicGenerationConfig_to_vertex(
|
1496
2359
|
api_client: BaseApiClient,
|
1497
2360
|
from_object: Union[dict[str, Any], object],
|
1498
2361
|
parent_object: Optional[dict[str, Any]] = None,
|
1499
2362
|
) -> dict[str, Any]:
|
1500
2363
|
to_object: dict[str, Any] = {}
|
1501
|
-
if getv(from_object, ['
|
1502
|
-
|
2364
|
+
if getv(from_object, ['temperature']) is not None:
|
2365
|
+
raise ValueError('temperature parameter is not supported in Vertex AI.')
|
1503
2366
|
|
1504
|
-
if getv(from_object, ['
|
1505
|
-
raise ValueError('
|
2367
|
+
if getv(from_object, ['top_k']) is not None:
|
2368
|
+
raise ValueError('top_k parameter is not supported in Vertex AI.')
|
1506
2369
|
|
1507
|
-
if getv(from_object, ['
|
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:
|
1508
2395
|
raise ValueError(
|
1509
|
-
'
|
2396
|
+
'only_bass_and_drums parameter is not supported in Vertex AI.'
|
1510
2397
|
)
|
1511
2398
|
|
1512
|
-
if getv(from_object, ['
|
1513
|
-
raise ValueError(
|
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
|
+
)
|
1514
2403
|
|
1515
|
-
|
1516
|
-
raise ValueError('text parameter is not supported in Vertex AI.')
|
2404
|
+
return to_object
|
1517
2405
|
|
1518
|
-
if getv(from_object, ['activity_start']) is not None:
|
1519
|
-
setv(
|
1520
|
-
to_object,
|
1521
|
-
['activityStart'],
|
1522
|
-
_ActivityStart_to_vertex(
|
1523
|
-
api_client, getv(from_object, ['activity_start']), to_object
|
1524
|
-
),
|
1525
|
-
)
|
1526
2406
|
|
1527
|
-
|
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:
|
1528
2414
|
setv(
|
1529
2415
|
to_object,
|
1530
|
-
['
|
1531
|
-
|
1532
|
-
api_client,
|
2416
|
+
['musicGenerationConfig'],
|
2417
|
+
_LiveMusicGenerationConfig_to_mldev(
|
2418
|
+
api_client,
|
2419
|
+
getv(from_object, ['music_generation_config']),
|
2420
|
+
to_object,
|
1533
2421
|
),
|
1534
2422
|
)
|
1535
2423
|
|
1536
2424
|
return to_object
|
1537
2425
|
|
1538
2426
|
|
1539
|
-
def
|
2427
|
+
def _LiveMusicSetConfigParameters_to_vertex(
|
1540
2428
|
api_client: BaseApiClient,
|
1541
2429
|
from_object: Union[dict[str, Any], object],
|
1542
2430
|
parent_object: Optional[dict[str, Any]] = None,
|
1543
2431
|
) -> dict[str, Any]:
|
1544
2432
|
to_object: dict[str, Any] = {}
|
1545
|
-
if getv(from_object, ['
|
1546
|
-
|
1547
|
-
|
1548
|
-
|
1549
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
1550
|
-
|
1551
|
-
if getv(from_object, ['response']) is not None:
|
1552
|
-
setv(to_object, ['response'], getv(from_object, ['response']))
|
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
|
+
)
|
1553
2437
|
|
1554
2438
|
return to_object
|
1555
2439
|
|
1556
2440
|
|
1557
|
-
def
|
2441
|
+
def _LiveMusicClientSetup_to_mldev(
|
1558
2442
|
api_client: BaseApiClient,
|
1559
2443
|
from_object: Union[dict[str, Any], object],
|
1560
2444
|
parent_object: Optional[dict[str, Any]] = None,
|
1561
2445
|
) -> dict[str, Any]:
|
1562
2446
|
to_object: dict[str, Any] = {}
|
1563
|
-
if getv(from_object, ['
|
1564
|
-
|
2447
|
+
if getv(from_object, ['model']) is not None:
|
2448
|
+
setv(to_object, ['model'], getv(from_object, ['model']))
|
1565
2449
|
|
1566
|
-
|
1567
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
2450
|
+
return to_object
|
1568
2451
|
|
1569
|
-
|
1570
|
-
|
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.')
|
1571
2461
|
|
1572
2462
|
return to_object
|
1573
2463
|
|
1574
2464
|
|
1575
|
-
def
|
2465
|
+
def _LiveMusicClientContent_to_mldev(
|
1576
2466
|
api_client: BaseApiClient,
|
1577
2467
|
from_object: Union[dict[str, Any], object],
|
1578
2468
|
parent_object: Optional[dict[str, Any]] = None,
|
1579
2469
|
) -> dict[str, Any]:
|
1580
2470
|
to_object: dict[str, Any] = {}
|
1581
|
-
if getv(from_object, ['
|
2471
|
+
if getv(from_object, ['weighted_prompts']) is not None:
|
1582
2472
|
setv(
|
1583
2473
|
to_object,
|
1584
|
-
['
|
2474
|
+
['weightedPrompts'],
|
1585
2475
|
[
|
1586
|
-
|
1587
|
-
for item in getv(from_object, ['
|
2476
|
+
_WeightedPrompt_to_mldev(api_client, item, to_object)
|
2477
|
+
for item in getv(from_object, ['weighted_prompts'])
|
1588
2478
|
],
|
1589
2479
|
)
|
1590
2480
|
|
1591
2481
|
return to_object
|
1592
2482
|
|
1593
2483
|
|
1594
|
-
def
|
2484
|
+
def _LiveMusicClientContent_to_vertex(
|
1595
2485
|
api_client: BaseApiClient,
|
1596
2486
|
from_object: Union[dict[str, Any], object],
|
1597
2487
|
parent_object: Optional[dict[str, Any]] = None,
|
1598
2488
|
) -> dict[str, Any]:
|
1599
2489
|
to_object: dict[str, Any] = {}
|
1600
|
-
if getv(from_object, ['
|
1601
|
-
|
1602
|
-
|
1603
|
-
['functionResponses'],
|
1604
|
-
[
|
1605
|
-
_FunctionResponse_to_vertex(api_client, item, to_object)
|
1606
|
-
for item in getv(from_object, ['function_responses'])
|
1607
|
-
],
|
2490
|
+
if getv(from_object, ['weighted_prompts']) is not None:
|
2491
|
+
raise ValueError(
|
2492
|
+
'weighted_prompts parameter is not supported in Vertex AI.'
|
1608
2493
|
)
|
1609
2494
|
|
1610
2495
|
return to_object
|
1611
2496
|
|
1612
2497
|
|
1613
|
-
def
|
2498
|
+
def _LiveMusicClientMessage_to_mldev(
|
1614
2499
|
api_client: BaseApiClient,
|
1615
2500
|
from_object: Union[dict[str, Any], object],
|
1616
2501
|
parent_object: Optional[dict[str, Any]] = None,
|
@@ -1620,7 +2505,7 @@ def _LiveClientMessage_to_mldev(
|
|
1620
2505
|
setv(
|
1621
2506
|
to_object,
|
1622
2507
|
['setup'],
|
1623
|
-
|
2508
|
+
_LiveMusicClientSetup_to_mldev(
|
1624
2509
|
api_client, getv(from_object, ['setup']), to_object
|
1625
2510
|
),
|
1626
2511
|
)
|
@@ -1629,72 +2514,50 @@ def _LiveClientMessage_to_mldev(
|
|
1629
2514
|
setv(
|
1630
2515
|
to_object,
|
1631
2516
|
['clientContent'],
|
1632
|
-
|
2517
|
+
_LiveMusicClientContent_to_mldev(
|
1633
2518
|
api_client, getv(from_object, ['client_content']), to_object
|
1634
2519
|
),
|
1635
2520
|
)
|
1636
2521
|
|
1637
|
-
if getv(from_object, ['
|
2522
|
+
if getv(from_object, ['music_generation_config']) is not None:
|
1638
2523
|
setv(
|
1639
2524
|
to_object,
|
1640
|
-
['
|
1641
|
-
|
1642
|
-
api_client,
|
2525
|
+
['musicGenerationConfig'],
|
2526
|
+
_LiveMusicGenerationConfig_to_mldev(
|
2527
|
+
api_client,
|
2528
|
+
getv(from_object, ['music_generation_config']),
|
2529
|
+
to_object,
|
1643
2530
|
),
|
1644
2531
|
)
|
1645
2532
|
|
1646
|
-
if getv(from_object, ['
|
2533
|
+
if getv(from_object, ['playback_control']) is not None:
|
1647
2534
|
setv(
|
1648
|
-
to_object,
|
1649
|
-
['toolResponse'],
|
1650
|
-
_LiveClientToolResponse_to_mldev(
|
1651
|
-
api_client, getv(from_object, ['tool_response']), to_object
|
1652
|
-
),
|
2535
|
+
to_object, ['playbackControl'], getv(from_object, ['playback_control'])
|
1653
2536
|
)
|
1654
2537
|
|
1655
2538
|
return to_object
|
1656
2539
|
|
1657
2540
|
|
1658
|
-
def
|
2541
|
+
def _LiveMusicClientMessage_to_vertex(
|
1659
2542
|
api_client: BaseApiClient,
|
1660
2543
|
from_object: Union[dict[str, Any], object],
|
1661
2544
|
parent_object: Optional[dict[str, Any]] = None,
|
1662
2545
|
) -> dict[str, Any]:
|
1663
2546
|
to_object: dict[str, Any] = {}
|
1664
2547
|
if getv(from_object, ['setup']) is not None:
|
1665
|
-
|
1666
|
-
to_object,
|
1667
|
-
['setup'],
|
1668
|
-
_LiveClientSetup_to_vertex(
|
1669
|
-
api_client, getv(from_object, ['setup']), to_object
|
1670
|
-
),
|
1671
|
-
)
|
2548
|
+
raise ValueError('setup parameter is not supported in Vertex AI.')
|
1672
2549
|
|
1673
2550
|
if getv(from_object, ['client_content']) is not None:
|
1674
|
-
|
1675
|
-
to_object,
|
1676
|
-
['clientContent'],
|
1677
|
-
_LiveClientContent_to_vertex(
|
1678
|
-
api_client, getv(from_object, ['client_content']), to_object
|
1679
|
-
),
|
1680
|
-
)
|
2551
|
+
raise ValueError('client_content parameter is not supported in Vertex AI.')
|
1681
2552
|
|
1682
|
-
if getv(from_object, ['
|
1683
|
-
|
1684
|
-
|
1685
|
-
['realtimeInput'],
|
1686
|
-
_LiveClientRealtimeInput_to_vertex(
|
1687
|
-
api_client, getv(from_object, ['realtime_input']), to_object
|
1688
|
-
),
|
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.'
|
1689
2556
|
)
|
1690
2557
|
|
1691
|
-
if getv(from_object, ['
|
1692
|
-
|
1693
|
-
|
1694
|
-
['toolResponse'],
|
1695
|
-
_LiveClientToolResponse_to_vertex(
|
1696
|
-
api_client, getv(from_object, ['tool_response']), to_object
|
1697
|
-
),
|
2558
|
+
if getv(from_object, ['playback_control']) is not None:
|
2559
|
+
raise ValueError(
|
2560
|
+
'playback_control parameter is not supported in Vertex AI.'
|
1698
2561
|
)
|
1699
2562
|
|
1700
2563
|
return to_object
|
@@ -1720,16 +2583,103 @@ def _LiveServerSetupComplete_from_vertex(
|
|
1720
2583
|
return to_object
|
1721
2584
|
|
1722
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
|
+
|
2622
|
+
def _Blob_from_mldev(
|
2623
|
+
api_client: BaseApiClient,
|
2624
|
+
from_object: Union[dict[str, Any], object],
|
2625
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2626
|
+
) -> dict[str, Any]:
|
2627
|
+
to_object: dict[str, Any] = {}
|
2628
|
+
|
2629
|
+
if getv(from_object, ['data']) is not None:
|
2630
|
+
setv(to_object, ['data'], getv(from_object, ['data']))
|
2631
|
+
|
2632
|
+
if getv(from_object, ['mimeType']) is not None:
|
2633
|
+
setv(to_object, ['mime_type'], getv(from_object, ['mimeType']))
|
2634
|
+
|
2635
|
+
return to_object
|
2636
|
+
|
2637
|
+
|
2638
|
+
def _Blob_from_vertex(
|
2639
|
+
api_client: BaseApiClient,
|
2640
|
+
from_object: Union[dict[str, Any], object],
|
2641
|
+
parent_object: Optional[dict[str, Any]] = None,
|
2642
|
+
) -> dict[str, Any]:
|
2643
|
+
to_object: dict[str, Any] = {}
|
2644
|
+
if getv(from_object, ['displayName']) is not None:
|
2645
|
+
setv(to_object, ['display_name'], getv(from_object, ['displayName']))
|
2646
|
+
|
2647
|
+
if getv(from_object, ['data']) is not None:
|
2648
|
+
setv(to_object, ['data'], getv(from_object, ['data']))
|
2649
|
+
|
2650
|
+
if getv(from_object, ['mimeType']) is not None:
|
2651
|
+
setv(to_object, ['mime_type'], getv(from_object, ['mimeType']))
|
2652
|
+
|
2653
|
+
return to_object
|
2654
|
+
|
2655
|
+
|
1723
2656
|
def _Part_from_mldev(
|
1724
2657
|
api_client: BaseApiClient,
|
1725
2658
|
from_object: Union[dict[str, Any], object],
|
1726
2659
|
parent_object: Optional[dict[str, Any]] = None,
|
1727
2660
|
) -> dict[str, Any]:
|
1728
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
|
+
)
|
1729
2670
|
|
1730
2671
|
if getv(from_object, ['thought']) is not None:
|
1731
2672
|
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
1732
2673
|
|
2674
|
+
if getv(from_object, ['inlineData']) is not None:
|
2675
|
+
setv(
|
2676
|
+
to_object,
|
2677
|
+
['inline_data'],
|
2678
|
+
_Blob_from_mldev(
|
2679
|
+
api_client, getv(from_object, ['inlineData']), to_object
|
2680
|
+
),
|
2681
|
+
)
|
2682
|
+
|
1733
2683
|
if getv(from_object, ['codeExecutionResult']) is not None:
|
1734
2684
|
setv(
|
1735
2685
|
to_object,
|
@@ -1753,9 +2703,6 @@ def _Part_from_mldev(
|
|
1753
2703
|
getv(from_object, ['functionResponse']),
|
1754
2704
|
)
|
1755
2705
|
|
1756
|
-
if getv(from_object, ['inlineData']) is not None:
|
1757
|
-
setv(to_object, ['inline_data'], getv(from_object, ['inlineData']))
|
1758
|
-
|
1759
2706
|
if getv(from_object, ['text']) is not None:
|
1760
2707
|
setv(to_object, ['text'], getv(from_object, ['text']))
|
1761
2708
|
|
@@ -1769,11 +2716,26 @@ def _Part_from_vertex(
|
|
1769
2716
|
) -> dict[str, Any]:
|
1770
2717
|
to_object: dict[str, Any] = {}
|
1771
2718
|
if getv(from_object, ['videoMetadata']) is not None:
|
1772
|
-
setv(
|
2719
|
+
setv(
|
2720
|
+
to_object,
|
2721
|
+
['video_metadata'],
|
2722
|
+
_VideoMetadata_from_vertex(
|
2723
|
+
api_client, getv(from_object, ['videoMetadata']), to_object
|
2724
|
+
),
|
2725
|
+
)
|
1773
2726
|
|
1774
2727
|
if getv(from_object, ['thought']) is not None:
|
1775
2728
|
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
1776
2729
|
|
2730
|
+
if getv(from_object, ['inlineData']) is not None:
|
2731
|
+
setv(
|
2732
|
+
to_object,
|
2733
|
+
['inline_data'],
|
2734
|
+
_Blob_from_vertex(
|
2735
|
+
api_client, getv(from_object, ['inlineData']), to_object
|
2736
|
+
),
|
2737
|
+
)
|
2738
|
+
|
1777
2739
|
if getv(from_object, ['codeExecutionResult']) is not None:
|
1778
2740
|
setv(
|
1779
2741
|
to_object,
|
@@ -1797,9 +2759,6 @@ def _Part_from_vertex(
|
|
1797
2759
|
getv(from_object, ['functionResponse']),
|
1798
2760
|
)
|
1799
2761
|
|
1800
|
-
if getv(from_object, ['inlineData']) is not None:
|
1801
|
-
setv(to_object, ['inline_data'], getv(from_object, ['inlineData']))
|
1802
|
-
|
1803
2762
|
if getv(from_object, ['text']) is not None:
|
1804
2763
|
setv(to_object, ['text'], getv(from_object, ['text']))
|
1805
2764
|
|
@@ -1871,11 +2830,87 @@ def _Transcription_from_vertex(
|
|
1871
2830
|
parent_object: Optional[dict[str, Any]] = None,
|
1872
2831
|
) -> dict[str, Any]:
|
1873
2832
|
to_object: dict[str, Any] = {}
|
1874
|
-
if getv(from_object, ['text']) is not None:
|
1875
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
1876
|
-
|
1877
|
-
if getv(from_object, ['finished']) is not None:
|
1878
|
-
setv(to_object, ['finished'], getv(from_object, ['finished']))
|
2833
|
+
if getv(from_object, ['text']) is not None:
|
2834
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
2835
|
+
|
2836
|
+
if getv(from_object, ['finished']) is not None:
|
2837
|
+
setv(to_object, ['finished'], getv(from_object, ['finished']))
|
2838
|
+
|
2839
|
+
return to_object
|
2840
|
+
|
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
|
+
)
|
1879
2914
|
|
1880
2915
|
return to_object
|
1881
2916
|
|
@@ -1933,6 +2968,15 @@ def _LiveServerContent_from_mldev(
|
|
1933
2968
|
),
|
1934
2969
|
)
|
1935
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
|
+
|
1936
2980
|
return to_object
|
1937
2981
|
|
1938
2982
|
|
@@ -2513,3 +3557,328 @@ def _LiveServerMessage_from_vertex(
|
|
2513
3557
|
)
|
2514
3558
|
|
2515
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
|