google-genai 1.33.0__py3-none-any.whl → 1.53.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/genai/_api_client.py +361 -208
- google/genai/_common.py +260 -69
- google/genai/_extra_utils.py +142 -12
- google/genai/_live_converters.py +691 -2746
- google/genai/_local_tokenizer_loader.py +0 -9
- google/genai/_operations_converters.py +186 -99
- google/genai/_replay_api_client.py +48 -51
- google/genai/_tokens_converters.py +169 -489
- google/genai/_transformers.py +193 -90
- google/genai/batches.py +1014 -1307
- google/genai/caches.py +458 -1107
- google/genai/client.py +101 -0
- google/genai/documents.py +532 -0
- google/genai/errors.py +58 -4
- google/genai/file_search_stores.py +1296 -0
- google/genai/files.py +108 -358
- google/genai/live.py +90 -32
- google/genai/live_music.py +24 -27
- google/genai/local_tokenizer.py +36 -3
- google/genai/models.py +2308 -3375
- google/genai/operations.py +129 -21
- google/genai/pagers.py +7 -1
- google/genai/tokens.py +2 -12
- google/genai/tunings.py +770 -436
- google/genai/types.py +4341 -1218
- google/genai/version.py +1 -1
- {google_genai-1.33.0.dist-info → google_genai-1.53.0.dist-info}/METADATA +359 -201
- google_genai-1.53.0.dist-info/RECORD +41 -0
- google_genai-1.33.0.dist-info/RECORD +0 -39
- {google_genai-1.33.0.dist-info → google_genai-1.53.0.dist-info}/WHEEL +0 -0
- {google_genai-1.33.0.dist-info → google_genai-1.53.0.dist-info}/licenses/LICENSE +0 -0
- {google_genai-1.33.0.dist-info → google_genai-1.53.0.dist-info}/top_level.txt +0 -0
google/genai/_live_converters.py
CHANGED
|
@@ -23,280 +23,250 @@ from ._common import get_value_by_path as getv
|
|
|
23
23
|
from ._common import set_value_by_path as setv
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
def
|
|
27
|
-
from_object: Union[dict[str, Any], object],
|
|
28
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
29
|
-
) -> dict[str, Any]:
|
|
30
|
-
to_object: dict[str, Any] = {}
|
|
31
|
-
if getv(from_object, ['voice_name']) is not None:
|
|
32
|
-
setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
|
|
33
|
-
|
|
34
|
-
return to_object
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
def _VoiceConfig_to_mldev(
|
|
26
|
+
def _Blob_to_mldev(
|
|
38
27
|
from_object: Union[dict[str, Any], object],
|
|
39
28
|
parent_object: Optional[dict[str, Any]] = None,
|
|
40
29
|
) -> dict[str, Any]:
|
|
41
30
|
to_object: dict[str, Any] = {}
|
|
42
|
-
if getv(from_object, ['
|
|
43
|
-
setv(
|
|
44
|
-
to_object,
|
|
45
|
-
['prebuiltVoiceConfig'],
|
|
46
|
-
_PrebuiltVoiceConfig_to_mldev(
|
|
47
|
-
getv(from_object, ['prebuilt_voice_config']), to_object
|
|
48
|
-
),
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
return to_object
|
|
52
|
-
|
|
31
|
+
if getv(from_object, ['data']) is not None:
|
|
32
|
+
setv(to_object, ['data'], getv(from_object, ['data']))
|
|
53
33
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
57
|
-
) -> dict[str, Any]:
|
|
58
|
-
to_object: dict[str, Any] = {}
|
|
59
|
-
if getv(from_object, ['speaker']) is not None:
|
|
60
|
-
setv(to_object, ['speaker'], getv(from_object, ['speaker']))
|
|
34
|
+
if getv(from_object, ['display_name']) is not None:
|
|
35
|
+
raise ValueError('display_name parameter is not supported in Gemini API.')
|
|
61
36
|
|
|
62
|
-
if getv(from_object, ['
|
|
63
|
-
setv(
|
|
64
|
-
to_object,
|
|
65
|
-
['voiceConfig'],
|
|
66
|
-
_VoiceConfig_to_mldev(getv(from_object, ['voice_config']), to_object),
|
|
67
|
-
)
|
|
37
|
+
if getv(from_object, ['mime_type']) is not None:
|
|
38
|
+
setv(to_object, ['mimeType'], getv(from_object, ['mime_type']))
|
|
68
39
|
|
|
69
40
|
return to_object
|
|
70
41
|
|
|
71
42
|
|
|
72
|
-
def
|
|
43
|
+
def _Content_to_mldev(
|
|
73
44
|
from_object: Union[dict[str, Any], object],
|
|
74
45
|
parent_object: Optional[dict[str, Any]] = None,
|
|
75
46
|
) -> dict[str, Any]:
|
|
76
47
|
to_object: dict[str, Any] = {}
|
|
77
|
-
if getv(from_object, ['
|
|
48
|
+
if getv(from_object, ['parts']) is not None:
|
|
78
49
|
setv(
|
|
79
50
|
to_object,
|
|
80
|
-
['
|
|
51
|
+
['parts'],
|
|
81
52
|
[
|
|
82
|
-
|
|
83
|
-
for item in getv(from_object, ['
|
|
53
|
+
_Part_to_mldev(item, to_object)
|
|
54
|
+
for item in getv(from_object, ['parts'])
|
|
84
55
|
],
|
|
85
56
|
)
|
|
86
57
|
|
|
58
|
+
if getv(from_object, ['role']) is not None:
|
|
59
|
+
setv(to_object, ['role'], getv(from_object, ['role']))
|
|
60
|
+
|
|
87
61
|
return to_object
|
|
88
62
|
|
|
89
63
|
|
|
90
|
-
def
|
|
64
|
+
def _FileData_to_mldev(
|
|
91
65
|
from_object: Union[dict[str, Any], object],
|
|
92
66
|
parent_object: Optional[dict[str, Any]] = None,
|
|
93
67
|
) -> dict[str, Any]:
|
|
94
68
|
to_object: dict[str, Any] = {}
|
|
95
|
-
if getv(from_object, ['
|
|
96
|
-
|
|
97
|
-
to_object,
|
|
98
|
-
['voiceConfig'],
|
|
99
|
-
_VoiceConfig_to_mldev(getv(from_object, ['voice_config']), to_object),
|
|
100
|
-
)
|
|
69
|
+
if getv(from_object, ['display_name']) is not None:
|
|
70
|
+
raise ValueError('display_name parameter is not supported in Gemini API.')
|
|
101
71
|
|
|
102
|
-
if getv(from_object, ['
|
|
103
|
-
setv(
|
|
104
|
-
to_object,
|
|
105
|
-
['multiSpeakerVoiceConfig'],
|
|
106
|
-
_MultiSpeakerVoiceConfig_to_mldev(
|
|
107
|
-
getv(from_object, ['multi_speaker_voice_config']), to_object
|
|
108
|
-
),
|
|
109
|
-
)
|
|
72
|
+
if getv(from_object, ['file_uri']) is not None:
|
|
73
|
+
setv(to_object, ['fileUri'], getv(from_object, ['file_uri']))
|
|
110
74
|
|
|
111
|
-
if getv(from_object, ['
|
|
112
|
-
setv(to_object, ['
|
|
75
|
+
if getv(from_object, ['mime_type']) is not None:
|
|
76
|
+
setv(to_object, ['mimeType'], getv(from_object, ['mime_type']))
|
|
113
77
|
|
|
114
78
|
return to_object
|
|
115
79
|
|
|
116
80
|
|
|
117
|
-
def
|
|
81
|
+
def _FunctionCall_to_mldev(
|
|
118
82
|
from_object: Union[dict[str, Any], object],
|
|
119
83
|
parent_object: Optional[dict[str, Any]] = None,
|
|
120
84
|
) -> dict[str, Any]:
|
|
121
85
|
to_object: dict[str, Any] = {}
|
|
122
|
-
if getv(from_object, ['
|
|
123
|
-
setv(to_object, ['
|
|
86
|
+
if getv(from_object, ['id']) is not None:
|
|
87
|
+
setv(to_object, ['id'], getv(from_object, ['id']))
|
|
88
|
+
|
|
89
|
+
if getv(from_object, ['args']) is not None:
|
|
90
|
+
setv(to_object, ['args'], getv(from_object, ['args']))
|
|
91
|
+
|
|
92
|
+
if getv(from_object, ['name']) is not None:
|
|
93
|
+
setv(to_object, ['name'], getv(from_object, ['name']))
|
|
124
94
|
|
|
125
|
-
if getv(from_object, ['
|
|
126
|
-
|
|
95
|
+
if getv(from_object, ['partial_args']) is not None:
|
|
96
|
+
raise ValueError('partial_args parameter is not supported in Gemini API.')
|
|
127
97
|
|
|
128
|
-
if getv(from_object, ['
|
|
129
|
-
|
|
98
|
+
if getv(from_object, ['will_continue']) is not None:
|
|
99
|
+
raise ValueError('will_continue parameter is not supported in Gemini API.')
|
|
130
100
|
|
|
131
101
|
return to_object
|
|
132
102
|
|
|
133
103
|
|
|
134
|
-
def
|
|
104
|
+
def _FunctionDeclaration_to_vertex(
|
|
135
105
|
from_object: Union[dict[str, Any], object],
|
|
136
106
|
parent_object: Optional[dict[str, Any]] = None,
|
|
137
107
|
) -> dict[str, Any]:
|
|
138
108
|
to_object: dict[str, Any] = {}
|
|
139
|
-
if getv(from_object, ['
|
|
140
|
-
raise ValueError('
|
|
141
|
-
|
|
142
|
-
if getv(from_object, ['data']) is not None:
|
|
143
|
-
setv(to_object, ['data'], getv(from_object, ['data']))
|
|
109
|
+
if getv(from_object, ['behavior']) is not None:
|
|
110
|
+
raise ValueError('behavior parameter is not supported in Vertex AI.')
|
|
144
111
|
|
|
145
|
-
if getv(from_object, ['
|
|
146
|
-
setv(to_object, ['
|
|
112
|
+
if getv(from_object, ['description']) is not None:
|
|
113
|
+
setv(to_object, ['description'], getv(from_object, ['description']))
|
|
147
114
|
|
|
148
|
-
|
|
115
|
+
if getv(from_object, ['name']) is not None:
|
|
116
|
+
setv(to_object, ['name'], getv(from_object, ['name']))
|
|
149
117
|
|
|
118
|
+
if getv(from_object, ['parameters']) is not None:
|
|
119
|
+
setv(to_object, ['parameters'], getv(from_object, ['parameters']))
|
|
150
120
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
raise ValueError('display_name parameter is not supported in Gemini API.')
|
|
121
|
+
if getv(from_object, ['parameters_json_schema']) is not None:
|
|
122
|
+
setv(
|
|
123
|
+
to_object,
|
|
124
|
+
['parametersJsonSchema'],
|
|
125
|
+
getv(from_object, ['parameters_json_schema']),
|
|
126
|
+
)
|
|
158
127
|
|
|
159
|
-
if getv(from_object, ['
|
|
160
|
-
setv(to_object, ['
|
|
128
|
+
if getv(from_object, ['response']) is not None:
|
|
129
|
+
setv(to_object, ['response'], getv(from_object, ['response']))
|
|
161
130
|
|
|
162
|
-
if getv(from_object, ['
|
|
163
|
-
setv(
|
|
131
|
+
if getv(from_object, ['response_json_schema']) is not None:
|
|
132
|
+
setv(
|
|
133
|
+
to_object,
|
|
134
|
+
['responseJsonSchema'],
|
|
135
|
+
getv(from_object, ['response_json_schema']),
|
|
136
|
+
)
|
|
164
137
|
|
|
165
138
|
return to_object
|
|
166
139
|
|
|
167
140
|
|
|
168
|
-
def
|
|
141
|
+
def _GenerationConfig_to_vertex(
|
|
169
142
|
from_object: Union[dict[str, Any], object],
|
|
170
143
|
parent_object: Optional[dict[str, Any]] = None,
|
|
171
144
|
) -> dict[str, Any]:
|
|
172
145
|
to_object: dict[str, Any] = {}
|
|
173
|
-
if getv(from_object, ['
|
|
146
|
+
if getv(from_object, ['model_selection_config']) is not None:
|
|
174
147
|
setv(
|
|
175
148
|
to_object,
|
|
176
|
-
['
|
|
177
|
-
|
|
178
|
-
getv(from_object, ['video_metadata']), to_object
|
|
179
|
-
),
|
|
149
|
+
['modelConfig'],
|
|
150
|
+
getv(from_object, ['model_selection_config']),
|
|
180
151
|
)
|
|
181
152
|
|
|
182
|
-
if getv(from_object, ['
|
|
183
|
-
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
|
184
|
-
|
|
185
|
-
if getv(from_object, ['inline_data']) is not None:
|
|
153
|
+
if getv(from_object, ['response_json_schema']) is not None:
|
|
186
154
|
setv(
|
|
187
155
|
to_object,
|
|
188
|
-
['
|
|
189
|
-
|
|
156
|
+
['responseJsonSchema'],
|
|
157
|
+
getv(from_object, ['response_json_schema']),
|
|
190
158
|
)
|
|
191
159
|
|
|
192
|
-
if getv(from_object, ['
|
|
160
|
+
if getv(from_object, ['audio_timestamp']) is not None:
|
|
161
|
+
setv(to_object, ['audioTimestamp'], getv(from_object, ['audio_timestamp']))
|
|
162
|
+
|
|
163
|
+
if getv(from_object, ['candidate_count']) is not None:
|
|
164
|
+
setv(to_object, ['candidateCount'], getv(from_object, ['candidate_count']))
|
|
165
|
+
|
|
166
|
+
if getv(from_object, ['enable_affective_dialog']) is not None:
|
|
193
167
|
setv(
|
|
194
168
|
to_object,
|
|
195
|
-
['
|
|
196
|
-
|
|
169
|
+
['enableAffectiveDialog'],
|
|
170
|
+
getv(from_object, ['enable_affective_dialog']),
|
|
197
171
|
)
|
|
198
172
|
|
|
199
|
-
if getv(from_object, ['
|
|
173
|
+
if getv(from_object, ['frequency_penalty']) is not None:
|
|
200
174
|
setv(
|
|
201
175
|
to_object,
|
|
202
|
-
['
|
|
203
|
-
getv(from_object, ['
|
|
176
|
+
['frequencyPenalty'],
|
|
177
|
+
getv(from_object, ['frequency_penalty']),
|
|
204
178
|
)
|
|
205
179
|
|
|
206
|
-
if getv(from_object, ['
|
|
180
|
+
if getv(from_object, ['logprobs']) is not None:
|
|
181
|
+
setv(to_object, ['logprobs'], getv(from_object, ['logprobs']))
|
|
182
|
+
|
|
183
|
+
if getv(from_object, ['max_output_tokens']) is not None:
|
|
207
184
|
setv(
|
|
208
|
-
to_object,
|
|
209
|
-
['codeExecutionResult'],
|
|
210
|
-
getv(from_object, ['code_execution_result']),
|
|
185
|
+
to_object, ['maxOutputTokens'], getv(from_object, ['max_output_tokens'])
|
|
211
186
|
)
|
|
212
187
|
|
|
213
|
-
if getv(from_object, ['
|
|
214
|
-
setv(
|
|
188
|
+
if getv(from_object, ['media_resolution']) is not None:
|
|
189
|
+
setv(
|
|
190
|
+
to_object, ['mediaResolution'], getv(from_object, ['media_resolution'])
|
|
191
|
+
)
|
|
215
192
|
|
|
216
|
-
if getv(from_object, ['
|
|
217
|
-
setv(
|
|
193
|
+
if getv(from_object, ['presence_penalty']) is not None:
|
|
194
|
+
setv(
|
|
195
|
+
to_object, ['presencePenalty'], getv(from_object, ['presence_penalty'])
|
|
196
|
+
)
|
|
218
197
|
|
|
219
|
-
if getv(from_object, ['
|
|
198
|
+
if getv(from_object, ['response_logprobs']) is not None:
|
|
220
199
|
setv(
|
|
221
200
|
to_object,
|
|
222
|
-
['
|
|
223
|
-
getv(from_object, ['
|
|
201
|
+
['responseLogprobs'],
|
|
202
|
+
getv(from_object, ['response_logprobs']),
|
|
224
203
|
)
|
|
225
204
|
|
|
226
|
-
if getv(from_object, ['
|
|
227
|
-
setv(
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
205
|
+
if getv(from_object, ['response_mime_type']) is not None:
|
|
206
|
+
setv(
|
|
207
|
+
to_object,
|
|
208
|
+
['responseMimeType'],
|
|
209
|
+
getv(from_object, ['response_mime_type']),
|
|
210
|
+
)
|
|
231
211
|
|
|
232
|
-
|
|
233
|
-
from_object: Union[dict[str, Any], object],
|
|
234
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
235
|
-
) -> dict[str, Any]:
|
|
236
|
-
to_object: dict[str, Any] = {}
|
|
237
|
-
if getv(from_object, ['parts']) is not None:
|
|
212
|
+
if getv(from_object, ['response_modalities']) is not None:
|
|
238
213
|
setv(
|
|
239
214
|
to_object,
|
|
240
|
-
['
|
|
241
|
-
[
|
|
242
|
-
_Part_to_mldev(item, to_object)
|
|
243
|
-
for item in getv(from_object, ['parts'])
|
|
244
|
-
],
|
|
215
|
+
['responseModalities'],
|
|
216
|
+
getv(from_object, ['response_modalities']),
|
|
245
217
|
)
|
|
246
218
|
|
|
247
|
-
if getv(from_object, ['
|
|
248
|
-
setv(to_object, ['
|
|
219
|
+
if getv(from_object, ['response_schema']) is not None:
|
|
220
|
+
setv(to_object, ['responseSchema'], getv(from_object, ['response_schema']))
|
|
249
221
|
|
|
250
|
-
|
|
222
|
+
if getv(from_object, ['routing_config']) is not None:
|
|
223
|
+
setv(to_object, ['routingConfig'], getv(from_object, ['routing_config']))
|
|
251
224
|
|
|
225
|
+
if getv(from_object, ['seed']) is not None:
|
|
226
|
+
setv(to_object, ['seed'], getv(from_object, ['seed']))
|
|
252
227
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
228
|
+
if getv(from_object, ['speech_config']) is not None:
|
|
229
|
+
setv(
|
|
230
|
+
to_object,
|
|
231
|
+
['speechConfig'],
|
|
232
|
+
_SpeechConfig_to_vertex(
|
|
233
|
+
getv(from_object, ['speech_config']), to_object
|
|
234
|
+
),
|
|
235
|
+
)
|
|
260
236
|
|
|
261
|
-
if getv(from_object, ['
|
|
262
|
-
setv(to_object, ['
|
|
237
|
+
if getv(from_object, ['stop_sequences']) is not None:
|
|
238
|
+
setv(to_object, ['stopSequences'], getv(from_object, ['stop_sequences']))
|
|
263
239
|
|
|
264
|
-
if getv(from_object, ['
|
|
265
|
-
setv(to_object, ['
|
|
240
|
+
if getv(from_object, ['temperature']) is not None:
|
|
241
|
+
setv(to_object, ['temperature'], getv(from_object, ['temperature']))
|
|
266
242
|
|
|
267
|
-
if getv(from_object, ['
|
|
268
|
-
setv(to_object, ['
|
|
243
|
+
if getv(from_object, ['thinking_config']) is not None:
|
|
244
|
+
setv(to_object, ['thinkingConfig'], getv(from_object, ['thinking_config']))
|
|
269
245
|
|
|
270
|
-
if getv(from_object, ['
|
|
271
|
-
setv(
|
|
272
|
-
to_object,
|
|
273
|
-
['parametersJsonSchema'],
|
|
274
|
-
getv(from_object, ['parameters_json_schema']),
|
|
275
|
-
)
|
|
246
|
+
if getv(from_object, ['top_k']) is not None:
|
|
247
|
+
setv(to_object, ['topK'], getv(from_object, ['top_k']))
|
|
276
248
|
|
|
277
|
-
if getv(from_object, ['
|
|
278
|
-
setv(to_object, ['
|
|
249
|
+
if getv(from_object, ['top_p']) is not None:
|
|
250
|
+
setv(to_object, ['topP'], getv(from_object, ['top_p']))
|
|
279
251
|
|
|
280
|
-
if getv(from_object, ['
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
['responseJsonSchema'],
|
|
284
|
-
getv(from_object, ['response_json_schema']),
|
|
252
|
+
if getv(from_object, ['enable_enhanced_civic_answers']) is not None:
|
|
253
|
+
raise ValueError(
|
|
254
|
+
'enable_enhanced_civic_answers parameter is not supported in Vertex AI.'
|
|
285
255
|
)
|
|
286
256
|
|
|
287
257
|
return to_object
|
|
288
258
|
|
|
289
259
|
|
|
290
|
-
def
|
|
260
|
+
def _GoogleMaps_to_mldev(
|
|
291
261
|
from_object: Union[dict[str, Any], object],
|
|
292
262
|
parent_object: Optional[dict[str, Any]] = None,
|
|
293
263
|
) -> dict[str, Any]:
|
|
294
264
|
to_object: dict[str, Any] = {}
|
|
295
|
-
if getv(from_object, ['
|
|
296
|
-
|
|
265
|
+
if getv(from_object, ['auth_config']) is not None:
|
|
266
|
+
raise ValueError('auth_config parameter is not supported in Gemini API.')
|
|
297
267
|
|
|
298
|
-
if getv(from_object, ['
|
|
299
|
-
setv(to_object, ['
|
|
268
|
+
if getv(from_object, ['enable_widget']) is not None:
|
|
269
|
+
setv(to_object, ['enableWidget'], getv(from_object, ['enable_widget']))
|
|
300
270
|
|
|
301
271
|
return to_object
|
|
302
272
|
|
|
@@ -306,265 +276,332 @@ def _GoogleSearch_to_mldev(
|
|
|
306
276
|
parent_object: Optional[dict[str, Any]] = None,
|
|
307
277
|
) -> dict[str, Any]:
|
|
308
278
|
to_object: dict[str, Any] = {}
|
|
309
|
-
if getv(from_object, ['time_range_filter']) is not None:
|
|
310
|
-
setv(
|
|
311
|
-
to_object,
|
|
312
|
-
['timeRangeFilter'],
|
|
313
|
-
_Interval_to_mldev(getv(from_object, ['time_range_filter']), to_object),
|
|
314
|
-
)
|
|
315
|
-
|
|
316
279
|
if getv(from_object, ['exclude_domains']) is not None:
|
|
317
280
|
raise ValueError(
|
|
318
281
|
'exclude_domains parameter is not supported in Gemini API.'
|
|
319
282
|
)
|
|
320
283
|
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
from_object: Union[dict[str, Any], object],
|
|
326
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
327
|
-
) -> dict[str, Any]:
|
|
328
|
-
to_object: dict[str, Any] = {}
|
|
329
|
-
if getv(from_object, ['mode']) is not None:
|
|
330
|
-
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
|
284
|
+
if getv(from_object, ['blocking_confidence']) is not None:
|
|
285
|
+
raise ValueError(
|
|
286
|
+
'blocking_confidence parameter is not supported in Gemini API.'
|
|
287
|
+
)
|
|
331
288
|
|
|
332
|
-
if getv(from_object, ['
|
|
289
|
+
if getv(from_object, ['time_range_filter']) is not None:
|
|
333
290
|
setv(
|
|
334
|
-
to_object,
|
|
335
|
-
['dynamicThreshold'],
|
|
336
|
-
getv(from_object, ['dynamic_threshold']),
|
|
291
|
+
to_object, ['timeRangeFilter'], getv(from_object, ['time_range_filter'])
|
|
337
292
|
)
|
|
338
293
|
|
|
339
294
|
return to_object
|
|
340
295
|
|
|
341
296
|
|
|
342
|
-
def
|
|
297
|
+
def _LiveClientContent_to_mldev(
|
|
343
298
|
from_object: Union[dict[str, Any], object],
|
|
344
299
|
parent_object: Optional[dict[str, Any]] = None,
|
|
345
300
|
) -> dict[str, Any]:
|
|
346
301
|
to_object: dict[str, Any] = {}
|
|
347
|
-
if getv(from_object, ['
|
|
302
|
+
if getv(from_object, ['turns']) is not None:
|
|
348
303
|
setv(
|
|
349
304
|
to_object,
|
|
350
|
-
['
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
305
|
+
['turns'],
|
|
306
|
+
[
|
|
307
|
+
_Content_to_mldev(item, to_object)
|
|
308
|
+
for item in getv(from_object, ['turns'])
|
|
309
|
+
],
|
|
354
310
|
)
|
|
355
311
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
def _UrlContext_to_mldev(
|
|
360
|
-
from_object: Union[dict[str, Any], object],
|
|
361
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
362
|
-
) -> dict[str, Any]:
|
|
363
|
-
to_object: dict[str, Any] = {}
|
|
364
|
-
|
|
365
|
-
return to_object
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
def _ToolComputerUse_to_mldev(
|
|
369
|
-
from_object: Union[dict[str, Any], object],
|
|
370
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
371
|
-
) -> dict[str, Any]:
|
|
372
|
-
to_object: dict[str, Any] = {}
|
|
373
|
-
if getv(from_object, ['environment']) is not None:
|
|
374
|
-
setv(to_object, ['environment'], getv(from_object, ['environment']))
|
|
312
|
+
if getv(from_object, ['turn_complete']) is not None:
|
|
313
|
+
setv(to_object, ['turnComplete'], getv(from_object, ['turn_complete']))
|
|
375
314
|
|
|
376
315
|
return to_object
|
|
377
316
|
|
|
378
317
|
|
|
379
|
-
def
|
|
318
|
+
def _LiveClientMessage_to_mldev(
|
|
319
|
+
api_client: BaseApiClient,
|
|
380
320
|
from_object: Union[dict[str, Any], object],
|
|
381
321
|
parent_object: Optional[dict[str, Any]] = None,
|
|
382
322
|
) -> dict[str, Any]:
|
|
383
323
|
to_object: dict[str, Any] = {}
|
|
384
|
-
if getv(from_object, ['
|
|
324
|
+
if getv(from_object, ['setup']) is not None:
|
|
385
325
|
setv(
|
|
386
326
|
to_object,
|
|
387
|
-
['
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
],
|
|
327
|
+
['setup'],
|
|
328
|
+
_LiveClientSetup_to_mldev(
|
|
329
|
+
api_client, getv(from_object, ['setup']), to_object
|
|
330
|
+
),
|
|
392
331
|
)
|
|
393
332
|
|
|
394
|
-
if getv(from_object, ['
|
|
395
|
-
raise ValueError('retrieval parameter is not supported in Gemini API.')
|
|
396
|
-
|
|
397
|
-
if getv(from_object, ['google_search']) is not None:
|
|
333
|
+
if getv(from_object, ['client_content']) is not None:
|
|
398
334
|
setv(
|
|
399
335
|
to_object,
|
|
400
|
-
['
|
|
401
|
-
|
|
336
|
+
['clientContent'],
|
|
337
|
+
_LiveClientContent_to_mldev(
|
|
338
|
+
getv(from_object, ['client_content']), to_object
|
|
339
|
+
),
|
|
402
340
|
)
|
|
403
341
|
|
|
404
|
-
if getv(from_object, ['
|
|
342
|
+
if getv(from_object, ['realtime_input']) is not None:
|
|
405
343
|
setv(
|
|
406
344
|
to_object,
|
|
407
|
-
['
|
|
408
|
-
|
|
409
|
-
getv(from_object, ['
|
|
345
|
+
['realtimeInput'],
|
|
346
|
+
_LiveClientRealtimeInput_to_mldev(
|
|
347
|
+
getv(from_object, ['realtime_input']), to_object
|
|
410
348
|
),
|
|
411
349
|
)
|
|
412
350
|
|
|
413
|
-
if getv(from_object, ['
|
|
414
|
-
|
|
415
|
-
'enterprise_web_search parameter is not supported in Gemini API.'
|
|
416
|
-
)
|
|
351
|
+
if getv(from_object, ['tool_response']) is not None:
|
|
352
|
+
setv(to_object, ['toolResponse'], getv(from_object, ['tool_response']))
|
|
417
353
|
|
|
418
|
-
|
|
419
|
-
raise ValueError('google_maps parameter is not supported in Gemini API.')
|
|
354
|
+
return to_object
|
|
420
355
|
|
|
421
|
-
|
|
356
|
+
|
|
357
|
+
def _LiveClientMessage_to_vertex(
|
|
358
|
+
api_client: BaseApiClient,
|
|
359
|
+
from_object: Union[dict[str, Any], object],
|
|
360
|
+
parent_object: Optional[dict[str, Any]] = None,
|
|
361
|
+
) -> dict[str, Any]:
|
|
362
|
+
to_object: dict[str, Any] = {}
|
|
363
|
+
if getv(from_object, ['setup']) is not None:
|
|
422
364
|
setv(
|
|
423
365
|
to_object,
|
|
424
|
-
['
|
|
425
|
-
|
|
366
|
+
['setup'],
|
|
367
|
+
_LiveClientSetup_to_vertex(
|
|
368
|
+
api_client, getv(from_object, ['setup']), to_object
|
|
369
|
+
),
|
|
426
370
|
)
|
|
427
371
|
|
|
428
|
-
if getv(from_object, ['
|
|
372
|
+
if getv(from_object, ['client_content']) is not None:
|
|
373
|
+
setv(to_object, ['clientContent'], getv(from_object, ['client_content']))
|
|
374
|
+
|
|
375
|
+
if getv(from_object, ['realtime_input']) is not None:
|
|
429
376
|
setv(
|
|
430
377
|
to_object,
|
|
431
|
-
['
|
|
432
|
-
|
|
433
|
-
getv(from_object, ['
|
|
378
|
+
['realtimeInput'],
|
|
379
|
+
_LiveClientRealtimeInput_to_vertex(
|
|
380
|
+
getv(from_object, ['realtime_input']), to_object
|
|
434
381
|
),
|
|
435
382
|
)
|
|
436
383
|
|
|
437
|
-
if getv(from_object, ['
|
|
438
|
-
setv(to_object, ['
|
|
384
|
+
if getv(from_object, ['tool_response']) is not None:
|
|
385
|
+
setv(to_object, ['toolResponse'], getv(from_object, ['tool_response']))
|
|
439
386
|
|
|
440
387
|
return to_object
|
|
441
388
|
|
|
442
389
|
|
|
443
|
-
def
|
|
390
|
+
def _LiveClientRealtimeInput_to_mldev(
|
|
444
391
|
from_object: Union[dict[str, Any], object],
|
|
445
392
|
parent_object: Optional[dict[str, Any]] = None,
|
|
446
393
|
) -> dict[str, Any]:
|
|
447
394
|
to_object: dict[str, Any] = {}
|
|
448
|
-
if getv(from_object, ['
|
|
449
|
-
setv(
|
|
395
|
+
if getv(from_object, ['media_chunks']) is not None:
|
|
396
|
+
setv(
|
|
397
|
+
to_object,
|
|
398
|
+
['mediaChunks'],
|
|
399
|
+
[
|
|
400
|
+
_Blob_to_mldev(item, to_object)
|
|
401
|
+
for item in getv(from_object, ['media_chunks'])
|
|
402
|
+
],
|
|
403
|
+
)
|
|
450
404
|
|
|
451
|
-
if getv(from_object, ['
|
|
452
|
-
|
|
405
|
+
if getv(from_object, ['audio']) is not None:
|
|
406
|
+
setv(
|
|
407
|
+
to_object,
|
|
408
|
+
['audio'],
|
|
409
|
+
_Blob_to_mldev(getv(from_object, ['audio']), to_object),
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
if getv(from_object, ['audio_stream_end']) is not None:
|
|
413
|
+
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
|
414
|
+
|
|
415
|
+
if getv(from_object, ['video']) is not None:
|
|
416
|
+
setv(
|
|
417
|
+
to_object,
|
|
418
|
+
['video'],
|
|
419
|
+
_Blob_to_mldev(getv(from_object, ['video']), to_object),
|
|
420
|
+
)
|
|
421
|
+
|
|
422
|
+
if getv(from_object, ['text']) is not None:
|
|
423
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
424
|
+
|
|
425
|
+
if getv(from_object, ['activity_start']) is not None:
|
|
426
|
+
setv(to_object, ['activityStart'], getv(from_object, ['activity_start']))
|
|
427
|
+
|
|
428
|
+
if getv(from_object, ['activity_end']) is not None:
|
|
429
|
+
setv(to_object, ['activityEnd'], getv(from_object, ['activity_end']))
|
|
453
430
|
|
|
454
431
|
return to_object
|
|
455
432
|
|
|
456
433
|
|
|
457
|
-
def
|
|
434
|
+
def _LiveClientRealtimeInput_to_vertex(
|
|
458
435
|
from_object: Union[dict[str, Any], object],
|
|
459
436
|
parent_object: Optional[dict[str, Any]] = None,
|
|
460
437
|
) -> dict[str, Any]:
|
|
461
438
|
to_object: dict[str, Any] = {}
|
|
439
|
+
if getv(from_object, ['media_chunks']) is not None:
|
|
440
|
+
setv(
|
|
441
|
+
to_object,
|
|
442
|
+
['mediaChunks'],
|
|
443
|
+
[item for item in getv(from_object, ['media_chunks'])],
|
|
444
|
+
)
|
|
445
|
+
|
|
446
|
+
if getv(from_object, ['audio']) is not None:
|
|
447
|
+
setv(to_object, ['audio'], getv(from_object, ['audio']))
|
|
448
|
+
|
|
449
|
+
if getv(from_object, ['audio_stream_end']) is not None:
|
|
450
|
+
raise ValueError(
|
|
451
|
+
'audio_stream_end parameter is not supported in Vertex AI.'
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
if getv(from_object, ['video']) is not None:
|
|
455
|
+
setv(to_object, ['video'], getv(from_object, ['video']))
|
|
456
|
+
|
|
457
|
+
if getv(from_object, ['text']) is not None:
|
|
458
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
459
|
+
|
|
460
|
+
if getv(from_object, ['activity_start']) is not None:
|
|
461
|
+
setv(to_object, ['activityStart'], getv(from_object, ['activity_start']))
|
|
462
|
+
|
|
463
|
+
if getv(from_object, ['activity_end']) is not None:
|
|
464
|
+
setv(to_object, ['activityEnd'], getv(from_object, ['activity_end']))
|
|
462
465
|
|
|
463
466
|
return to_object
|
|
464
467
|
|
|
465
468
|
|
|
466
|
-
def
|
|
469
|
+
def _LiveClientSetup_to_mldev(
|
|
470
|
+
api_client: BaseApiClient,
|
|
467
471
|
from_object: Union[dict[str, Any], object],
|
|
468
472
|
parent_object: Optional[dict[str, Any]] = None,
|
|
469
473
|
) -> dict[str, Any]:
|
|
470
474
|
to_object: dict[str, Any] = {}
|
|
471
|
-
if getv(from_object, ['
|
|
472
|
-
setv(to_object, ['
|
|
475
|
+
if getv(from_object, ['model']) is not None:
|
|
476
|
+
setv(to_object, ['model'], getv(from_object, ['model']))
|
|
473
477
|
|
|
474
|
-
if getv(from_object, ['
|
|
478
|
+
if getv(from_object, ['generation_config']) is not None:
|
|
475
479
|
setv(
|
|
476
480
|
to_object,
|
|
477
|
-
['
|
|
478
|
-
getv(from_object, ['
|
|
481
|
+
['generationConfig'],
|
|
482
|
+
getv(from_object, ['generation_config']),
|
|
479
483
|
)
|
|
480
484
|
|
|
481
|
-
if getv(from_object, ['
|
|
485
|
+
if getv(from_object, ['system_instruction']) is not None:
|
|
482
486
|
setv(
|
|
483
487
|
to_object,
|
|
484
|
-
['
|
|
485
|
-
|
|
488
|
+
['systemInstruction'],
|
|
489
|
+
_Content_to_mldev(
|
|
490
|
+
t.t_content(getv(from_object, ['system_instruction'])), to_object
|
|
491
|
+
),
|
|
486
492
|
)
|
|
487
493
|
|
|
488
|
-
if getv(from_object, ['
|
|
494
|
+
if getv(from_object, ['tools']) is not None:
|
|
489
495
|
setv(
|
|
490
|
-
to_object,
|
|
496
|
+
to_object,
|
|
497
|
+
['tools'],
|
|
498
|
+
[
|
|
499
|
+
_Tool_to_mldev(t.t_tool(api_client, item), to_object)
|
|
500
|
+
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
|
501
|
+
],
|
|
491
502
|
)
|
|
492
503
|
|
|
493
|
-
if getv(from_object, ['
|
|
504
|
+
if getv(from_object, ['session_resumption']) is not None:
|
|
494
505
|
setv(
|
|
495
506
|
to_object,
|
|
496
|
-
['
|
|
497
|
-
|
|
507
|
+
['sessionResumption'],
|
|
508
|
+
_SessionResumptionConfig_to_mldev(
|
|
509
|
+
getv(from_object, ['session_resumption']), to_object
|
|
510
|
+
),
|
|
498
511
|
)
|
|
499
512
|
|
|
500
|
-
|
|
501
|
-
|
|
513
|
+
if getv(from_object, ['context_window_compression']) is not None:
|
|
514
|
+
setv(
|
|
515
|
+
to_object,
|
|
516
|
+
['contextWindowCompression'],
|
|
517
|
+
getv(from_object, ['context_window_compression']),
|
|
518
|
+
)
|
|
502
519
|
|
|
503
|
-
|
|
504
|
-
from_object: Union[dict[str, Any], object],
|
|
505
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
506
|
-
) -> dict[str, Any]:
|
|
507
|
-
to_object: dict[str, Any] = {}
|
|
508
|
-
if getv(from_object, ['automatic_activity_detection']) is not None:
|
|
520
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
|
509
521
|
setv(
|
|
510
522
|
to_object,
|
|
511
|
-
['
|
|
512
|
-
|
|
513
|
-
getv(from_object, ['automatic_activity_detection']), to_object
|
|
514
|
-
),
|
|
523
|
+
['inputAudioTranscription'],
|
|
524
|
+
getv(from_object, ['input_audio_transcription']),
|
|
515
525
|
)
|
|
516
526
|
|
|
517
|
-
if getv(from_object, ['
|
|
527
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
|
518
528
|
setv(
|
|
519
529
|
to_object,
|
|
520
|
-
['
|
|
521
|
-
getv(from_object, ['
|
|
530
|
+
['outputAudioTranscription'],
|
|
531
|
+
getv(from_object, ['output_audio_transcription']),
|
|
522
532
|
)
|
|
523
533
|
|
|
524
|
-
if getv(from_object, ['
|
|
525
|
-
setv(to_object, ['
|
|
534
|
+
if getv(from_object, ['proactivity']) is not None:
|
|
535
|
+
setv(to_object, ['proactivity'], getv(from_object, ['proactivity']))
|
|
526
536
|
|
|
527
537
|
return to_object
|
|
528
538
|
|
|
529
539
|
|
|
530
|
-
def
|
|
540
|
+
def _LiveClientSetup_to_vertex(
|
|
541
|
+
api_client: BaseApiClient,
|
|
531
542
|
from_object: Union[dict[str, Any], object],
|
|
532
543
|
parent_object: Optional[dict[str, Any]] = None,
|
|
533
544
|
) -> dict[str, Any]:
|
|
534
545
|
to_object: dict[str, Any] = {}
|
|
535
|
-
if getv(from_object, ['
|
|
536
|
-
setv(to_object, ['
|
|
546
|
+
if getv(from_object, ['model']) is not None:
|
|
547
|
+
setv(to_object, ['model'], getv(from_object, ['model']))
|
|
537
548
|
|
|
538
|
-
|
|
549
|
+
if getv(from_object, ['generation_config']) is not None:
|
|
550
|
+
setv(
|
|
551
|
+
to_object,
|
|
552
|
+
['generationConfig'],
|
|
553
|
+
_GenerationConfig_to_vertex(
|
|
554
|
+
getv(from_object, ['generation_config']), to_object
|
|
555
|
+
),
|
|
556
|
+
)
|
|
539
557
|
|
|
558
|
+
if getv(from_object, ['system_instruction']) is not None:
|
|
559
|
+
setv(
|
|
560
|
+
to_object,
|
|
561
|
+
['systemInstruction'],
|
|
562
|
+
t.t_content(getv(from_object, ['system_instruction'])),
|
|
563
|
+
)
|
|
540
564
|
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
565
|
+
if getv(from_object, ['tools']) is not None:
|
|
566
|
+
setv(
|
|
567
|
+
to_object,
|
|
568
|
+
['tools'],
|
|
569
|
+
[
|
|
570
|
+
_Tool_to_vertex(t.t_tool(api_client, item), to_object)
|
|
571
|
+
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
|
572
|
+
],
|
|
573
|
+
)
|
|
548
574
|
|
|
549
|
-
if getv(from_object, ['
|
|
575
|
+
if getv(from_object, ['session_resumption']) is not None:
|
|
550
576
|
setv(
|
|
551
577
|
to_object,
|
|
552
|
-
['
|
|
553
|
-
|
|
554
|
-
getv(from_object, ['sliding_window']), to_object
|
|
555
|
-
),
|
|
578
|
+
['sessionResumption'],
|
|
579
|
+
getv(from_object, ['session_resumption']),
|
|
556
580
|
)
|
|
557
581
|
|
|
558
|
-
|
|
582
|
+
if getv(from_object, ['context_window_compression']) is not None:
|
|
583
|
+
setv(
|
|
584
|
+
to_object,
|
|
585
|
+
['contextWindowCompression'],
|
|
586
|
+
getv(from_object, ['context_window_compression']),
|
|
587
|
+
)
|
|
588
|
+
|
|
589
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
|
590
|
+
setv(
|
|
591
|
+
to_object,
|
|
592
|
+
['inputAudioTranscription'],
|
|
593
|
+
getv(from_object, ['input_audio_transcription']),
|
|
594
|
+
)
|
|
559
595
|
|
|
596
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
|
597
|
+
setv(
|
|
598
|
+
to_object,
|
|
599
|
+
['outputAudioTranscription'],
|
|
600
|
+
getv(from_object, ['output_audio_transcription']),
|
|
601
|
+
)
|
|
560
602
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
564
|
-
) -> dict[str, Any]:
|
|
565
|
-
to_object: dict[str, Any] = {}
|
|
566
|
-
if getv(from_object, ['proactive_audio']) is not None:
|
|
567
|
-
setv(to_object, ['proactiveAudio'], getv(from_object, ['proactive_audio']))
|
|
603
|
+
if getv(from_object, ['proactivity']) is not None:
|
|
604
|
+
setv(to_object, ['proactivity'], getv(from_object, ['proactivity']))
|
|
568
605
|
|
|
569
606
|
return to_object
|
|
570
607
|
|
|
@@ -636,10 +673,14 @@ def _LiveConnectConfig_to_mldev(
|
|
|
636
673
|
setv(
|
|
637
674
|
parent_object,
|
|
638
675
|
['setup', 'generationConfig', 'speechConfig'],
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
676
|
+
t.t_live_speech_config(getv(from_object, ['speech_config'])),
|
|
677
|
+
)
|
|
678
|
+
|
|
679
|
+
if getv(from_object, ['thinking_config']) is not None:
|
|
680
|
+
setv(
|
|
681
|
+
parent_object,
|
|
682
|
+
['setup', 'generationConfig', 'thinkingConfig'],
|
|
683
|
+
getv(from_object, ['thinking_config']),
|
|
643
684
|
)
|
|
644
685
|
|
|
645
686
|
if getv(from_object, ['enable_affective_dialog']) is not None:
|
|
@@ -681,2642 +722,668 @@ def _LiveConnectConfig_to_mldev(
|
|
|
681
722
|
setv(
|
|
682
723
|
parent_object,
|
|
683
724
|
['setup', 'inputAudioTranscription'],
|
|
684
|
-
|
|
685
|
-
getv(from_object, ['input_audio_transcription']), to_object
|
|
686
|
-
),
|
|
725
|
+
getv(from_object, ['input_audio_transcription']),
|
|
687
726
|
)
|
|
688
727
|
|
|
689
728
|
if getv(from_object, ['output_audio_transcription']) is not None:
|
|
690
729
|
setv(
|
|
691
730
|
parent_object,
|
|
692
731
|
['setup', 'outputAudioTranscription'],
|
|
693
|
-
|
|
694
|
-
getv(from_object, ['output_audio_transcription']), to_object
|
|
695
|
-
),
|
|
732
|
+
getv(from_object, ['output_audio_transcription']),
|
|
696
733
|
)
|
|
697
734
|
|
|
698
735
|
if getv(from_object, ['realtime_input_config']) is not None:
|
|
699
736
|
setv(
|
|
700
737
|
parent_object,
|
|
701
738
|
['setup', 'realtimeInputConfig'],
|
|
702
|
-
|
|
703
|
-
getv(from_object, ['realtime_input_config']), to_object
|
|
704
|
-
),
|
|
739
|
+
getv(from_object, ['realtime_input_config']),
|
|
705
740
|
)
|
|
706
741
|
|
|
707
742
|
if getv(from_object, ['context_window_compression']) is not None:
|
|
708
743
|
setv(
|
|
709
744
|
parent_object,
|
|
710
745
|
['setup', 'contextWindowCompression'],
|
|
711
|
-
|
|
712
|
-
getv(from_object, ['context_window_compression']), to_object
|
|
713
|
-
),
|
|
746
|
+
getv(from_object, ['context_window_compression']),
|
|
714
747
|
)
|
|
715
748
|
|
|
716
749
|
if getv(from_object, ['proactivity']) is not None:
|
|
717
750
|
setv(
|
|
718
751
|
parent_object,
|
|
719
752
|
['setup', 'proactivity'],
|
|
720
|
-
|
|
721
|
-
getv(from_object, ['proactivity']), to_object
|
|
722
|
-
),
|
|
753
|
+
getv(from_object, ['proactivity']),
|
|
723
754
|
)
|
|
724
755
|
|
|
725
756
|
return to_object
|
|
726
757
|
|
|
727
758
|
|
|
728
|
-
def
|
|
759
|
+
def _LiveConnectConfig_to_vertex(
|
|
729
760
|
api_client: BaseApiClient,
|
|
730
761
|
from_object: Union[dict[str, Any], object],
|
|
731
762
|
parent_object: Optional[dict[str, Any]] = None,
|
|
732
763
|
) -> dict[str, Any]:
|
|
733
764
|
to_object: dict[str, Any] = {}
|
|
734
|
-
if getv(from_object, ['model']) is not None:
|
|
735
|
-
setv(
|
|
736
|
-
to_object,
|
|
737
|
-
['setup', 'model'],
|
|
738
|
-
t.t_model(api_client, getv(from_object, ['model'])),
|
|
739
|
-
)
|
|
740
765
|
|
|
741
|
-
if getv(from_object, ['
|
|
766
|
+
if getv(from_object, ['generation_config']) is not None:
|
|
742
767
|
setv(
|
|
743
|
-
|
|
744
|
-
['
|
|
745
|
-
|
|
746
|
-
|
|
768
|
+
parent_object,
|
|
769
|
+
['setup', 'generationConfig'],
|
|
770
|
+
_GenerationConfig_to_vertex(
|
|
771
|
+
getv(from_object, ['generation_config']), to_object
|
|
747
772
|
),
|
|
748
773
|
)
|
|
749
774
|
|
|
750
|
-
|
|
775
|
+
if getv(from_object, ['response_modalities']) is not None:
|
|
776
|
+
setv(
|
|
777
|
+
parent_object,
|
|
778
|
+
['setup', 'generationConfig', 'responseModalities'],
|
|
779
|
+
getv(from_object, ['response_modalities']),
|
|
780
|
+
)
|
|
751
781
|
|
|
782
|
+
if getv(from_object, ['temperature']) is not None:
|
|
783
|
+
setv(
|
|
784
|
+
parent_object,
|
|
785
|
+
['setup', 'generationConfig', 'temperature'],
|
|
786
|
+
getv(from_object, ['temperature']),
|
|
787
|
+
)
|
|
752
788
|
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
789
|
+
if getv(from_object, ['top_p']) is not None:
|
|
790
|
+
setv(
|
|
791
|
+
parent_object,
|
|
792
|
+
['setup', 'generationConfig', 'topP'],
|
|
793
|
+
getv(from_object, ['top_p']),
|
|
794
|
+
)
|
|
758
795
|
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
def _ActivityEnd_to_mldev(
|
|
763
|
-
from_object: Union[dict[str, Any], object],
|
|
764
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
765
|
-
) -> dict[str, Any]:
|
|
766
|
-
to_object: dict[str, Any] = {}
|
|
767
|
-
|
|
768
|
-
return to_object
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
def _LiveSendRealtimeInputParameters_to_mldev(
|
|
772
|
-
from_object: Union[dict[str, Any], object],
|
|
773
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
774
|
-
) -> dict[str, Any]:
|
|
775
|
-
to_object: dict[str, Any] = {}
|
|
776
|
-
if getv(from_object, ['media']) is not None:
|
|
777
|
-
setv(to_object, ['mediaChunks'], t.t_blobs(getv(from_object, ['media'])))
|
|
778
|
-
|
|
779
|
-
if getv(from_object, ['audio']) is not None:
|
|
780
|
-
setv(to_object, ['audio'], t.t_audio_blob(getv(from_object, ['audio'])))
|
|
781
|
-
|
|
782
|
-
if getv(from_object, ['audio_stream_end']) is not None:
|
|
783
|
-
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
|
784
|
-
|
|
785
|
-
if getv(from_object, ['video']) is not None:
|
|
786
|
-
setv(to_object, ['video'], t.t_image_blob(getv(from_object, ['video'])))
|
|
787
|
-
|
|
788
|
-
if getv(from_object, ['text']) is not None:
|
|
789
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
790
|
-
|
|
791
|
-
if getv(from_object, ['activity_start']) is not None:
|
|
792
|
-
setv(
|
|
793
|
-
to_object,
|
|
794
|
-
['activityStart'],
|
|
795
|
-
_ActivityStart_to_mldev(
|
|
796
|
-
getv(from_object, ['activity_start']), to_object
|
|
797
|
-
),
|
|
798
|
-
)
|
|
799
|
-
|
|
800
|
-
if getv(from_object, ['activity_end']) is not None:
|
|
801
|
-
setv(
|
|
802
|
-
to_object,
|
|
803
|
-
['activityEnd'],
|
|
804
|
-
_ActivityEnd_to_mldev(getv(from_object, ['activity_end']), to_object),
|
|
805
|
-
)
|
|
806
|
-
|
|
807
|
-
return to_object
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
def _LiveClientSetup_to_mldev(
|
|
811
|
-
api_client: BaseApiClient,
|
|
812
|
-
from_object: Union[dict[str, Any], object],
|
|
813
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
814
|
-
) -> dict[str, Any]:
|
|
815
|
-
to_object: dict[str, Any] = {}
|
|
816
|
-
if getv(from_object, ['model']) is not None:
|
|
817
|
-
setv(to_object, ['model'], getv(from_object, ['model']))
|
|
818
|
-
|
|
819
|
-
if getv(from_object, ['generation_config']) is not None:
|
|
820
|
-
setv(
|
|
821
|
-
to_object,
|
|
822
|
-
['generationConfig'],
|
|
823
|
-
getv(from_object, ['generation_config']),
|
|
824
|
-
)
|
|
825
|
-
|
|
826
|
-
if getv(from_object, ['system_instruction']) is not None:
|
|
827
|
-
setv(
|
|
828
|
-
to_object,
|
|
829
|
-
['systemInstruction'],
|
|
830
|
-
_Content_to_mldev(
|
|
831
|
-
t.t_content(getv(from_object, ['system_instruction'])), to_object
|
|
832
|
-
),
|
|
833
|
-
)
|
|
834
|
-
|
|
835
|
-
if getv(from_object, ['tools']) is not None:
|
|
836
|
-
setv(
|
|
837
|
-
to_object,
|
|
838
|
-
['tools'],
|
|
839
|
-
[
|
|
840
|
-
_Tool_to_mldev(t.t_tool(api_client, item), to_object)
|
|
841
|
-
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
|
842
|
-
],
|
|
843
|
-
)
|
|
844
|
-
|
|
845
|
-
if getv(from_object, ['session_resumption']) is not None:
|
|
846
|
-
setv(
|
|
847
|
-
to_object,
|
|
848
|
-
['sessionResumption'],
|
|
849
|
-
_SessionResumptionConfig_to_mldev(
|
|
850
|
-
getv(from_object, ['session_resumption']), to_object
|
|
851
|
-
),
|
|
852
|
-
)
|
|
853
|
-
|
|
854
|
-
if getv(from_object, ['context_window_compression']) is not None:
|
|
855
|
-
setv(
|
|
856
|
-
to_object,
|
|
857
|
-
['contextWindowCompression'],
|
|
858
|
-
_ContextWindowCompressionConfig_to_mldev(
|
|
859
|
-
getv(from_object, ['context_window_compression']), to_object
|
|
860
|
-
),
|
|
861
|
-
)
|
|
862
|
-
|
|
863
|
-
if getv(from_object, ['input_audio_transcription']) is not None:
|
|
864
|
-
setv(
|
|
865
|
-
to_object,
|
|
866
|
-
['inputAudioTranscription'],
|
|
867
|
-
_AudioTranscriptionConfig_to_mldev(
|
|
868
|
-
getv(from_object, ['input_audio_transcription']), to_object
|
|
869
|
-
),
|
|
870
|
-
)
|
|
871
|
-
|
|
872
|
-
if getv(from_object, ['output_audio_transcription']) is not None:
|
|
873
|
-
setv(
|
|
874
|
-
to_object,
|
|
875
|
-
['outputAudioTranscription'],
|
|
876
|
-
_AudioTranscriptionConfig_to_mldev(
|
|
877
|
-
getv(from_object, ['output_audio_transcription']), to_object
|
|
878
|
-
),
|
|
879
|
-
)
|
|
880
|
-
|
|
881
|
-
if getv(from_object, ['proactivity']) is not None:
|
|
882
|
-
setv(
|
|
883
|
-
to_object,
|
|
884
|
-
['proactivity'],
|
|
885
|
-
_ProactivityConfig_to_mldev(
|
|
886
|
-
getv(from_object, ['proactivity']), to_object
|
|
887
|
-
),
|
|
888
|
-
)
|
|
889
|
-
|
|
890
|
-
return to_object
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
def _LiveClientContent_to_mldev(
|
|
894
|
-
from_object: Union[dict[str, Any], object],
|
|
895
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
896
|
-
) -> dict[str, Any]:
|
|
897
|
-
to_object: dict[str, Any] = {}
|
|
898
|
-
if getv(from_object, ['turns']) is not None:
|
|
899
|
-
setv(
|
|
900
|
-
to_object,
|
|
901
|
-
['turns'],
|
|
902
|
-
[
|
|
903
|
-
_Content_to_mldev(item, to_object)
|
|
904
|
-
for item in getv(from_object, ['turns'])
|
|
905
|
-
],
|
|
906
|
-
)
|
|
907
|
-
|
|
908
|
-
if getv(from_object, ['turn_complete']) is not None:
|
|
909
|
-
setv(to_object, ['turnComplete'], getv(from_object, ['turn_complete']))
|
|
910
|
-
|
|
911
|
-
return to_object
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
def _LiveClientRealtimeInput_to_mldev(
|
|
915
|
-
from_object: Union[dict[str, Any], object],
|
|
916
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
917
|
-
) -> dict[str, Any]:
|
|
918
|
-
to_object: dict[str, Any] = {}
|
|
919
|
-
if getv(from_object, ['media_chunks']) is not None:
|
|
920
|
-
setv(to_object, ['mediaChunks'], getv(from_object, ['media_chunks']))
|
|
921
|
-
|
|
922
|
-
if getv(from_object, ['audio']) is not None:
|
|
923
|
-
setv(to_object, ['audio'], getv(from_object, ['audio']))
|
|
924
|
-
|
|
925
|
-
if getv(from_object, ['audio_stream_end']) is not None:
|
|
926
|
-
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
|
927
|
-
|
|
928
|
-
if getv(from_object, ['video']) is not None:
|
|
929
|
-
setv(to_object, ['video'], getv(from_object, ['video']))
|
|
930
|
-
|
|
931
|
-
if getv(from_object, ['text']) is not None:
|
|
932
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
933
|
-
|
|
934
|
-
if getv(from_object, ['activity_start']) is not None:
|
|
935
|
-
setv(
|
|
936
|
-
to_object,
|
|
937
|
-
['activityStart'],
|
|
938
|
-
_ActivityStart_to_mldev(
|
|
939
|
-
getv(from_object, ['activity_start']), to_object
|
|
940
|
-
),
|
|
941
|
-
)
|
|
942
|
-
|
|
943
|
-
if getv(from_object, ['activity_end']) is not None:
|
|
944
|
-
setv(
|
|
945
|
-
to_object,
|
|
946
|
-
['activityEnd'],
|
|
947
|
-
_ActivityEnd_to_mldev(getv(from_object, ['activity_end']), to_object),
|
|
948
|
-
)
|
|
949
|
-
|
|
950
|
-
return to_object
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
def _FunctionResponse_to_mldev(
|
|
954
|
-
from_object: Union[dict[str, Any], object],
|
|
955
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
956
|
-
) -> dict[str, Any]:
|
|
957
|
-
to_object: dict[str, Any] = {}
|
|
958
|
-
if getv(from_object, ['will_continue']) is not None:
|
|
959
|
-
setv(to_object, ['willContinue'], getv(from_object, ['will_continue']))
|
|
960
|
-
|
|
961
|
-
if getv(from_object, ['scheduling']) is not None:
|
|
962
|
-
setv(to_object, ['scheduling'], getv(from_object, ['scheduling']))
|
|
963
|
-
|
|
964
|
-
if getv(from_object, ['id']) is not None:
|
|
965
|
-
setv(to_object, ['id'], getv(from_object, ['id']))
|
|
966
|
-
|
|
967
|
-
if getv(from_object, ['name']) is not None:
|
|
968
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
|
969
|
-
|
|
970
|
-
if getv(from_object, ['response']) is not None:
|
|
971
|
-
setv(to_object, ['response'], getv(from_object, ['response']))
|
|
972
|
-
|
|
973
|
-
return to_object
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
def _LiveClientToolResponse_to_mldev(
|
|
977
|
-
from_object: Union[dict[str, Any], object],
|
|
978
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
979
|
-
) -> dict[str, Any]:
|
|
980
|
-
to_object: dict[str, Any] = {}
|
|
981
|
-
if getv(from_object, ['function_responses']) is not None:
|
|
982
|
-
setv(
|
|
983
|
-
to_object,
|
|
984
|
-
['functionResponses'],
|
|
985
|
-
[
|
|
986
|
-
_FunctionResponse_to_mldev(item, to_object)
|
|
987
|
-
for item in getv(from_object, ['function_responses'])
|
|
988
|
-
],
|
|
989
|
-
)
|
|
990
|
-
|
|
991
|
-
return to_object
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
def _LiveClientMessage_to_mldev(
|
|
995
|
-
api_client: BaseApiClient,
|
|
996
|
-
from_object: Union[dict[str, Any], object],
|
|
997
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
998
|
-
) -> dict[str, Any]:
|
|
999
|
-
to_object: dict[str, Any] = {}
|
|
1000
|
-
if getv(from_object, ['setup']) is not None:
|
|
1001
|
-
setv(
|
|
1002
|
-
to_object,
|
|
1003
|
-
['setup'],
|
|
1004
|
-
_LiveClientSetup_to_mldev(
|
|
1005
|
-
api_client, getv(from_object, ['setup']), to_object
|
|
1006
|
-
),
|
|
1007
|
-
)
|
|
1008
|
-
|
|
1009
|
-
if getv(from_object, ['client_content']) is not None:
|
|
1010
|
-
setv(
|
|
1011
|
-
to_object,
|
|
1012
|
-
['clientContent'],
|
|
1013
|
-
_LiveClientContent_to_mldev(
|
|
1014
|
-
getv(from_object, ['client_content']), to_object
|
|
1015
|
-
),
|
|
1016
|
-
)
|
|
1017
|
-
|
|
1018
|
-
if getv(from_object, ['realtime_input']) is not None:
|
|
1019
|
-
setv(
|
|
1020
|
-
to_object,
|
|
1021
|
-
['realtimeInput'],
|
|
1022
|
-
_LiveClientRealtimeInput_to_mldev(
|
|
1023
|
-
getv(from_object, ['realtime_input']), to_object
|
|
1024
|
-
),
|
|
1025
|
-
)
|
|
1026
|
-
|
|
1027
|
-
if getv(from_object, ['tool_response']) is not None:
|
|
1028
|
-
setv(
|
|
1029
|
-
to_object,
|
|
1030
|
-
['toolResponse'],
|
|
1031
|
-
_LiveClientToolResponse_to_mldev(
|
|
1032
|
-
getv(from_object, ['tool_response']), to_object
|
|
1033
|
-
),
|
|
1034
|
-
)
|
|
1035
|
-
|
|
1036
|
-
return to_object
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
def _LiveMusicConnectParameters_to_mldev(
|
|
1040
|
-
from_object: Union[dict[str, Any], object],
|
|
1041
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1042
|
-
) -> dict[str, Any]:
|
|
1043
|
-
to_object: dict[str, Any] = {}
|
|
1044
|
-
if getv(from_object, ['model']) is not None:
|
|
1045
|
-
setv(to_object, ['setup', 'model'], getv(from_object, ['model']))
|
|
1046
|
-
|
|
1047
|
-
return to_object
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
def _WeightedPrompt_to_mldev(
|
|
1051
|
-
from_object: Union[dict[str, Any], object],
|
|
1052
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1053
|
-
) -> dict[str, Any]:
|
|
1054
|
-
to_object: dict[str, Any] = {}
|
|
1055
|
-
if getv(from_object, ['text']) is not None:
|
|
1056
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
1057
|
-
|
|
1058
|
-
if getv(from_object, ['weight']) is not None:
|
|
1059
|
-
setv(to_object, ['weight'], getv(from_object, ['weight']))
|
|
1060
|
-
|
|
1061
|
-
return to_object
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
def _LiveMusicSetWeightedPromptsParameters_to_mldev(
|
|
1065
|
-
from_object: Union[dict[str, Any], object],
|
|
1066
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1067
|
-
) -> dict[str, Any]:
|
|
1068
|
-
to_object: dict[str, Any] = {}
|
|
1069
|
-
if getv(from_object, ['weighted_prompts']) is not None:
|
|
1070
|
-
setv(
|
|
1071
|
-
to_object,
|
|
1072
|
-
['weightedPrompts'],
|
|
1073
|
-
[
|
|
1074
|
-
_WeightedPrompt_to_mldev(item, to_object)
|
|
1075
|
-
for item in getv(from_object, ['weighted_prompts'])
|
|
1076
|
-
],
|
|
1077
|
-
)
|
|
1078
|
-
|
|
1079
|
-
return to_object
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
def _LiveMusicGenerationConfig_to_mldev(
|
|
1083
|
-
from_object: Union[dict[str, Any], object],
|
|
1084
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1085
|
-
) -> dict[str, Any]:
|
|
1086
|
-
to_object: dict[str, Any] = {}
|
|
1087
|
-
if getv(from_object, ['temperature']) is not None:
|
|
1088
|
-
setv(to_object, ['temperature'], getv(from_object, ['temperature']))
|
|
1089
|
-
|
|
1090
|
-
if getv(from_object, ['top_k']) is not None:
|
|
1091
|
-
setv(to_object, ['topK'], getv(from_object, ['top_k']))
|
|
1092
|
-
|
|
1093
|
-
if getv(from_object, ['seed']) is not None:
|
|
1094
|
-
setv(to_object, ['seed'], getv(from_object, ['seed']))
|
|
1095
|
-
|
|
1096
|
-
if getv(from_object, ['guidance']) is not None:
|
|
1097
|
-
setv(to_object, ['guidance'], getv(from_object, ['guidance']))
|
|
1098
|
-
|
|
1099
|
-
if getv(from_object, ['bpm']) is not None:
|
|
1100
|
-
setv(to_object, ['bpm'], getv(from_object, ['bpm']))
|
|
1101
|
-
|
|
1102
|
-
if getv(from_object, ['density']) is not None:
|
|
1103
|
-
setv(to_object, ['density'], getv(from_object, ['density']))
|
|
1104
|
-
|
|
1105
|
-
if getv(from_object, ['brightness']) is not None:
|
|
1106
|
-
setv(to_object, ['brightness'], getv(from_object, ['brightness']))
|
|
1107
|
-
|
|
1108
|
-
if getv(from_object, ['scale']) is not None:
|
|
1109
|
-
setv(to_object, ['scale'], getv(from_object, ['scale']))
|
|
1110
|
-
|
|
1111
|
-
if getv(from_object, ['mute_bass']) is not None:
|
|
1112
|
-
setv(to_object, ['muteBass'], getv(from_object, ['mute_bass']))
|
|
1113
|
-
|
|
1114
|
-
if getv(from_object, ['mute_drums']) is not None:
|
|
1115
|
-
setv(to_object, ['muteDrums'], getv(from_object, ['mute_drums']))
|
|
1116
|
-
|
|
1117
|
-
if getv(from_object, ['only_bass_and_drums']) is not None:
|
|
1118
|
-
setv(
|
|
1119
|
-
to_object,
|
|
1120
|
-
['onlyBassAndDrums'],
|
|
1121
|
-
getv(from_object, ['only_bass_and_drums']),
|
|
1122
|
-
)
|
|
1123
|
-
|
|
1124
|
-
if getv(from_object, ['music_generation_mode']) is not None:
|
|
1125
|
-
setv(
|
|
1126
|
-
to_object,
|
|
1127
|
-
['musicGenerationMode'],
|
|
1128
|
-
getv(from_object, ['music_generation_mode']),
|
|
1129
|
-
)
|
|
1130
|
-
|
|
1131
|
-
return to_object
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
def _LiveMusicSetConfigParameters_to_mldev(
|
|
1135
|
-
from_object: Union[dict[str, Any], object],
|
|
1136
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1137
|
-
) -> dict[str, Any]:
|
|
1138
|
-
to_object: dict[str, Any] = {}
|
|
1139
|
-
if getv(from_object, ['music_generation_config']) is not None:
|
|
1140
|
-
setv(
|
|
1141
|
-
to_object,
|
|
1142
|
-
['musicGenerationConfig'],
|
|
1143
|
-
_LiveMusicGenerationConfig_to_mldev(
|
|
1144
|
-
getv(from_object, ['music_generation_config']), to_object
|
|
1145
|
-
),
|
|
1146
|
-
)
|
|
1147
|
-
|
|
1148
|
-
return to_object
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
def _LiveMusicClientSetup_to_mldev(
|
|
1152
|
-
from_object: Union[dict[str, Any], object],
|
|
1153
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1154
|
-
) -> dict[str, Any]:
|
|
1155
|
-
to_object: dict[str, Any] = {}
|
|
1156
|
-
if getv(from_object, ['model']) is not None:
|
|
1157
|
-
setv(to_object, ['model'], getv(from_object, ['model']))
|
|
1158
|
-
|
|
1159
|
-
return to_object
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
def _LiveMusicClientContent_to_mldev(
|
|
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, ['weighted_prompts']) is not None:
|
|
1168
|
-
setv(
|
|
1169
|
-
to_object,
|
|
1170
|
-
['weightedPrompts'],
|
|
1171
|
-
[
|
|
1172
|
-
_WeightedPrompt_to_mldev(item, to_object)
|
|
1173
|
-
for item in getv(from_object, ['weighted_prompts'])
|
|
1174
|
-
],
|
|
1175
|
-
)
|
|
1176
|
-
|
|
1177
|
-
return to_object
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
def _LiveMusicClientMessage_to_mldev(
|
|
1181
|
-
from_object: Union[dict[str, Any], object],
|
|
1182
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1183
|
-
) -> dict[str, Any]:
|
|
1184
|
-
to_object: dict[str, Any] = {}
|
|
1185
|
-
if getv(from_object, ['setup']) is not None:
|
|
1186
|
-
setv(
|
|
1187
|
-
to_object,
|
|
1188
|
-
['setup'],
|
|
1189
|
-
_LiveMusicClientSetup_to_mldev(getv(from_object, ['setup']), to_object),
|
|
1190
|
-
)
|
|
1191
|
-
|
|
1192
|
-
if getv(from_object, ['client_content']) is not None:
|
|
1193
|
-
setv(
|
|
1194
|
-
to_object,
|
|
1195
|
-
['clientContent'],
|
|
1196
|
-
_LiveMusicClientContent_to_mldev(
|
|
1197
|
-
getv(from_object, ['client_content']), to_object
|
|
1198
|
-
),
|
|
1199
|
-
)
|
|
1200
|
-
|
|
1201
|
-
if getv(from_object, ['music_generation_config']) is not None:
|
|
1202
|
-
setv(
|
|
1203
|
-
to_object,
|
|
1204
|
-
['musicGenerationConfig'],
|
|
1205
|
-
_LiveMusicGenerationConfig_to_mldev(
|
|
1206
|
-
getv(from_object, ['music_generation_config']), to_object
|
|
1207
|
-
),
|
|
1208
|
-
)
|
|
1209
|
-
|
|
1210
|
-
if getv(from_object, ['playback_control']) is not None:
|
|
1211
|
-
setv(
|
|
1212
|
-
to_object, ['playbackControl'], getv(from_object, ['playback_control'])
|
|
1213
|
-
)
|
|
1214
|
-
|
|
1215
|
-
return to_object
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
def _PrebuiltVoiceConfig_to_vertex(
|
|
1219
|
-
from_object: Union[dict[str, Any], object],
|
|
1220
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1221
|
-
) -> dict[str, Any]:
|
|
1222
|
-
to_object: dict[str, Any] = {}
|
|
1223
|
-
if getv(from_object, ['voice_name']) is not None:
|
|
1224
|
-
setv(to_object, ['voiceName'], getv(from_object, ['voice_name']))
|
|
1225
|
-
|
|
1226
|
-
return to_object
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
def _VoiceConfig_to_vertex(
|
|
1230
|
-
from_object: Union[dict[str, Any], object],
|
|
1231
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1232
|
-
) -> dict[str, Any]:
|
|
1233
|
-
to_object: dict[str, Any] = {}
|
|
1234
|
-
if getv(from_object, ['prebuilt_voice_config']) is not None:
|
|
1235
|
-
setv(
|
|
1236
|
-
to_object,
|
|
1237
|
-
['prebuiltVoiceConfig'],
|
|
1238
|
-
_PrebuiltVoiceConfig_to_vertex(
|
|
1239
|
-
getv(from_object, ['prebuilt_voice_config']), to_object
|
|
1240
|
-
),
|
|
1241
|
-
)
|
|
1242
|
-
|
|
1243
|
-
return to_object
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
def _SpeechConfig_to_vertex(
|
|
1247
|
-
from_object: Union[dict[str, Any], object],
|
|
1248
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1249
|
-
) -> dict[str, Any]:
|
|
1250
|
-
to_object: dict[str, Any] = {}
|
|
1251
|
-
if getv(from_object, ['voice_config']) is not None:
|
|
1252
|
-
setv(
|
|
1253
|
-
to_object,
|
|
1254
|
-
['voiceConfig'],
|
|
1255
|
-
_VoiceConfig_to_vertex(getv(from_object, ['voice_config']), to_object),
|
|
1256
|
-
)
|
|
1257
|
-
|
|
1258
|
-
if getv(from_object, ['multi_speaker_voice_config']) is not None:
|
|
1259
|
-
raise ValueError(
|
|
1260
|
-
'multi_speaker_voice_config parameter is not supported in Vertex AI.'
|
|
1261
|
-
)
|
|
1262
|
-
|
|
1263
|
-
if getv(from_object, ['language_code']) is not None:
|
|
1264
|
-
setv(to_object, ['languageCode'], getv(from_object, ['language_code']))
|
|
1265
|
-
|
|
1266
|
-
return to_object
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
def _VideoMetadata_to_vertex(
|
|
1270
|
-
from_object: Union[dict[str, Any], object],
|
|
1271
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1272
|
-
) -> dict[str, Any]:
|
|
1273
|
-
to_object: dict[str, Any] = {}
|
|
1274
|
-
if getv(from_object, ['fps']) is not None:
|
|
1275
|
-
setv(to_object, ['fps'], getv(from_object, ['fps']))
|
|
1276
|
-
|
|
1277
|
-
if getv(from_object, ['end_offset']) is not None:
|
|
1278
|
-
setv(to_object, ['endOffset'], getv(from_object, ['end_offset']))
|
|
1279
|
-
|
|
1280
|
-
if getv(from_object, ['start_offset']) is not None:
|
|
1281
|
-
setv(to_object, ['startOffset'], getv(from_object, ['start_offset']))
|
|
1282
|
-
|
|
1283
|
-
return to_object
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
def _Blob_to_vertex(
|
|
1287
|
-
from_object: Union[dict[str, Any], object],
|
|
1288
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1289
|
-
) -> dict[str, Any]:
|
|
1290
|
-
to_object: dict[str, Any] = {}
|
|
1291
|
-
if getv(from_object, ['display_name']) is not None:
|
|
1292
|
-
setv(to_object, ['displayName'], getv(from_object, ['display_name']))
|
|
1293
|
-
|
|
1294
|
-
if getv(from_object, ['data']) is not None:
|
|
1295
|
-
setv(to_object, ['data'], getv(from_object, ['data']))
|
|
1296
|
-
|
|
1297
|
-
if getv(from_object, ['mime_type']) is not None:
|
|
1298
|
-
setv(to_object, ['mimeType'], getv(from_object, ['mime_type']))
|
|
1299
|
-
|
|
1300
|
-
return to_object
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
def _FileData_to_vertex(
|
|
1304
|
-
from_object: Union[dict[str, Any], object],
|
|
1305
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1306
|
-
) -> dict[str, Any]:
|
|
1307
|
-
to_object: dict[str, Any] = {}
|
|
1308
|
-
if getv(from_object, ['display_name']) is not None:
|
|
1309
|
-
setv(to_object, ['displayName'], getv(from_object, ['display_name']))
|
|
1310
|
-
|
|
1311
|
-
if getv(from_object, ['file_uri']) is not None:
|
|
1312
|
-
setv(to_object, ['fileUri'], getv(from_object, ['file_uri']))
|
|
1313
|
-
|
|
1314
|
-
if getv(from_object, ['mime_type']) is not None:
|
|
1315
|
-
setv(to_object, ['mimeType'], getv(from_object, ['mime_type']))
|
|
1316
|
-
|
|
1317
|
-
return to_object
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
def _Part_to_vertex(
|
|
1321
|
-
from_object: Union[dict[str, Any], object],
|
|
1322
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1323
|
-
) -> dict[str, Any]:
|
|
1324
|
-
to_object: dict[str, Any] = {}
|
|
1325
|
-
if getv(from_object, ['video_metadata']) is not None:
|
|
1326
|
-
setv(
|
|
1327
|
-
to_object,
|
|
1328
|
-
['videoMetadata'],
|
|
1329
|
-
_VideoMetadata_to_vertex(
|
|
1330
|
-
getv(from_object, ['video_metadata']), to_object
|
|
1331
|
-
),
|
|
1332
|
-
)
|
|
1333
|
-
|
|
1334
|
-
if getv(from_object, ['thought']) is not None:
|
|
1335
|
-
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
|
1336
|
-
|
|
1337
|
-
if getv(from_object, ['inline_data']) is not None:
|
|
1338
|
-
setv(
|
|
1339
|
-
to_object,
|
|
1340
|
-
['inlineData'],
|
|
1341
|
-
_Blob_to_vertex(getv(from_object, ['inline_data']), to_object),
|
|
1342
|
-
)
|
|
1343
|
-
|
|
1344
|
-
if getv(from_object, ['file_data']) is not None:
|
|
1345
|
-
setv(
|
|
1346
|
-
to_object,
|
|
1347
|
-
['fileData'],
|
|
1348
|
-
_FileData_to_vertex(getv(from_object, ['file_data']), to_object),
|
|
1349
|
-
)
|
|
1350
|
-
|
|
1351
|
-
if getv(from_object, ['thought_signature']) is not None:
|
|
1352
|
-
setv(
|
|
1353
|
-
to_object,
|
|
1354
|
-
['thoughtSignature'],
|
|
1355
|
-
getv(from_object, ['thought_signature']),
|
|
1356
|
-
)
|
|
1357
|
-
|
|
1358
|
-
if getv(from_object, ['code_execution_result']) is not None:
|
|
1359
|
-
setv(
|
|
1360
|
-
to_object,
|
|
1361
|
-
['codeExecutionResult'],
|
|
1362
|
-
getv(from_object, ['code_execution_result']),
|
|
1363
|
-
)
|
|
1364
|
-
|
|
1365
|
-
if getv(from_object, ['executable_code']) is not None:
|
|
1366
|
-
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
|
1367
|
-
|
|
1368
|
-
if getv(from_object, ['function_call']) is not None:
|
|
1369
|
-
setv(to_object, ['functionCall'], getv(from_object, ['function_call']))
|
|
1370
|
-
|
|
1371
|
-
if getv(from_object, ['function_response']) is not None:
|
|
1372
|
-
setv(
|
|
1373
|
-
to_object,
|
|
1374
|
-
['functionResponse'],
|
|
1375
|
-
getv(from_object, ['function_response']),
|
|
1376
|
-
)
|
|
1377
|
-
|
|
1378
|
-
if getv(from_object, ['text']) is not None:
|
|
1379
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
1380
|
-
|
|
1381
|
-
return to_object
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
def _Content_to_vertex(
|
|
1385
|
-
from_object: Union[dict[str, Any], object],
|
|
1386
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1387
|
-
) -> dict[str, Any]:
|
|
1388
|
-
to_object: dict[str, Any] = {}
|
|
1389
|
-
if getv(from_object, ['parts']) is not None:
|
|
1390
|
-
setv(
|
|
1391
|
-
to_object,
|
|
1392
|
-
['parts'],
|
|
1393
|
-
[
|
|
1394
|
-
_Part_to_vertex(item, to_object)
|
|
1395
|
-
for item in getv(from_object, ['parts'])
|
|
1396
|
-
],
|
|
1397
|
-
)
|
|
1398
|
-
|
|
1399
|
-
if getv(from_object, ['role']) is not None:
|
|
1400
|
-
setv(to_object, ['role'], getv(from_object, ['role']))
|
|
1401
|
-
|
|
1402
|
-
return to_object
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
def _FunctionDeclaration_to_vertex(
|
|
1406
|
-
from_object: Union[dict[str, Any], object],
|
|
1407
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1408
|
-
) -> dict[str, Any]:
|
|
1409
|
-
to_object: dict[str, Any] = {}
|
|
1410
|
-
if getv(from_object, ['behavior']) is not None:
|
|
1411
|
-
raise ValueError('behavior parameter is not supported in Vertex AI.')
|
|
1412
|
-
|
|
1413
|
-
if getv(from_object, ['description']) is not None:
|
|
1414
|
-
setv(to_object, ['description'], getv(from_object, ['description']))
|
|
1415
|
-
|
|
1416
|
-
if getv(from_object, ['name']) is not None:
|
|
1417
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
|
1418
|
-
|
|
1419
|
-
if getv(from_object, ['parameters']) is not None:
|
|
1420
|
-
setv(to_object, ['parameters'], getv(from_object, ['parameters']))
|
|
1421
|
-
|
|
1422
|
-
if getv(from_object, ['parameters_json_schema']) is not None:
|
|
1423
|
-
setv(
|
|
1424
|
-
to_object,
|
|
1425
|
-
['parametersJsonSchema'],
|
|
1426
|
-
getv(from_object, ['parameters_json_schema']),
|
|
1427
|
-
)
|
|
1428
|
-
|
|
1429
|
-
if getv(from_object, ['response']) is not None:
|
|
1430
|
-
setv(to_object, ['response'], getv(from_object, ['response']))
|
|
1431
|
-
|
|
1432
|
-
if getv(from_object, ['response_json_schema']) is not None:
|
|
1433
|
-
setv(
|
|
1434
|
-
to_object,
|
|
1435
|
-
['responseJsonSchema'],
|
|
1436
|
-
getv(from_object, ['response_json_schema']),
|
|
1437
|
-
)
|
|
1438
|
-
|
|
1439
|
-
return to_object
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
def _Interval_to_vertex(
|
|
1443
|
-
from_object: Union[dict[str, Any], object],
|
|
1444
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1445
|
-
) -> dict[str, Any]:
|
|
1446
|
-
to_object: dict[str, Any] = {}
|
|
1447
|
-
if getv(from_object, ['start_time']) is not None:
|
|
1448
|
-
setv(to_object, ['startTime'], getv(from_object, ['start_time']))
|
|
1449
|
-
|
|
1450
|
-
if getv(from_object, ['end_time']) is not None:
|
|
1451
|
-
setv(to_object, ['endTime'], getv(from_object, ['end_time']))
|
|
1452
|
-
|
|
1453
|
-
return to_object
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
def _GoogleSearch_to_vertex(
|
|
1457
|
-
from_object: Union[dict[str, Any], object],
|
|
1458
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1459
|
-
) -> dict[str, Any]:
|
|
1460
|
-
to_object: dict[str, Any] = {}
|
|
1461
|
-
if getv(from_object, ['time_range_filter']) is not None:
|
|
1462
|
-
setv(
|
|
1463
|
-
to_object,
|
|
1464
|
-
['timeRangeFilter'],
|
|
1465
|
-
_Interval_to_vertex(
|
|
1466
|
-
getv(from_object, ['time_range_filter']), to_object
|
|
1467
|
-
),
|
|
1468
|
-
)
|
|
1469
|
-
|
|
1470
|
-
if getv(from_object, ['exclude_domains']) is not None:
|
|
1471
|
-
setv(to_object, ['excludeDomains'], getv(from_object, ['exclude_domains']))
|
|
1472
|
-
|
|
1473
|
-
return to_object
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
def _DynamicRetrievalConfig_to_vertex(
|
|
1477
|
-
from_object: Union[dict[str, Any], object],
|
|
1478
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1479
|
-
) -> dict[str, Any]:
|
|
1480
|
-
to_object: dict[str, Any] = {}
|
|
1481
|
-
if getv(from_object, ['mode']) is not None:
|
|
1482
|
-
setv(to_object, ['mode'], getv(from_object, ['mode']))
|
|
1483
|
-
|
|
1484
|
-
if getv(from_object, ['dynamic_threshold']) is not None:
|
|
1485
|
-
setv(
|
|
1486
|
-
to_object,
|
|
1487
|
-
['dynamicThreshold'],
|
|
1488
|
-
getv(from_object, ['dynamic_threshold']),
|
|
1489
|
-
)
|
|
1490
|
-
|
|
1491
|
-
return to_object
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
def _GoogleSearchRetrieval_to_vertex(
|
|
1495
|
-
from_object: Union[dict[str, Any], object],
|
|
1496
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1497
|
-
) -> dict[str, Any]:
|
|
1498
|
-
to_object: dict[str, Any] = {}
|
|
1499
|
-
if getv(from_object, ['dynamic_retrieval_config']) is not None:
|
|
1500
|
-
setv(
|
|
1501
|
-
to_object,
|
|
1502
|
-
['dynamicRetrievalConfig'],
|
|
1503
|
-
_DynamicRetrievalConfig_to_vertex(
|
|
1504
|
-
getv(from_object, ['dynamic_retrieval_config']), to_object
|
|
1505
|
-
),
|
|
1506
|
-
)
|
|
1507
|
-
|
|
1508
|
-
return to_object
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
def _EnterpriseWebSearch_to_vertex(
|
|
1512
|
-
from_object: Union[dict[str, Any], object],
|
|
1513
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1514
|
-
) -> dict[str, Any]:
|
|
1515
|
-
to_object: dict[str, Any] = {}
|
|
1516
|
-
if getv(from_object, ['exclude_domains']) is not None:
|
|
1517
|
-
setv(to_object, ['excludeDomains'], getv(from_object, ['exclude_domains']))
|
|
1518
|
-
|
|
1519
|
-
return to_object
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
def _ApiKeyConfig_to_vertex(
|
|
1523
|
-
from_object: Union[dict[str, Any], object],
|
|
1524
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1525
|
-
) -> dict[str, Any]:
|
|
1526
|
-
to_object: dict[str, Any] = {}
|
|
1527
|
-
if getv(from_object, ['api_key_string']) is not None:
|
|
1528
|
-
setv(to_object, ['apiKeyString'], getv(from_object, ['api_key_string']))
|
|
1529
|
-
|
|
1530
|
-
return to_object
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
def _AuthConfig_to_vertex(
|
|
1534
|
-
from_object: Union[dict[str, Any], object],
|
|
1535
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1536
|
-
) -> dict[str, Any]:
|
|
1537
|
-
to_object: dict[str, Any] = {}
|
|
1538
|
-
if getv(from_object, ['api_key_config']) is not None:
|
|
1539
|
-
setv(
|
|
1540
|
-
to_object,
|
|
1541
|
-
['apiKeyConfig'],
|
|
1542
|
-
_ApiKeyConfig_to_vertex(
|
|
1543
|
-
getv(from_object, ['api_key_config']), to_object
|
|
1544
|
-
),
|
|
1545
|
-
)
|
|
1546
|
-
|
|
1547
|
-
if getv(from_object, ['auth_type']) is not None:
|
|
1548
|
-
setv(to_object, ['authType'], getv(from_object, ['auth_type']))
|
|
1549
|
-
|
|
1550
|
-
if getv(from_object, ['google_service_account_config']) is not None:
|
|
1551
|
-
setv(
|
|
1552
|
-
to_object,
|
|
1553
|
-
['googleServiceAccountConfig'],
|
|
1554
|
-
getv(from_object, ['google_service_account_config']),
|
|
1555
|
-
)
|
|
1556
|
-
|
|
1557
|
-
if getv(from_object, ['http_basic_auth_config']) is not None:
|
|
1558
|
-
setv(
|
|
1559
|
-
to_object,
|
|
1560
|
-
['httpBasicAuthConfig'],
|
|
1561
|
-
getv(from_object, ['http_basic_auth_config']),
|
|
1562
|
-
)
|
|
1563
|
-
|
|
1564
|
-
if getv(from_object, ['oauth_config']) is not None:
|
|
1565
|
-
setv(to_object, ['oauthConfig'], getv(from_object, ['oauth_config']))
|
|
1566
|
-
|
|
1567
|
-
if getv(from_object, ['oidc_config']) is not None:
|
|
1568
|
-
setv(to_object, ['oidcConfig'], getv(from_object, ['oidc_config']))
|
|
1569
|
-
|
|
1570
|
-
return to_object
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
def _GoogleMaps_to_vertex(
|
|
1574
|
-
from_object: Union[dict[str, Any], object],
|
|
1575
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1576
|
-
) -> dict[str, Any]:
|
|
1577
|
-
to_object: dict[str, Any] = {}
|
|
1578
|
-
if getv(from_object, ['auth_config']) is not None:
|
|
1579
|
-
setv(
|
|
1580
|
-
to_object,
|
|
1581
|
-
['authConfig'],
|
|
1582
|
-
_AuthConfig_to_vertex(getv(from_object, ['auth_config']), to_object),
|
|
1583
|
-
)
|
|
1584
|
-
|
|
1585
|
-
return to_object
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
def _UrlContext_to_vertex(
|
|
1589
|
-
from_object: Union[dict[str, Any], object],
|
|
1590
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1591
|
-
) -> dict[str, Any]:
|
|
1592
|
-
to_object: dict[str, Any] = {}
|
|
1593
|
-
|
|
1594
|
-
return to_object
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
def _ToolComputerUse_to_vertex(
|
|
1598
|
-
from_object: Union[dict[str, Any], object],
|
|
1599
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1600
|
-
) -> dict[str, Any]:
|
|
1601
|
-
to_object: dict[str, Any] = {}
|
|
1602
|
-
if getv(from_object, ['environment']) is not None:
|
|
1603
|
-
setv(to_object, ['environment'], getv(from_object, ['environment']))
|
|
1604
|
-
|
|
1605
|
-
return to_object
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
def _Tool_to_vertex(
|
|
1609
|
-
from_object: Union[dict[str, Any], object],
|
|
1610
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1611
|
-
) -> dict[str, Any]:
|
|
1612
|
-
to_object: dict[str, Any] = {}
|
|
1613
|
-
if getv(from_object, ['function_declarations']) is not None:
|
|
1614
|
-
setv(
|
|
1615
|
-
to_object,
|
|
1616
|
-
['functionDeclarations'],
|
|
1617
|
-
[
|
|
1618
|
-
_FunctionDeclaration_to_vertex(item, to_object)
|
|
1619
|
-
for item in getv(from_object, ['function_declarations'])
|
|
1620
|
-
],
|
|
1621
|
-
)
|
|
1622
|
-
|
|
1623
|
-
if getv(from_object, ['retrieval']) is not None:
|
|
1624
|
-
setv(to_object, ['retrieval'], getv(from_object, ['retrieval']))
|
|
1625
|
-
|
|
1626
|
-
if getv(from_object, ['google_search']) is not None:
|
|
1627
|
-
setv(
|
|
1628
|
-
to_object,
|
|
1629
|
-
['googleSearch'],
|
|
1630
|
-
_GoogleSearch_to_vertex(
|
|
1631
|
-
getv(from_object, ['google_search']), to_object
|
|
1632
|
-
),
|
|
1633
|
-
)
|
|
1634
|
-
|
|
1635
|
-
if getv(from_object, ['google_search_retrieval']) is not None:
|
|
1636
|
-
setv(
|
|
1637
|
-
to_object,
|
|
1638
|
-
['googleSearchRetrieval'],
|
|
1639
|
-
_GoogleSearchRetrieval_to_vertex(
|
|
1640
|
-
getv(from_object, ['google_search_retrieval']), to_object
|
|
1641
|
-
),
|
|
1642
|
-
)
|
|
1643
|
-
|
|
1644
|
-
if getv(from_object, ['enterprise_web_search']) is not None:
|
|
1645
|
-
setv(
|
|
1646
|
-
to_object,
|
|
1647
|
-
['enterpriseWebSearch'],
|
|
1648
|
-
_EnterpriseWebSearch_to_vertex(
|
|
1649
|
-
getv(from_object, ['enterprise_web_search']), to_object
|
|
1650
|
-
),
|
|
1651
|
-
)
|
|
1652
|
-
|
|
1653
|
-
if getv(from_object, ['google_maps']) is not None:
|
|
1654
|
-
setv(
|
|
1655
|
-
to_object,
|
|
1656
|
-
['googleMaps'],
|
|
1657
|
-
_GoogleMaps_to_vertex(getv(from_object, ['google_maps']), to_object),
|
|
1658
|
-
)
|
|
1659
|
-
|
|
1660
|
-
if getv(from_object, ['url_context']) is not None:
|
|
1661
|
-
setv(
|
|
1662
|
-
to_object,
|
|
1663
|
-
['urlContext'],
|
|
1664
|
-
_UrlContext_to_vertex(getv(from_object, ['url_context']), to_object),
|
|
1665
|
-
)
|
|
1666
|
-
|
|
1667
|
-
if getv(from_object, ['computer_use']) is not None:
|
|
1668
|
-
setv(
|
|
1669
|
-
to_object,
|
|
1670
|
-
['computerUse'],
|
|
1671
|
-
_ToolComputerUse_to_vertex(
|
|
1672
|
-
getv(from_object, ['computer_use']), to_object
|
|
1673
|
-
),
|
|
1674
|
-
)
|
|
1675
|
-
|
|
1676
|
-
if getv(from_object, ['code_execution']) is not None:
|
|
1677
|
-
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
|
1678
|
-
|
|
1679
|
-
return to_object
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
def _SessionResumptionConfig_to_vertex(
|
|
1683
|
-
from_object: Union[dict[str, Any], object],
|
|
1684
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1685
|
-
) -> dict[str, Any]:
|
|
1686
|
-
to_object: dict[str, Any] = {}
|
|
1687
|
-
if getv(from_object, ['handle']) is not None:
|
|
1688
|
-
setv(to_object, ['handle'], getv(from_object, ['handle']))
|
|
1689
|
-
|
|
1690
|
-
if getv(from_object, ['transparent']) is not None:
|
|
1691
|
-
setv(to_object, ['transparent'], getv(from_object, ['transparent']))
|
|
1692
|
-
|
|
1693
|
-
return to_object
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
def _AudioTranscriptionConfig_to_vertex(
|
|
1697
|
-
from_object: Union[dict[str, Any], object],
|
|
1698
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1699
|
-
) -> dict[str, Any]:
|
|
1700
|
-
to_object: dict[str, Any] = {}
|
|
1701
|
-
|
|
1702
|
-
return to_object
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
def _AutomaticActivityDetection_to_vertex(
|
|
1706
|
-
from_object: Union[dict[str, Any], object],
|
|
1707
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1708
|
-
) -> dict[str, Any]:
|
|
1709
|
-
to_object: dict[str, Any] = {}
|
|
1710
|
-
if getv(from_object, ['disabled']) is not None:
|
|
1711
|
-
setv(to_object, ['disabled'], getv(from_object, ['disabled']))
|
|
1712
|
-
|
|
1713
|
-
if getv(from_object, ['start_of_speech_sensitivity']) is not None:
|
|
1714
|
-
setv(
|
|
1715
|
-
to_object,
|
|
1716
|
-
['startOfSpeechSensitivity'],
|
|
1717
|
-
getv(from_object, ['start_of_speech_sensitivity']),
|
|
1718
|
-
)
|
|
1719
|
-
|
|
1720
|
-
if getv(from_object, ['end_of_speech_sensitivity']) is not None:
|
|
1721
|
-
setv(
|
|
1722
|
-
to_object,
|
|
1723
|
-
['endOfSpeechSensitivity'],
|
|
1724
|
-
getv(from_object, ['end_of_speech_sensitivity']),
|
|
1725
|
-
)
|
|
1726
|
-
|
|
1727
|
-
if getv(from_object, ['prefix_padding_ms']) is not None:
|
|
1728
|
-
setv(
|
|
1729
|
-
to_object, ['prefixPaddingMs'], getv(from_object, ['prefix_padding_ms'])
|
|
1730
|
-
)
|
|
1731
|
-
|
|
1732
|
-
if getv(from_object, ['silence_duration_ms']) is not None:
|
|
1733
|
-
setv(
|
|
1734
|
-
to_object,
|
|
1735
|
-
['silenceDurationMs'],
|
|
1736
|
-
getv(from_object, ['silence_duration_ms']),
|
|
1737
|
-
)
|
|
1738
|
-
|
|
1739
|
-
return to_object
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
def _RealtimeInputConfig_to_vertex(
|
|
1743
|
-
from_object: Union[dict[str, Any], object],
|
|
1744
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1745
|
-
) -> dict[str, Any]:
|
|
1746
|
-
to_object: dict[str, Any] = {}
|
|
1747
|
-
if getv(from_object, ['automatic_activity_detection']) is not None:
|
|
1748
|
-
setv(
|
|
1749
|
-
to_object,
|
|
1750
|
-
['automaticActivityDetection'],
|
|
1751
|
-
_AutomaticActivityDetection_to_vertex(
|
|
1752
|
-
getv(from_object, ['automatic_activity_detection']), to_object
|
|
1753
|
-
),
|
|
1754
|
-
)
|
|
1755
|
-
|
|
1756
|
-
if getv(from_object, ['activity_handling']) is not None:
|
|
1757
|
-
setv(
|
|
1758
|
-
to_object,
|
|
1759
|
-
['activityHandling'],
|
|
1760
|
-
getv(from_object, ['activity_handling']),
|
|
1761
|
-
)
|
|
1762
|
-
|
|
1763
|
-
if getv(from_object, ['turn_coverage']) is not None:
|
|
1764
|
-
setv(to_object, ['turnCoverage'], getv(from_object, ['turn_coverage']))
|
|
1765
|
-
|
|
1766
|
-
return to_object
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
def _SlidingWindow_to_vertex(
|
|
1770
|
-
from_object: Union[dict[str, Any], object],
|
|
1771
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1772
|
-
) -> dict[str, Any]:
|
|
1773
|
-
to_object: dict[str, Any] = {}
|
|
1774
|
-
if getv(from_object, ['target_tokens']) is not None:
|
|
1775
|
-
setv(to_object, ['targetTokens'], getv(from_object, ['target_tokens']))
|
|
1776
|
-
|
|
1777
|
-
return to_object
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
def _ContextWindowCompressionConfig_to_vertex(
|
|
1781
|
-
from_object: Union[dict[str, Any], object],
|
|
1782
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1783
|
-
) -> dict[str, Any]:
|
|
1784
|
-
to_object: dict[str, Any] = {}
|
|
1785
|
-
if getv(from_object, ['trigger_tokens']) is not None:
|
|
1786
|
-
setv(to_object, ['triggerTokens'], getv(from_object, ['trigger_tokens']))
|
|
1787
|
-
|
|
1788
|
-
if getv(from_object, ['sliding_window']) is not None:
|
|
1789
|
-
setv(
|
|
1790
|
-
to_object,
|
|
1791
|
-
['slidingWindow'],
|
|
1792
|
-
_SlidingWindow_to_vertex(
|
|
1793
|
-
getv(from_object, ['sliding_window']), to_object
|
|
1794
|
-
),
|
|
1795
|
-
)
|
|
1796
|
-
|
|
1797
|
-
return to_object
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
def _ProactivityConfig_to_vertex(
|
|
1801
|
-
from_object: Union[dict[str, Any], object],
|
|
1802
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1803
|
-
) -> dict[str, Any]:
|
|
1804
|
-
to_object: dict[str, Any] = {}
|
|
1805
|
-
if getv(from_object, ['proactive_audio']) is not None:
|
|
1806
|
-
setv(to_object, ['proactiveAudio'], getv(from_object, ['proactive_audio']))
|
|
1807
|
-
|
|
1808
|
-
return to_object
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
def _LiveConnectConfig_to_vertex(
|
|
1812
|
-
api_client: BaseApiClient,
|
|
1813
|
-
from_object: Union[dict[str, Any], object],
|
|
1814
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1815
|
-
) -> dict[str, Any]:
|
|
1816
|
-
to_object: dict[str, Any] = {}
|
|
1817
|
-
|
|
1818
|
-
if getv(from_object, ['generation_config']) is not None:
|
|
1819
|
-
setv(
|
|
1820
|
-
parent_object,
|
|
1821
|
-
['setup', 'generationConfig'],
|
|
1822
|
-
getv(from_object, ['generation_config']),
|
|
1823
|
-
)
|
|
1824
|
-
|
|
1825
|
-
if getv(from_object, ['response_modalities']) is not None:
|
|
1826
|
-
setv(
|
|
1827
|
-
parent_object,
|
|
1828
|
-
['setup', 'generationConfig', 'responseModalities'],
|
|
1829
|
-
getv(from_object, ['response_modalities']),
|
|
1830
|
-
)
|
|
1831
|
-
|
|
1832
|
-
if getv(from_object, ['temperature']) is not None:
|
|
1833
|
-
setv(
|
|
1834
|
-
parent_object,
|
|
1835
|
-
['setup', 'generationConfig', 'temperature'],
|
|
1836
|
-
getv(from_object, ['temperature']),
|
|
1837
|
-
)
|
|
1838
|
-
|
|
1839
|
-
if getv(from_object, ['top_p']) is not None:
|
|
1840
|
-
setv(
|
|
1841
|
-
parent_object,
|
|
1842
|
-
['setup', 'generationConfig', 'topP'],
|
|
1843
|
-
getv(from_object, ['top_p']),
|
|
1844
|
-
)
|
|
1845
|
-
|
|
1846
|
-
if getv(from_object, ['top_k']) is not None:
|
|
1847
|
-
setv(
|
|
1848
|
-
parent_object,
|
|
1849
|
-
['setup', 'generationConfig', 'topK'],
|
|
1850
|
-
getv(from_object, ['top_k']),
|
|
1851
|
-
)
|
|
1852
|
-
|
|
1853
|
-
if getv(from_object, ['max_output_tokens']) is not None:
|
|
1854
|
-
setv(
|
|
1855
|
-
parent_object,
|
|
1856
|
-
['setup', 'generationConfig', 'maxOutputTokens'],
|
|
1857
|
-
getv(from_object, ['max_output_tokens']),
|
|
1858
|
-
)
|
|
1859
|
-
|
|
1860
|
-
if getv(from_object, ['media_resolution']) is not None:
|
|
1861
|
-
setv(
|
|
1862
|
-
parent_object,
|
|
1863
|
-
['setup', 'generationConfig', 'mediaResolution'],
|
|
1864
|
-
getv(from_object, ['media_resolution']),
|
|
1865
|
-
)
|
|
1866
|
-
|
|
1867
|
-
if getv(from_object, ['seed']) is not None:
|
|
1868
|
-
setv(
|
|
1869
|
-
parent_object,
|
|
1870
|
-
['setup', 'generationConfig', 'seed'],
|
|
1871
|
-
getv(from_object, ['seed']),
|
|
1872
|
-
)
|
|
1873
|
-
|
|
1874
|
-
if getv(from_object, ['speech_config']) is not None:
|
|
1875
|
-
setv(
|
|
1876
|
-
parent_object,
|
|
1877
|
-
['setup', 'generationConfig', 'speechConfig'],
|
|
1878
|
-
_SpeechConfig_to_vertex(
|
|
1879
|
-
t.t_live_speech_config(getv(from_object, ['speech_config'])),
|
|
1880
|
-
to_object,
|
|
1881
|
-
),
|
|
1882
|
-
)
|
|
1883
|
-
|
|
1884
|
-
if getv(from_object, ['enable_affective_dialog']) is not None:
|
|
1885
|
-
setv(
|
|
1886
|
-
parent_object,
|
|
1887
|
-
['setup', 'generationConfig', 'enableAffectiveDialog'],
|
|
1888
|
-
getv(from_object, ['enable_affective_dialog']),
|
|
1889
|
-
)
|
|
1890
|
-
|
|
1891
|
-
if getv(from_object, ['system_instruction']) is not None:
|
|
1892
|
-
setv(
|
|
1893
|
-
parent_object,
|
|
1894
|
-
['setup', 'systemInstruction'],
|
|
1895
|
-
_Content_to_vertex(
|
|
1896
|
-
t.t_content(getv(from_object, ['system_instruction'])), to_object
|
|
1897
|
-
),
|
|
1898
|
-
)
|
|
1899
|
-
|
|
1900
|
-
if getv(from_object, ['tools']) is not None:
|
|
1901
|
-
setv(
|
|
1902
|
-
parent_object,
|
|
1903
|
-
['setup', 'tools'],
|
|
1904
|
-
[
|
|
1905
|
-
_Tool_to_vertex(t.t_tool(api_client, item), to_object)
|
|
1906
|
-
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
|
1907
|
-
],
|
|
1908
|
-
)
|
|
1909
|
-
|
|
1910
|
-
if getv(from_object, ['session_resumption']) is not None:
|
|
1911
|
-
setv(
|
|
1912
|
-
parent_object,
|
|
1913
|
-
['setup', 'sessionResumption'],
|
|
1914
|
-
_SessionResumptionConfig_to_vertex(
|
|
1915
|
-
getv(from_object, ['session_resumption']), to_object
|
|
1916
|
-
),
|
|
1917
|
-
)
|
|
1918
|
-
|
|
1919
|
-
if getv(from_object, ['input_audio_transcription']) is not None:
|
|
1920
|
-
setv(
|
|
1921
|
-
parent_object,
|
|
1922
|
-
['setup', 'inputAudioTranscription'],
|
|
1923
|
-
_AudioTranscriptionConfig_to_vertex(
|
|
1924
|
-
getv(from_object, ['input_audio_transcription']), to_object
|
|
1925
|
-
),
|
|
1926
|
-
)
|
|
1927
|
-
|
|
1928
|
-
if getv(from_object, ['output_audio_transcription']) is not None:
|
|
1929
|
-
setv(
|
|
1930
|
-
parent_object,
|
|
1931
|
-
['setup', 'outputAudioTranscription'],
|
|
1932
|
-
_AudioTranscriptionConfig_to_vertex(
|
|
1933
|
-
getv(from_object, ['output_audio_transcription']), to_object
|
|
1934
|
-
),
|
|
1935
|
-
)
|
|
1936
|
-
|
|
1937
|
-
if getv(from_object, ['realtime_input_config']) is not None:
|
|
1938
|
-
setv(
|
|
1939
|
-
parent_object,
|
|
1940
|
-
['setup', 'realtimeInputConfig'],
|
|
1941
|
-
_RealtimeInputConfig_to_vertex(
|
|
1942
|
-
getv(from_object, ['realtime_input_config']), to_object
|
|
1943
|
-
),
|
|
1944
|
-
)
|
|
1945
|
-
|
|
1946
|
-
if getv(from_object, ['context_window_compression']) is not None:
|
|
1947
|
-
setv(
|
|
1948
|
-
parent_object,
|
|
1949
|
-
['setup', 'contextWindowCompression'],
|
|
1950
|
-
_ContextWindowCompressionConfig_to_vertex(
|
|
1951
|
-
getv(from_object, ['context_window_compression']), to_object
|
|
1952
|
-
),
|
|
1953
|
-
)
|
|
1954
|
-
|
|
1955
|
-
if getv(from_object, ['proactivity']) is not None:
|
|
1956
|
-
setv(
|
|
1957
|
-
parent_object,
|
|
1958
|
-
['setup', 'proactivity'],
|
|
1959
|
-
_ProactivityConfig_to_vertex(
|
|
1960
|
-
getv(from_object, ['proactivity']), to_object
|
|
1961
|
-
),
|
|
1962
|
-
)
|
|
1963
|
-
|
|
1964
|
-
return to_object
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
def _LiveConnectParameters_to_vertex(
|
|
1968
|
-
api_client: BaseApiClient,
|
|
1969
|
-
from_object: Union[dict[str, Any], object],
|
|
1970
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1971
|
-
) -> dict[str, Any]:
|
|
1972
|
-
to_object: dict[str, Any] = {}
|
|
1973
|
-
if getv(from_object, ['model']) is not None:
|
|
1974
|
-
setv(
|
|
1975
|
-
to_object,
|
|
1976
|
-
['setup', 'model'],
|
|
1977
|
-
t.t_model(api_client, getv(from_object, ['model'])),
|
|
1978
|
-
)
|
|
1979
|
-
|
|
1980
|
-
if getv(from_object, ['config']) is not None:
|
|
1981
|
-
setv(
|
|
1982
|
-
to_object,
|
|
1983
|
-
['config'],
|
|
1984
|
-
_LiveConnectConfig_to_vertex(
|
|
1985
|
-
api_client, getv(from_object, ['config']), to_object
|
|
1986
|
-
),
|
|
1987
|
-
)
|
|
1988
|
-
|
|
1989
|
-
return to_object
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
def _ActivityStart_to_vertex(
|
|
1993
|
-
from_object: Union[dict[str, Any], object],
|
|
1994
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
1995
|
-
) -> dict[str, Any]:
|
|
1996
|
-
to_object: dict[str, Any] = {}
|
|
1997
|
-
|
|
1998
|
-
return to_object
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
def _ActivityEnd_to_vertex(
|
|
2002
|
-
from_object: Union[dict[str, Any], object],
|
|
2003
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2004
|
-
) -> dict[str, Any]:
|
|
2005
|
-
to_object: dict[str, Any] = {}
|
|
2006
|
-
|
|
2007
|
-
return to_object
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
def _LiveSendRealtimeInputParameters_to_vertex(
|
|
2011
|
-
from_object: Union[dict[str, Any], object],
|
|
2012
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2013
|
-
) -> dict[str, Any]:
|
|
2014
|
-
to_object: dict[str, Any] = {}
|
|
2015
|
-
if getv(from_object, ['media']) is not None:
|
|
2016
|
-
setv(to_object, ['mediaChunks'], t.t_blobs(getv(from_object, ['media'])))
|
|
2017
|
-
|
|
2018
|
-
if getv(from_object, ['audio']) is not None:
|
|
2019
|
-
setv(to_object, ['audio'], t.t_audio_blob(getv(from_object, ['audio'])))
|
|
2020
|
-
|
|
2021
|
-
if getv(from_object, ['audio_stream_end']) is not None:
|
|
2022
|
-
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
|
2023
|
-
|
|
2024
|
-
if getv(from_object, ['video']) is not None:
|
|
2025
|
-
setv(to_object, ['video'], t.t_image_blob(getv(from_object, ['video'])))
|
|
2026
|
-
|
|
2027
|
-
if getv(from_object, ['text']) is not None:
|
|
2028
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
2029
|
-
|
|
2030
|
-
if getv(from_object, ['activity_start']) is not None:
|
|
2031
|
-
setv(
|
|
2032
|
-
to_object,
|
|
2033
|
-
['activityStart'],
|
|
2034
|
-
_ActivityStart_to_vertex(
|
|
2035
|
-
getv(from_object, ['activity_start']), to_object
|
|
2036
|
-
),
|
|
2037
|
-
)
|
|
2038
|
-
|
|
2039
|
-
if getv(from_object, ['activity_end']) is not None:
|
|
2040
|
-
setv(
|
|
2041
|
-
to_object,
|
|
2042
|
-
['activityEnd'],
|
|
2043
|
-
_ActivityEnd_to_vertex(getv(from_object, ['activity_end']), to_object),
|
|
2044
|
-
)
|
|
2045
|
-
|
|
2046
|
-
return to_object
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
def _LiveClientSetup_to_vertex(
|
|
2050
|
-
api_client: BaseApiClient,
|
|
2051
|
-
from_object: Union[dict[str, Any], object],
|
|
2052
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2053
|
-
) -> dict[str, Any]:
|
|
2054
|
-
to_object: dict[str, Any] = {}
|
|
2055
|
-
if getv(from_object, ['model']) is not None:
|
|
2056
|
-
setv(to_object, ['model'], getv(from_object, ['model']))
|
|
2057
|
-
|
|
2058
|
-
if getv(from_object, ['generation_config']) is not None:
|
|
2059
|
-
setv(
|
|
2060
|
-
to_object,
|
|
2061
|
-
['generationConfig'],
|
|
2062
|
-
getv(from_object, ['generation_config']),
|
|
2063
|
-
)
|
|
2064
|
-
|
|
2065
|
-
if getv(from_object, ['system_instruction']) is not None:
|
|
2066
|
-
setv(
|
|
2067
|
-
to_object,
|
|
2068
|
-
['systemInstruction'],
|
|
2069
|
-
_Content_to_vertex(
|
|
2070
|
-
t.t_content(getv(from_object, ['system_instruction'])), to_object
|
|
2071
|
-
),
|
|
2072
|
-
)
|
|
2073
|
-
|
|
2074
|
-
if getv(from_object, ['tools']) is not None:
|
|
2075
|
-
setv(
|
|
2076
|
-
to_object,
|
|
2077
|
-
['tools'],
|
|
2078
|
-
[
|
|
2079
|
-
_Tool_to_vertex(t.t_tool(api_client, item), to_object)
|
|
2080
|
-
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
|
2081
|
-
],
|
|
2082
|
-
)
|
|
2083
|
-
|
|
2084
|
-
if getv(from_object, ['session_resumption']) is not None:
|
|
2085
|
-
setv(
|
|
2086
|
-
to_object,
|
|
2087
|
-
['sessionResumption'],
|
|
2088
|
-
_SessionResumptionConfig_to_vertex(
|
|
2089
|
-
getv(from_object, ['session_resumption']), to_object
|
|
2090
|
-
),
|
|
2091
|
-
)
|
|
2092
|
-
|
|
2093
|
-
if getv(from_object, ['context_window_compression']) is not None:
|
|
2094
|
-
setv(
|
|
2095
|
-
to_object,
|
|
2096
|
-
['contextWindowCompression'],
|
|
2097
|
-
_ContextWindowCompressionConfig_to_vertex(
|
|
2098
|
-
getv(from_object, ['context_window_compression']), to_object
|
|
2099
|
-
),
|
|
2100
|
-
)
|
|
2101
|
-
|
|
2102
|
-
if getv(from_object, ['input_audio_transcription']) is not None:
|
|
2103
|
-
setv(
|
|
2104
|
-
to_object,
|
|
2105
|
-
['inputAudioTranscription'],
|
|
2106
|
-
_AudioTranscriptionConfig_to_vertex(
|
|
2107
|
-
getv(from_object, ['input_audio_transcription']), to_object
|
|
2108
|
-
),
|
|
2109
|
-
)
|
|
2110
|
-
|
|
2111
|
-
if getv(from_object, ['output_audio_transcription']) is not None:
|
|
2112
|
-
setv(
|
|
2113
|
-
to_object,
|
|
2114
|
-
['outputAudioTranscription'],
|
|
2115
|
-
_AudioTranscriptionConfig_to_vertex(
|
|
2116
|
-
getv(from_object, ['output_audio_transcription']), to_object
|
|
2117
|
-
),
|
|
2118
|
-
)
|
|
2119
|
-
|
|
2120
|
-
if getv(from_object, ['proactivity']) is not None:
|
|
2121
|
-
setv(
|
|
2122
|
-
to_object,
|
|
2123
|
-
['proactivity'],
|
|
2124
|
-
_ProactivityConfig_to_vertex(
|
|
2125
|
-
getv(from_object, ['proactivity']), to_object
|
|
2126
|
-
),
|
|
2127
|
-
)
|
|
2128
|
-
|
|
2129
|
-
return to_object
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
def _LiveClientContent_to_vertex(
|
|
2133
|
-
from_object: Union[dict[str, Any], object],
|
|
2134
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2135
|
-
) -> dict[str, Any]:
|
|
2136
|
-
to_object: dict[str, Any] = {}
|
|
2137
|
-
if getv(from_object, ['turns']) is not None:
|
|
2138
|
-
setv(
|
|
2139
|
-
to_object,
|
|
2140
|
-
['turns'],
|
|
2141
|
-
[
|
|
2142
|
-
_Content_to_vertex(item, to_object)
|
|
2143
|
-
for item in getv(from_object, ['turns'])
|
|
2144
|
-
],
|
|
2145
|
-
)
|
|
2146
|
-
|
|
2147
|
-
if getv(from_object, ['turn_complete']) is not None:
|
|
2148
|
-
setv(to_object, ['turnComplete'], getv(from_object, ['turn_complete']))
|
|
2149
|
-
|
|
2150
|
-
return to_object
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
def _LiveClientRealtimeInput_to_vertex(
|
|
2154
|
-
from_object: Union[dict[str, Any], object],
|
|
2155
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2156
|
-
) -> dict[str, Any]:
|
|
2157
|
-
to_object: dict[str, Any] = {}
|
|
2158
|
-
if getv(from_object, ['media_chunks']) is not None:
|
|
2159
|
-
setv(to_object, ['mediaChunks'], getv(from_object, ['media_chunks']))
|
|
2160
|
-
|
|
2161
|
-
if getv(from_object, ['audio']) is not None:
|
|
2162
|
-
setv(to_object, ['audio'], getv(from_object, ['audio']))
|
|
2163
|
-
|
|
2164
|
-
if getv(from_object, ['audio_stream_end']) is not None:
|
|
2165
|
-
raise ValueError(
|
|
2166
|
-
'audio_stream_end parameter is not supported in Vertex AI.'
|
|
2167
|
-
)
|
|
2168
|
-
|
|
2169
|
-
if getv(from_object, ['video']) is not None:
|
|
2170
|
-
setv(to_object, ['video'], getv(from_object, ['video']))
|
|
2171
|
-
|
|
2172
|
-
if getv(from_object, ['text']) is not None:
|
|
2173
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
2174
|
-
|
|
2175
|
-
if getv(from_object, ['activity_start']) is not None:
|
|
2176
|
-
setv(
|
|
2177
|
-
to_object,
|
|
2178
|
-
['activityStart'],
|
|
2179
|
-
_ActivityStart_to_vertex(
|
|
2180
|
-
getv(from_object, ['activity_start']), to_object
|
|
2181
|
-
),
|
|
2182
|
-
)
|
|
2183
|
-
|
|
2184
|
-
if getv(from_object, ['activity_end']) is not None:
|
|
2185
|
-
setv(
|
|
2186
|
-
to_object,
|
|
2187
|
-
['activityEnd'],
|
|
2188
|
-
_ActivityEnd_to_vertex(getv(from_object, ['activity_end']), to_object),
|
|
2189
|
-
)
|
|
2190
|
-
|
|
2191
|
-
return to_object
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
def _FunctionResponse_to_vertex(
|
|
2195
|
-
from_object: Union[dict[str, Any], object],
|
|
2196
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2197
|
-
) -> dict[str, Any]:
|
|
2198
|
-
to_object: dict[str, Any] = {}
|
|
2199
|
-
if getv(from_object, ['will_continue']) is not None:
|
|
2200
|
-
raise ValueError('will_continue parameter is not supported in Vertex AI.')
|
|
2201
|
-
|
|
2202
|
-
if getv(from_object, ['scheduling']) is not None:
|
|
2203
|
-
raise ValueError('scheduling parameter is not supported in Vertex AI.')
|
|
2204
|
-
|
|
2205
|
-
if getv(from_object, ['id']) is not None:
|
|
2206
|
-
setv(to_object, ['id'], getv(from_object, ['id']))
|
|
2207
|
-
|
|
2208
|
-
if getv(from_object, ['name']) is not None:
|
|
2209
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
|
2210
|
-
|
|
2211
|
-
if getv(from_object, ['response']) is not None:
|
|
2212
|
-
setv(to_object, ['response'], getv(from_object, ['response']))
|
|
2213
|
-
|
|
2214
|
-
return to_object
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
def _LiveClientToolResponse_to_vertex(
|
|
2218
|
-
from_object: Union[dict[str, Any], object],
|
|
2219
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2220
|
-
) -> dict[str, Any]:
|
|
2221
|
-
to_object: dict[str, Any] = {}
|
|
2222
|
-
if getv(from_object, ['function_responses']) is not None:
|
|
2223
|
-
setv(
|
|
2224
|
-
to_object,
|
|
2225
|
-
['functionResponses'],
|
|
2226
|
-
[
|
|
2227
|
-
_FunctionResponse_to_vertex(item, to_object)
|
|
2228
|
-
for item in getv(from_object, ['function_responses'])
|
|
2229
|
-
],
|
|
2230
|
-
)
|
|
2231
|
-
|
|
2232
|
-
return to_object
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
def _LiveClientMessage_to_vertex(
|
|
2236
|
-
api_client: BaseApiClient,
|
|
2237
|
-
from_object: Union[dict[str, Any], object],
|
|
2238
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2239
|
-
) -> dict[str, Any]:
|
|
2240
|
-
to_object: dict[str, Any] = {}
|
|
2241
|
-
if getv(from_object, ['setup']) is not None:
|
|
2242
|
-
setv(
|
|
2243
|
-
to_object,
|
|
2244
|
-
['setup'],
|
|
2245
|
-
_LiveClientSetup_to_vertex(
|
|
2246
|
-
api_client, getv(from_object, ['setup']), to_object
|
|
2247
|
-
),
|
|
2248
|
-
)
|
|
2249
|
-
|
|
2250
|
-
if getv(from_object, ['client_content']) is not None:
|
|
2251
|
-
setv(
|
|
2252
|
-
to_object,
|
|
2253
|
-
['clientContent'],
|
|
2254
|
-
_LiveClientContent_to_vertex(
|
|
2255
|
-
getv(from_object, ['client_content']), to_object
|
|
2256
|
-
),
|
|
2257
|
-
)
|
|
2258
|
-
|
|
2259
|
-
if getv(from_object, ['realtime_input']) is not None:
|
|
2260
|
-
setv(
|
|
2261
|
-
to_object,
|
|
2262
|
-
['realtimeInput'],
|
|
2263
|
-
_LiveClientRealtimeInput_to_vertex(
|
|
2264
|
-
getv(from_object, ['realtime_input']), to_object
|
|
2265
|
-
),
|
|
2266
|
-
)
|
|
2267
|
-
|
|
2268
|
-
if getv(from_object, ['tool_response']) is not None:
|
|
2269
|
-
setv(
|
|
2270
|
-
to_object,
|
|
2271
|
-
['toolResponse'],
|
|
2272
|
-
_LiveClientToolResponse_to_vertex(
|
|
2273
|
-
getv(from_object, ['tool_response']), to_object
|
|
2274
|
-
),
|
|
2275
|
-
)
|
|
2276
|
-
|
|
2277
|
-
return to_object
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
def _LiveMusicConnectParameters_to_vertex(
|
|
2281
|
-
from_object: Union[dict[str, Any], object],
|
|
2282
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2283
|
-
) -> dict[str, Any]:
|
|
2284
|
-
to_object: dict[str, Any] = {}
|
|
2285
|
-
if getv(from_object, ['model']) is not None:
|
|
2286
|
-
raise ValueError('model parameter is not supported in Vertex AI.')
|
|
2287
|
-
|
|
2288
|
-
return to_object
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
def _LiveMusicSetWeightedPromptsParameters_to_vertex(
|
|
2292
|
-
from_object: Union[dict[str, Any], object],
|
|
2293
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2294
|
-
) -> dict[str, Any]:
|
|
2295
|
-
to_object: dict[str, Any] = {}
|
|
2296
|
-
if getv(from_object, ['weighted_prompts']) is not None:
|
|
2297
|
-
raise ValueError(
|
|
2298
|
-
'weighted_prompts parameter is not supported in Vertex AI.'
|
|
2299
|
-
)
|
|
2300
|
-
|
|
2301
|
-
return to_object
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
def _LiveMusicSetConfigParameters_to_vertex(
|
|
2305
|
-
from_object: Union[dict[str, Any], object],
|
|
2306
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2307
|
-
) -> dict[str, Any]:
|
|
2308
|
-
to_object: dict[str, Any] = {}
|
|
2309
|
-
if getv(from_object, ['music_generation_config']) is not None:
|
|
2310
|
-
raise ValueError(
|
|
2311
|
-
'music_generation_config parameter is not supported in Vertex AI.'
|
|
2312
|
-
)
|
|
2313
|
-
|
|
2314
|
-
return to_object
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
def _LiveMusicClientMessage_to_vertex(
|
|
2318
|
-
from_object: Union[dict[str, Any], object],
|
|
2319
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2320
|
-
) -> dict[str, Any]:
|
|
2321
|
-
to_object: dict[str, Any] = {}
|
|
2322
|
-
if getv(from_object, ['setup']) is not None:
|
|
2323
|
-
raise ValueError('setup parameter is not supported in Vertex AI.')
|
|
2324
|
-
|
|
2325
|
-
if getv(from_object, ['client_content']) is not None:
|
|
2326
|
-
raise ValueError('client_content parameter is not supported in Vertex AI.')
|
|
2327
|
-
|
|
2328
|
-
if getv(from_object, ['music_generation_config']) is not None:
|
|
2329
|
-
raise ValueError(
|
|
2330
|
-
'music_generation_config parameter is not supported in Vertex AI.'
|
|
2331
|
-
)
|
|
2332
|
-
|
|
2333
|
-
if getv(from_object, ['playback_control']) is not None:
|
|
2334
|
-
raise ValueError(
|
|
2335
|
-
'playback_control parameter is not supported in Vertex AI.'
|
|
2336
|
-
)
|
|
2337
|
-
|
|
2338
|
-
return to_object
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
def _LiveServerSetupComplete_from_mldev(
|
|
2342
|
-
from_object: Union[dict[str, Any], object],
|
|
2343
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2344
|
-
) -> dict[str, Any]:
|
|
2345
|
-
to_object: dict[str, Any] = {}
|
|
2346
|
-
|
|
2347
|
-
return to_object
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
def _VideoMetadata_from_mldev(
|
|
2351
|
-
from_object: Union[dict[str, Any], object],
|
|
2352
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2353
|
-
) -> dict[str, Any]:
|
|
2354
|
-
to_object: dict[str, Any] = {}
|
|
2355
|
-
if getv(from_object, ['fps']) is not None:
|
|
2356
|
-
setv(to_object, ['fps'], getv(from_object, ['fps']))
|
|
2357
|
-
|
|
2358
|
-
if getv(from_object, ['endOffset']) is not None:
|
|
2359
|
-
setv(to_object, ['end_offset'], getv(from_object, ['endOffset']))
|
|
2360
|
-
|
|
2361
|
-
if getv(from_object, ['startOffset']) is not None:
|
|
2362
|
-
setv(to_object, ['start_offset'], getv(from_object, ['startOffset']))
|
|
2363
|
-
|
|
2364
|
-
return to_object
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
def _Blob_from_mldev(
|
|
2368
|
-
from_object: Union[dict[str, Any], object],
|
|
2369
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2370
|
-
) -> dict[str, Any]:
|
|
2371
|
-
to_object: dict[str, Any] = {}
|
|
2372
|
-
|
|
2373
|
-
if getv(from_object, ['data']) is not None:
|
|
2374
|
-
setv(to_object, ['data'], getv(from_object, ['data']))
|
|
2375
|
-
|
|
2376
|
-
if getv(from_object, ['mimeType']) is not None:
|
|
2377
|
-
setv(to_object, ['mime_type'], getv(from_object, ['mimeType']))
|
|
2378
|
-
|
|
2379
|
-
return to_object
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
def _FileData_from_mldev(
|
|
2383
|
-
from_object: Union[dict[str, Any], object],
|
|
2384
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2385
|
-
) -> dict[str, Any]:
|
|
2386
|
-
to_object: dict[str, Any] = {}
|
|
2387
|
-
|
|
2388
|
-
if getv(from_object, ['fileUri']) is not None:
|
|
2389
|
-
setv(to_object, ['file_uri'], getv(from_object, ['fileUri']))
|
|
2390
|
-
|
|
2391
|
-
if getv(from_object, ['mimeType']) is not None:
|
|
2392
|
-
setv(to_object, ['mime_type'], getv(from_object, ['mimeType']))
|
|
2393
|
-
|
|
2394
|
-
return to_object
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
def _Part_from_mldev(
|
|
2398
|
-
from_object: Union[dict[str, Any], object],
|
|
2399
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2400
|
-
) -> dict[str, Any]:
|
|
2401
|
-
to_object: dict[str, Any] = {}
|
|
2402
|
-
if getv(from_object, ['videoMetadata']) is not None:
|
|
2403
|
-
setv(
|
|
2404
|
-
to_object,
|
|
2405
|
-
['video_metadata'],
|
|
2406
|
-
_VideoMetadata_from_mldev(
|
|
2407
|
-
getv(from_object, ['videoMetadata']), to_object
|
|
2408
|
-
),
|
|
2409
|
-
)
|
|
2410
|
-
|
|
2411
|
-
if getv(from_object, ['thought']) is not None:
|
|
2412
|
-
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
|
2413
|
-
|
|
2414
|
-
if getv(from_object, ['inlineData']) is not None:
|
|
2415
|
-
setv(
|
|
2416
|
-
to_object,
|
|
2417
|
-
['inline_data'],
|
|
2418
|
-
_Blob_from_mldev(getv(from_object, ['inlineData']), to_object),
|
|
2419
|
-
)
|
|
2420
|
-
|
|
2421
|
-
if getv(from_object, ['fileData']) is not None:
|
|
2422
|
-
setv(
|
|
2423
|
-
to_object,
|
|
2424
|
-
['file_data'],
|
|
2425
|
-
_FileData_from_mldev(getv(from_object, ['fileData']), to_object),
|
|
2426
|
-
)
|
|
2427
|
-
|
|
2428
|
-
if getv(from_object, ['thoughtSignature']) is not None:
|
|
2429
|
-
setv(
|
|
2430
|
-
to_object,
|
|
2431
|
-
['thought_signature'],
|
|
2432
|
-
getv(from_object, ['thoughtSignature']),
|
|
2433
|
-
)
|
|
2434
|
-
|
|
2435
|
-
if getv(from_object, ['codeExecutionResult']) is not None:
|
|
2436
|
-
setv(
|
|
2437
|
-
to_object,
|
|
2438
|
-
['code_execution_result'],
|
|
2439
|
-
getv(from_object, ['codeExecutionResult']),
|
|
2440
|
-
)
|
|
2441
|
-
|
|
2442
|
-
if getv(from_object, ['executableCode']) is not None:
|
|
2443
|
-
setv(to_object, ['executable_code'], getv(from_object, ['executableCode']))
|
|
2444
|
-
|
|
2445
|
-
if getv(from_object, ['functionCall']) is not None:
|
|
2446
|
-
setv(to_object, ['function_call'], getv(from_object, ['functionCall']))
|
|
2447
|
-
|
|
2448
|
-
if getv(from_object, ['functionResponse']) is not None:
|
|
2449
|
-
setv(
|
|
2450
|
-
to_object,
|
|
2451
|
-
['function_response'],
|
|
2452
|
-
getv(from_object, ['functionResponse']),
|
|
2453
|
-
)
|
|
2454
|
-
|
|
2455
|
-
if getv(from_object, ['text']) is not None:
|
|
2456
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
2457
|
-
|
|
2458
|
-
return to_object
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
def _Content_from_mldev(
|
|
2462
|
-
from_object: Union[dict[str, Any], object],
|
|
2463
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2464
|
-
) -> dict[str, Any]:
|
|
2465
|
-
to_object: dict[str, Any] = {}
|
|
2466
|
-
if getv(from_object, ['parts']) is not None:
|
|
2467
|
-
setv(
|
|
2468
|
-
to_object,
|
|
2469
|
-
['parts'],
|
|
2470
|
-
[
|
|
2471
|
-
_Part_from_mldev(item, to_object)
|
|
2472
|
-
for item in getv(from_object, ['parts'])
|
|
2473
|
-
],
|
|
2474
|
-
)
|
|
2475
|
-
|
|
2476
|
-
if getv(from_object, ['role']) is not None:
|
|
2477
|
-
setv(to_object, ['role'], getv(from_object, ['role']))
|
|
2478
|
-
|
|
2479
|
-
return to_object
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
def _Transcription_from_mldev(
|
|
2483
|
-
from_object: Union[dict[str, Any], object],
|
|
2484
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2485
|
-
) -> dict[str, Any]:
|
|
2486
|
-
to_object: dict[str, Any] = {}
|
|
2487
|
-
if getv(from_object, ['text']) is not None:
|
|
2488
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
2489
|
-
|
|
2490
|
-
if getv(from_object, ['finished']) is not None:
|
|
2491
|
-
setv(to_object, ['finished'], getv(from_object, ['finished']))
|
|
2492
|
-
|
|
2493
|
-
return to_object
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
def _UrlMetadata_from_mldev(
|
|
2497
|
-
from_object: Union[dict[str, Any], object],
|
|
2498
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2499
|
-
) -> dict[str, Any]:
|
|
2500
|
-
to_object: dict[str, Any] = {}
|
|
2501
|
-
if getv(from_object, ['retrievedUrl']) is not None:
|
|
2502
|
-
setv(to_object, ['retrieved_url'], getv(from_object, ['retrievedUrl']))
|
|
2503
|
-
|
|
2504
|
-
if getv(from_object, ['urlRetrievalStatus']) is not None:
|
|
2505
|
-
setv(
|
|
2506
|
-
to_object,
|
|
2507
|
-
['url_retrieval_status'],
|
|
2508
|
-
getv(from_object, ['urlRetrievalStatus']),
|
|
2509
|
-
)
|
|
2510
|
-
|
|
2511
|
-
return to_object
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
def _UrlContextMetadata_from_mldev(
|
|
2515
|
-
from_object: Union[dict[str, Any], object],
|
|
2516
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2517
|
-
) -> dict[str, Any]:
|
|
2518
|
-
to_object: dict[str, Any] = {}
|
|
2519
|
-
if getv(from_object, ['urlMetadata']) is not None:
|
|
2520
|
-
setv(
|
|
2521
|
-
to_object,
|
|
2522
|
-
['url_metadata'],
|
|
2523
|
-
[
|
|
2524
|
-
_UrlMetadata_from_mldev(item, to_object)
|
|
2525
|
-
for item in getv(from_object, ['urlMetadata'])
|
|
2526
|
-
],
|
|
2527
|
-
)
|
|
2528
|
-
|
|
2529
|
-
return to_object
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
def _LiveServerContent_from_mldev(
|
|
2533
|
-
from_object: Union[dict[str, Any], object],
|
|
2534
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2535
|
-
) -> dict[str, Any]:
|
|
2536
|
-
to_object: dict[str, Any] = {}
|
|
2537
|
-
if getv(from_object, ['modelTurn']) is not None:
|
|
2538
|
-
setv(
|
|
2539
|
-
to_object,
|
|
2540
|
-
['model_turn'],
|
|
2541
|
-
_Content_from_mldev(getv(from_object, ['modelTurn']), to_object),
|
|
2542
|
-
)
|
|
2543
|
-
|
|
2544
|
-
if getv(from_object, ['turnComplete']) is not None:
|
|
2545
|
-
setv(to_object, ['turn_complete'], getv(from_object, ['turnComplete']))
|
|
2546
|
-
|
|
2547
|
-
if getv(from_object, ['interrupted']) is not None:
|
|
2548
|
-
setv(to_object, ['interrupted'], getv(from_object, ['interrupted']))
|
|
2549
|
-
|
|
2550
|
-
if getv(from_object, ['groundingMetadata']) is not None:
|
|
2551
|
-
setv(
|
|
2552
|
-
to_object,
|
|
2553
|
-
['grounding_metadata'],
|
|
2554
|
-
getv(from_object, ['groundingMetadata']),
|
|
2555
|
-
)
|
|
2556
|
-
|
|
2557
|
-
if getv(from_object, ['generationComplete']) is not None:
|
|
2558
|
-
setv(
|
|
2559
|
-
to_object,
|
|
2560
|
-
['generation_complete'],
|
|
2561
|
-
getv(from_object, ['generationComplete']),
|
|
2562
|
-
)
|
|
2563
|
-
|
|
2564
|
-
if getv(from_object, ['inputTranscription']) is not None:
|
|
2565
|
-
setv(
|
|
2566
|
-
to_object,
|
|
2567
|
-
['input_transcription'],
|
|
2568
|
-
_Transcription_from_mldev(
|
|
2569
|
-
getv(from_object, ['inputTranscription']), to_object
|
|
2570
|
-
),
|
|
2571
|
-
)
|
|
2572
|
-
|
|
2573
|
-
if getv(from_object, ['outputTranscription']) is not None:
|
|
2574
|
-
setv(
|
|
2575
|
-
to_object,
|
|
2576
|
-
['output_transcription'],
|
|
2577
|
-
_Transcription_from_mldev(
|
|
2578
|
-
getv(from_object, ['outputTranscription']), to_object
|
|
2579
|
-
),
|
|
2580
|
-
)
|
|
2581
|
-
|
|
2582
|
-
if getv(from_object, ['urlContextMetadata']) is not None:
|
|
796
|
+
if getv(from_object, ['top_k']) is not None:
|
|
2583
797
|
setv(
|
|
2584
|
-
|
|
2585
|
-
['
|
|
2586
|
-
|
|
2587
|
-
getv(from_object, ['urlContextMetadata']), to_object
|
|
2588
|
-
),
|
|
798
|
+
parent_object,
|
|
799
|
+
['setup', 'generationConfig', 'topK'],
|
|
800
|
+
getv(from_object, ['top_k']),
|
|
2589
801
|
)
|
|
2590
802
|
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
def _FunctionCall_from_mldev(
|
|
2595
|
-
from_object: Union[dict[str, Any], object],
|
|
2596
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2597
|
-
) -> dict[str, Any]:
|
|
2598
|
-
to_object: dict[str, Any] = {}
|
|
2599
|
-
if getv(from_object, ['id']) is not None:
|
|
2600
|
-
setv(to_object, ['id'], getv(from_object, ['id']))
|
|
2601
|
-
|
|
2602
|
-
if getv(from_object, ['args']) is not None:
|
|
2603
|
-
setv(to_object, ['args'], getv(from_object, ['args']))
|
|
2604
|
-
|
|
2605
|
-
if getv(from_object, ['name']) is not None:
|
|
2606
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
|
2607
|
-
|
|
2608
|
-
return to_object
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
def _LiveServerToolCall_from_mldev(
|
|
2612
|
-
from_object: Union[dict[str, Any], object],
|
|
2613
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2614
|
-
) -> dict[str, Any]:
|
|
2615
|
-
to_object: dict[str, Any] = {}
|
|
2616
|
-
if getv(from_object, ['functionCalls']) is not None:
|
|
803
|
+
if getv(from_object, ['max_output_tokens']) is not None:
|
|
2617
804
|
setv(
|
|
2618
|
-
|
|
2619
|
-
['
|
|
2620
|
-
[
|
|
2621
|
-
_FunctionCall_from_mldev(item, to_object)
|
|
2622
|
-
for item in getv(from_object, ['functionCalls'])
|
|
2623
|
-
],
|
|
805
|
+
parent_object,
|
|
806
|
+
['setup', 'generationConfig', 'maxOutputTokens'],
|
|
807
|
+
getv(from_object, ['max_output_tokens']),
|
|
2624
808
|
)
|
|
2625
809
|
|
|
2626
|
-
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
def _LiveServerToolCallCancellation_from_mldev(
|
|
2630
|
-
from_object: Union[dict[str, Any], object],
|
|
2631
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2632
|
-
) -> dict[str, Any]:
|
|
2633
|
-
to_object: dict[str, Any] = {}
|
|
2634
|
-
if getv(from_object, ['ids']) is not None:
|
|
2635
|
-
setv(to_object, ['ids'], getv(from_object, ['ids']))
|
|
2636
|
-
|
|
2637
|
-
return to_object
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
def _ModalityTokenCount_from_mldev(
|
|
2641
|
-
from_object: Union[dict[str, Any], object],
|
|
2642
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2643
|
-
) -> dict[str, Any]:
|
|
2644
|
-
to_object: dict[str, Any] = {}
|
|
2645
|
-
if getv(from_object, ['modality']) is not None:
|
|
2646
|
-
setv(to_object, ['modality'], getv(from_object, ['modality']))
|
|
2647
|
-
|
|
2648
|
-
if getv(from_object, ['tokenCount']) is not None:
|
|
2649
|
-
setv(to_object, ['token_count'], getv(from_object, ['tokenCount']))
|
|
2650
|
-
|
|
2651
|
-
return to_object
|
|
2652
|
-
|
|
2653
|
-
|
|
2654
|
-
def _UsageMetadata_from_mldev(
|
|
2655
|
-
from_object: Union[dict[str, Any], object],
|
|
2656
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2657
|
-
) -> dict[str, Any]:
|
|
2658
|
-
to_object: dict[str, Any] = {}
|
|
2659
|
-
if getv(from_object, ['promptTokenCount']) is not None:
|
|
810
|
+
if getv(from_object, ['media_resolution']) is not None:
|
|
2660
811
|
setv(
|
|
2661
|
-
|
|
2662
|
-
['
|
|
2663
|
-
getv(from_object, ['
|
|
812
|
+
parent_object,
|
|
813
|
+
['setup', 'generationConfig', 'mediaResolution'],
|
|
814
|
+
getv(from_object, ['media_resolution']),
|
|
2664
815
|
)
|
|
2665
816
|
|
|
2666
|
-
if getv(from_object, ['
|
|
817
|
+
if getv(from_object, ['seed']) is not None:
|
|
2667
818
|
setv(
|
|
2668
|
-
|
|
2669
|
-
['
|
|
2670
|
-
getv(from_object, ['
|
|
819
|
+
parent_object,
|
|
820
|
+
['setup', 'generationConfig', 'seed'],
|
|
821
|
+
getv(from_object, ['seed']),
|
|
2671
822
|
)
|
|
2672
823
|
|
|
2673
|
-
if getv(from_object, ['
|
|
824
|
+
if getv(from_object, ['speech_config']) is not None:
|
|
2674
825
|
setv(
|
|
2675
|
-
|
|
2676
|
-
['
|
|
2677
|
-
|
|
826
|
+
parent_object,
|
|
827
|
+
['setup', 'generationConfig', 'speechConfig'],
|
|
828
|
+
_SpeechConfig_to_vertex(
|
|
829
|
+
t.t_live_speech_config(getv(from_object, ['speech_config'])),
|
|
830
|
+
to_object,
|
|
831
|
+
),
|
|
2678
832
|
)
|
|
2679
833
|
|
|
2680
|
-
if getv(from_object, ['
|
|
834
|
+
if getv(from_object, ['thinking_config']) is not None:
|
|
2681
835
|
setv(
|
|
2682
|
-
|
|
2683
|
-
['
|
|
2684
|
-
getv(from_object, ['
|
|
836
|
+
parent_object,
|
|
837
|
+
['setup', 'generationConfig', 'thinkingConfig'],
|
|
838
|
+
getv(from_object, ['thinking_config']),
|
|
2685
839
|
)
|
|
2686
840
|
|
|
2687
|
-
if getv(from_object, ['
|
|
841
|
+
if getv(from_object, ['enable_affective_dialog']) is not None:
|
|
2688
842
|
setv(
|
|
2689
|
-
|
|
2690
|
-
['
|
|
2691
|
-
getv(from_object, ['
|
|
843
|
+
parent_object,
|
|
844
|
+
['setup', 'generationConfig', 'enableAffectiveDialog'],
|
|
845
|
+
getv(from_object, ['enable_affective_dialog']),
|
|
2692
846
|
)
|
|
2693
847
|
|
|
2694
|
-
if getv(from_object, ['
|
|
848
|
+
if getv(from_object, ['system_instruction']) is not None:
|
|
2695
849
|
setv(
|
|
2696
|
-
|
|
850
|
+
parent_object,
|
|
851
|
+
['setup', 'systemInstruction'],
|
|
852
|
+
t.t_content(getv(from_object, ['system_instruction'])),
|
|
2697
853
|
)
|
|
2698
854
|
|
|
2699
|
-
if getv(from_object, ['
|
|
855
|
+
if getv(from_object, ['tools']) is not None:
|
|
2700
856
|
setv(
|
|
2701
|
-
|
|
2702
|
-
['
|
|
857
|
+
parent_object,
|
|
858
|
+
['setup', 'tools'],
|
|
2703
859
|
[
|
|
2704
|
-
|
|
2705
|
-
for item in getv(from_object, ['
|
|
860
|
+
_Tool_to_vertex(t.t_tool(api_client, item), to_object)
|
|
861
|
+
for item in t.t_tools(api_client, getv(from_object, ['tools']))
|
|
2706
862
|
],
|
|
2707
863
|
)
|
|
2708
864
|
|
|
2709
|
-
if getv(from_object, ['
|
|
865
|
+
if getv(from_object, ['session_resumption']) is not None:
|
|
2710
866
|
setv(
|
|
2711
|
-
|
|
2712
|
-
['
|
|
2713
|
-
[
|
|
2714
|
-
_ModalityTokenCount_from_mldev(item, to_object)
|
|
2715
|
-
for item in getv(from_object, ['cacheTokensDetails'])
|
|
2716
|
-
],
|
|
867
|
+
parent_object,
|
|
868
|
+
['setup', 'sessionResumption'],
|
|
869
|
+
getv(from_object, ['session_resumption']),
|
|
2717
870
|
)
|
|
2718
871
|
|
|
2719
|
-
if getv(from_object, ['
|
|
872
|
+
if getv(from_object, ['input_audio_transcription']) is not None:
|
|
2720
873
|
setv(
|
|
2721
|
-
|
|
2722
|
-
['
|
|
2723
|
-
[
|
|
2724
|
-
_ModalityTokenCount_from_mldev(item, to_object)
|
|
2725
|
-
for item in getv(from_object, ['responseTokensDetails'])
|
|
2726
|
-
],
|
|
874
|
+
parent_object,
|
|
875
|
+
['setup', 'inputAudioTranscription'],
|
|
876
|
+
getv(from_object, ['input_audio_transcription']),
|
|
2727
877
|
)
|
|
2728
878
|
|
|
2729
|
-
if getv(from_object, ['
|
|
879
|
+
if getv(from_object, ['output_audio_transcription']) is not None:
|
|
2730
880
|
setv(
|
|
2731
|
-
|
|
2732
|
-
['
|
|
2733
|
-
[
|
|
2734
|
-
_ModalityTokenCount_from_mldev(item, to_object)
|
|
2735
|
-
for item in getv(from_object, ['toolUsePromptTokensDetails'])
|
|
2736
|
-
],
|
|
881
|
+
parent_object,
|
|
882
|
+
['setup', 'outputAudioTranscription'],
|
|
883
|
+
getv(from_object, ['output_audio_transcription']),
|
|
2737
884
|
)
|
|
2738
885
|
|
|
2739
|
-
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
) -> dict[str, Any]:
|
|
2746
|
-
to_object: dict[str, Any] = {}
|
|
2747
|
-
if getv(from_object, ['timeLeft']) is not None:
|
|
2748
|
-
setv(to_object, ['time_left'], getv(from_object, ['timeLeft']))
|
|
2749
|
-
|
|
2750
|
-
return to_object
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
def _LiveServerSessionResumptionUpdate_from_mldev(
|
|
2754
|
-
from_object: Union[dict[str, Any], object],
|
|
2755
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
2756
|
-
) -> dict[str, Any]:
|
|
2757
|
-
to_object: dict[str, Any] = {}
|
|
2758
|
-
if getv(from_object, ['newHandle']) is not None:
|
|
2759
|
-
setv(to_object, ['new_handle'], getv(from_object, ['newHandle']))
|
|
886
|
+
if getv(from_object, ['realtime_input_config']) is not None:
|
|
887
|
+
setv(
|
|
888
|
+
parent_object,
|
|
889
|
+
['setup', 'realtimeInputConfig'],
|
|
890
|
+
getv(from_object, ['realtime_input_config']),
|
|
891
|
+
)
|
|
2760
892
|
|
|
2761
|
-
if getv(from_object, ['
|
|
2762
|
-
setv(
|
|
893
|
+
if getv(from_object, ['context_window_compression']) is not None:
|
|
894
|
+
setv(
|
|
895
|
+
parent_object,
|
|
896
|
+
['setup', 'contextWindowCompression'],
|
|
897
|
+
getv(from_object, ['context_window_compression']),
|
|
898
|
+
)
|
|
2763
899
|
|
|
2764
|
-
if getv(from_object, ['
|
|
900
|
+
if getv(from_object, ['proactivity']) is not None:
|
|
2765
901
|
setv(
|
|
2766
|
-
|
|
2767
|
-
['
|
|
2768
|
-
getv(from_object, ['
|
|
902
|
+
parent_object,
|
|
903
|
+
['setup', 'proactivity'],
|
|
904
|
+
getv(from_object, ['proactivity']),
|
|
2769
905
|
)
|
|
2770
906
|
|
|
2771
907
|
return to_object
|
|
2772
908
|
|
|
2773
909
|
|
|
2774
|
-
def
|
|
910
|
+
def _LiveConnectParameters_to_mldev(
|
|
911
|
+
api_client: BaseApiClient,
|
|
2775
912
|
from_object: Union[dict[str, Any], object],
|
|
2776
913
|
parent_object: Optional[dict[str, Any]] = None,
|
|
2777
914
|
) -> dict[str, Any]:
|
|
2778
915
|
to_object: dict[str, Any] = {}
|
|
2779
|
-
if getv(from_object, ['
|
|
2780
|
-
setv(
|
|
2781
|
-
to_object,
|
|
2782
|
-
['setup_complete'],
|
|
2783
|
-
_LiveServerSetupComplete_from_mldev(
|
|
2784
|
-
getv(from_object, ['setupComplete']), to_object
|
|
2785
|
-
),
|
|
2786
|
-
)
|
|
2787
|
-
|
|
2788
|
-
if getv(from_object, ['serverContent']) is not None:
|
|
916
|
+
if getv(from_object, ['model']) is not None:
|
|
2789
917
|
setv(
|
|
2790
918
|
to_object,
|
|
2791
|
-
['
|
|
2792
|
-
|
|
2793
|
-
getv(from_object, ['serverContent']), to_object
|
|
2794
|
-
),
|
|
919
|
+
['setup', 'model'],
|
|
920
|
+
t.t_model(api_client, getv(from_object, ['model'])),
|
|
2795
921
|
)
|
|
2796
922
|
|
|
2797
|
-
if getv(from_object, ['
|
|
923
|
+
if getv(from_object, ['config']) is not None:
|
|
2798
924
|
setv(
|
|
2799
925
|
to_object,
|
|
2800
|
-
['
|
|
2801
|
-
|
|
2802
|
-
getv(from_object, ['
|
|
926
|
+
['config'],
|
|
927
|
+
_LiveConnectConfig_to_mldev(
|
|
928
|
+
api_client, getv(from_object, ['config']), to_object
|
|
2803
929
|
),
|
|
2804
930
|
)
|
|
2805
931
|
|
|
2806
|
-
|
|
2807
|
-
setv(
|
|
2808
|
-
to_object,
|
|
2809
|
-
['tool_call_cancellation'],
|
|
2810
|
-
_LiveServerToolCallCancellation_from_mldev(
|
|
2811
|
-
getv(from_object, ['toolCallCancellation']), to_object
|
|
2812
|
-
),
|
|
2813
|
-
)
|
|
932
|
+
return to_object
|
|
2814
933
|
|
|
2815
|
-
if getv(from_object, ['usageMetadata']) is not None:
|
|
2816
|
-
setv(
|
|
2817
|
-
to_object,
|
|
2818
|
-
['usage_metadata'],
|
|
2819
|
-
_UsageMetadata_from_mldev(
|
|
2820
|
-
getv(from_object, ['usageMetadata']), to_object
|
|
2821
|
-
),
|
|
2822
|
-
)
|
|
2823
934
|
|
|
2824
|
-
|
|
935
|
+
def _LiveConnectParameters_to_vertex(
|
|
936
|
+
api_client: BaseApiClient,
|
|
937
|
+
from_object: Union[dict[str, Any], object],
|
|
938
|
+
parent_object: Optional[dict[str, Any]] = None,
|
|
939
|
+
) -> dict[str, Any]:
|
|
940
|
+
to_object: dict[str, Any] = {}
|
|
941
|
+
if getv(from_object, ['model']) is not None:
|
|
2825
942
|
setv(
|
|
2826
943
|
to_object,
|
|
2827
|
-
['
|
|
2828
|
-
|
|
944
|
+
['setup', 'model'],
|
|
945
|
+
t.t_model(api_client, getv(from_object, ['model'])),
|
|
2829
946
|
)
|
|
2830
947
|
|
|
2831
|
-
if getv(from_object, ['
|
|
948
|
+
if getv(from_object, ['config']) is not None:
|
|
2832
949
|
setv(
|
|
2833
950
|
to_object,
|
|
2834
|
-
['
|
|
2835
|
-
|
|
2836
|
-
getv(from_object, ['
|
|
951
|
+
['config'],
|
|
952
|
+
_LiveConnectConfig_to_vertex(
|
|
953
|
+
api_client, getv(from_object, ['config']), to_object
|
|
2837
954
|
),
|
|
2838
955
|
)
|
|
2839
956
|
|
|
2840
957
|
return to_object
|
|
2841
958
|
|
|
2842
959
|
|
|
2843
|
-
def
|
|
960
|
+
def _LiveMusicClientMessage_to_vertex(
|
|
2844
961
|
from_object: Union[dict[str, Any], object],
|
|
2845
962
|
parent_object: Optional[dict[str, Any]] = None,
|
|
2846
963
|
) -> dict[str, Any]:
|
|
2847
964
|
to_object: dict[str, Any] = {}
|
|
965
|
+
if getv(from_object, ['setup']) is not None:
|
|
966
|
+
raise ValueError('setup parameter is not supported in Vertex AI.')
|
|
2848
967
|
|
|
2849
|
-
|
|
2850
|
-
|
|
968
|
+
if getv(from_object, ['client_content']) is not None:
|
|
969
|
+
raise ValueError('client_content parameter is not supported in Vertex AI.')
|
|
2851
970
|
|
|
2852
|
-
|
|
2853
|
-
|
|
2854
|
-
|
|
2855
|
-
)
|
|
2856
|
-
to_object: dict[str, Any] = {}
|
|
2857
|
-
if getv(from_object, ['text']) is not None:
|
|
2858
|
-
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
971
|
+
if getv(from_object, ['music_generation_config']) is not None:
|
|
972
|
+
raise ValueError(
|
|
973
|
+
'music_generation_config parameter is not supported in Vertex AI.'
|
|
974
|
+
)
|
|
2859
975
|
|
|
2860
|
-
if getv(from_object, ['
|
|
2861
|
-
|
|
976
|
+
if getv(from_object, ['playback_control']) is not None:
|
|
977
|
+
raise ValueError(
|
|
978
|
+
'playback_control parameter is not supported in Vertex AI.'
|
|
979
|
+
)
|
|
2862
980
|
|
|
2863
981
|
return to_object
|
|
2864
982
|
|
|
2865
983
|
|
|
2866
|
-
def
|
|
984
|
+
def _LiveMusicConnectParameters_to_mldev(
|
|
2867
985
|
from_object: Union[dict[str, Any], object],
|
|
2868
986
|
parent_object: Optional[dict[str, Any]] = None,
|
|
2869
987
|
) -> dict[str, Any]:
|
|
2870
988
|
to_object: dict[str, Any] = {}
|
|
2871
|
-
if getv(from_object, ['
|
|
2872
|
-
setv(
|
|
2873
|
-
to_object,
|
|
2874
|
-
['weighted_prompts'],
|
|
2875
|
-
[
|
|
2876
|
-
_WeightedPrompt_from_mldev(item, to_object)
|
|
2877
|
-
for item in getv(from_object, ['weightedPrompts'])
|
|
2878
|
-
],
|
|
2879
|
-
)
|
|
989
|
+
if getv(from_object, ['model']) is not None:
|
|
990
|
+
setv(to_object, ['setup', 'model'], getv(from_object, ['model']))
|
|
2880
991
|
|
|
2881
992
|
return to_object
|
|
2882
993
|
|
|
2883
994
|
|
|
2884
|
-
def
|
|
995
|
+
def _LiveMusicConnectParameters_to_vertex(
|
|
2885
996
|
from_object: Union[dict[str, Any], object],
|
|
2886
997
|
parent_object: Optional[dict[str, Any]] = None,
|
|
2887
998
|
) -> dict[str, Any]:
|
|
2888
999
|
to_object: dict[str, Any] = {}
|
|
2889
|
-
if getv(from_object, ['
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
if getv(from_object, ['topK']) is not None:
|
|
2893
|
-
setv(to_object, ['top_k'], getv(from_object, ['topK']))
|
|
2894
|
-
|
|
2895
|
-
if getv(from_object, ['seed']) is not None:
|
|
2896
|
-
setv(to_object, ['seed'], getv(from_object, ['seed']))
|
|
2897
|
-
|
|
2898
|
-
if getv(from_object, ['guidance']) is not None:
|
|
2899
|
-
setv(to_object, ['guidance'], getv(from_object, ['guidance']))
|
|
2900
|
-
|
|
2901
|
-
if getv(from_object, ['bpm']) is not None:
|
|
2902
|
-
setv(to_object, ['bpm'], getv(from_object, ['bpm']))
|
|
2903
|
-
|
|
2904
|
-
if getv(from_object, ['density']) is not None:
|
|
2905
|
-
setv(to_object, ['density'], getv(from_object, ['density']))
|
|
2906
|
-
|
|
2907
|
-
if getv(from_object, ['brightness']) is not None:
|
|
2908
|
-
setv(to_object, ['brightness'], getv(from_object, ['brightness']))
|
|
2909
|
-
|
|
2910
|
-
if getv(from_object, ['scale']) is not None:
|
|
2911
|
-
setv(to_object, ['scale'], getv(from_object, ['scale']))
|
|
2912
|
-
|
|
2913
|
-
if getv(from_object, ['muteBass']) is not None:
|
|
2914
|
-
setv(to_object, ['mute_bass'], getv(from_object, ['muteBass']))
|
|
2915
|
-
|
|
2916
|
-
if getv(from_object, ['muteDrums']) is not None:
|
|
2917
|
-
setv(to_object, ['mute_drums'], getv(from_object, ['muteDrums']))
|
|
2918
|
-
|
|
2919
|
-
if getv(from_object, ['onlyBassAndDrums']) is not None:
|
|
2920
|
-
setv(
|
|
2921
|
-
to_object,
|
|
2922
|
-
['only_bass_and_drums'],
|
|
2923
|
-
getv(from_object, ['onlyBassAndDrums']),
|
|
2924
|
-
)
|
|
2925
|
-
|
|
2926
|
-
if getv(from_object, ['musicGenerationMode']) is not None:
|
|
2927
|
-
setv(
|
|
2928
|
-
to_object,
|
|
2929
|
-
['music_generation_mode'],
|
|
2930
|
-
getv(from_object, ['musicGenerationMode']),
|
|
2931
|
-
)
|
|
1000
|
+
if getv(from_object, ['model']) is not None:
|
|
1001
|
+
raise ValueError('model parameter is not supported in Vertex AI.')
|
|
2932
1002
|
|
|
2933
1003
|
return to_object
|
|
2934
1004
|
|
|
2935
1005
|
|
|
2936
|
-
def
|
|
1006
|
+
def _LiveMusicSetConfigParameters_to_mldev(
|
|
2937
1007
|
from_object: Union[dict[str, Any], object],
|
|
2938
1008
|
parent_object: Optional[dict[str, Any]] = None,
|
|
2939
1009
|
) -> dict[str, Any]:
|
|
2940
1010
|
to_object: dict[str, Any] = {}
|
|
2941
|
-
if getv(from_object, ['
|
|
2942
|
-
setv(
|
|
2943
|
-
to_object,
|
|
2944
|
-
['client_content'],
|
|
2945
|
-
_LiveMusicClientContent_from_mldev(
|
|
2946
|
-
getv(from_object, ['clientContent']), to_object
|
|
2947
|
-
),
|
|
2948
|
-
)
|
|
2949
|
-
|
|
2950
|
-
if getv(from_object, ['musicGenerationConfig']) is not None:
|
|
1011
|
+
if getv(from_object, ['music_generation_config']) is not None:
|
|
2951
1012
|
setv(
|
|
2952
1013
|
to_object,
|
|
2953
|
-
['
|
|
2954
|
-
|
|
2955
|
-
getv(from_object, ['musicGenerationConfig']), to_object
|
|
2956
|
-
),
|
|
1014
|
+
['musicGenerationConfig'],
|
|
1015
|
+
getv(from_object, ['music_generation_config']),
|
|
2957
1016
|
)
|
|
2958
1017
|
|
|
2959
1018
|
return to_object
|
|
2960
1019
|
|
|
2961
1020
|
|
|
2962
|
-
def
|
|
1021
|
+
def _LiveMusicSetConfigParameters_to_vertex(
|
|
2963
1022
|
from_object: Union[dict[str, Any], object],
|
|
2964
1023
|
parent_object: Optional[dict[str, Any]] = None,
|
|
2965
1024
|
) -> dict[str, Any]:
|
|
2966
1025
|
to_object: dict[str, Any] = {}
|
|
2967
|
-
if getv(from_object, ['
|
|
2968
|
-
|
|
2969
|
-
|
|
2970
|
-
if getv(from_object, ['mimeType']) is not None:
|
|
2971
|
-
setv(to_object, ['mime_type'], getv(from_object, ['mimeType']))
|
|
2972
|
-
|
|
2973
|
-
if getv(from_object, ['sourceMetadata']) is not None:
|
|
2974
|
-
setv(
|
|
2975
|
-
to_object,
|
|
2976
|
-
['source_metadata'],
|
|
2977
|
-
_LiveMusicSourceMetadata_from_mldev(
|
|
2978
|
-
getv(from_object, ['sourceMetadata']), to_object
|
|
2979
|
-
),
|
|
1026
|
+
if getv(from_object, ['music_generation_config']) is not None:
|
|
1027
|
+
raise ValueError(
|
|
1028
|
+
'music_generation_config parameter is not supported in Vertex AI.'
|
|
2980
1029
|
)
|
|
2981
1030
|
|
|
2982
1031
|
return to_object
|
|
2983
1032
|
|
|
2984
1033
|
|
|
2985
|
-
def
|
|
1034
|
+
def _LiveMusicSetWeightedPromptsParameters_to_mldev(
|
|
2986
1035
|
from_object: Union[dict[str, Any], object],
|
|
2987
1036
|
parent_object: Optional[dict[str, Any]] = None,
|
|
2988
1037
|
) -> dict[str, Any]:
|
|
2989
1038
|
to_object: dict[str, Any] = {}
|
|
2990
|
-
if getv(from_object, ['
|
|
1039
|
+
if getv(from_object, ['weighted_prompts']) is not None:
|
|
2991
1040
|
setv(
|
|
2992
1041
|
to_object,
|
|
2993
|
-
['
|
|
2994
|
-
[
|
|
2995
|
-
_AudioChunk_from_mldev(item, to_object)
|
|
2996
|
-
for item in getv(from_object, ['audioChunks'])
|
|
2997
|
-
],
|
|
1042
|
+
['weightedPrompts'],
|
|
1043
|
+
[item for item in getv(from_object, ['weighted_prompts'])],
|
|
2998
1044
|
)
|
|
2999
1045
|
|
|
3000
1046
|
return to_object
|
|
3001
1047
|
|
|
3002
1048
|
|
|
3003
|
-
def
|
|
1049
|
+
def _LiveMusicSetWeightedPromptsParameters_to_vertex(
|
|
3004
1050
|
from_object: Union[dict[str, Any], object],
|
|
3005
1051
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3006
1052
|
) -> dict[str, Any]:
|
|
3007
1053
|
to_object: dict[str, Any] = {}
|
|
3008
|
-
if getv(from_object, ['
|
|
3009
|
-
|
|
3010
|
-
|
|
3011
|
-
|
|
3012
|
-
setv(to_object, ['filtered_reason'], getv(from_object, ['filteredReason']))
|
|
1054
|
+
if getv(from_object, ['weighted_prompts']) is not None:
|
|
1055
|
+
raise ValueError(
|
|
1056
|
+
'weighted_prompts parameter is not supported in Vertex AI.'
|
|
1057
|
+
)
|
|
3013
1058
|
|
|
3014
1059
|
return to_object
|
|
3015
1060
|
|
|
3016
1061
|
|
|
3017
|
-
def
|
|
1062
|
+
def _LiveSendRealtimeInputParameters_to_mldev(
|
|
3018
1063
|
from_object: Union[dict[str, Any], object],
|
|
3019
1064
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3020
1065
|
) -> dict[str, Any]:
|
|
3021
1066
|
to_object: dict[str, Any] = {}
|
|
3022
|
-
if getv(from_object, ['
|
|
1067
|
+
if getv(from_object, ['media']) is not None:
|
|
3023
1068
|
setv(
|
|
3024
1069
|
to_object,
|
|
3025
|
-
['
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
1070
|
+
['mediaChunks'],
|
|
1071
|
+
[
|
|
1072
|
+
_Blob_to_mldev(item, to_object)
|
|
1073
|
+
for item in t.t_blobs(getv(from_object, ['media']))
|
|
1074
|
+
],
|
|
3029
1075
|
)
|
|
3030
1076
|
|
|
3031
|
-
if getv(from_object, ['
|
|
1077
|
+
if getv(from_object, ['audio']) is not None:
|
|
3032
1078
|
setv(
|
|
3033
1079
|
to_object,
|
|
3034
|
-
['
|
|
3035
|
-
|
|
3036
|
-
getv(from_object, ['serverContent']), to_object
|
|
3037
|
-
),
|
|
1080
|
+
['audio'],
|
|
1081
|
+
_Blob_to_mldev(t.t_audio_blob(getv(from_object, ['audio'])), to_object),
|
|
3038
1082
|
)
|
|
3039
1083
|
|
|
3040
|
-
if getv(from_object, ['
|
|
1084
|
+
if getv(from_object, ['audio_stream_end']) is not None:
|
|
1085
|
+
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
|
1086
|
+
|
|
1087
|
+
if getv(from_object, ['video']) is not None:
|
|
3041
1088
|
setv(
|
|
3042
1089
|
to_object,
|
|
3043
|
-
['
|
|
3044
|
-
|
|
3045
|
-
getv(from_object, ['filteredPrompt']), to_object
|
|
3046
|
-
),
|
|
1090
|
+
['video'],
|
|
1091
|
+
_Blob_to_mldev(t.t_image_blob(getv(from_object, ['video'])), to_object),
|
|
3047
1092
|
)
|
|
3048
1093
|
|
|
3049
|
-
|
|
1094
|
+
if getv(from_object, ['text']) is not None:
|
|
1095
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
3050
1096
|
|
|
1097
|
+
if getv(from_object, ['activity_start']) is not None:
|
|
1098
|
+
setv(to_object, ['activityStart'], getv(from_object, ['activity_start']))
|
|
3051
1099
|
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
3055
|
-
) -> dict[str, Any]:
|
|
3056
|
-
to_object: dict[str, Any] = {}
|
|
3057
|
-
if getv(from_object, ['sessionId']) is not None:
|
|
3058
|
-
setv(to_object, ['session_id'], getv(from_object, ['sessionId']))
|
|
1100
|
+
if getv(from_object, ['activity_end']) is not None:
|
|
1101
|
+
setv(to_object, ['activityEnd'], getv(from_object, ['activity_end']))
|
|
3059
1102
|
|
|
3060
1103
|
return to_object
|
|
3061
1104
|
|
|
3062
1105
|
|
|
3063
|
-
def
|
|
1106
|
+
def _LiveSendRealtimeInputParameters_to_vertex(
|
|
3064
1107
|
from_object: Union[dict[str, Any], object],
|
|
3065
1108
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3066
1109
|
) -> dict[str, Any]:
|
|
3067
1110
|
to_object: dict[str, Any] = {}
|
|
3068
|
-
if getv(from_object, ['
|
|
3069
|
-
setv(
|
|
1111
|
+
if getv(from_object, ['media']) is not None:
|
|
1112
|
+
setv(
|
|
1113
|
+
to_object,
|
|
1114
|
+
['mediaChunks'],
|
|
1115
|
+
[item for item in t.t_blobs(getv(from_object, ['media']))],
|
|
1116
|
+
)
|
|
1117
|
+
|
|
1118
|
+
if getv(from_object, ['audio']) is not None:
|
|
1119
|
+
setv(to_object, ['audio'], t.t_audio_blob(getv(from_object, ['audio'])))
|
|
1120
|
+
|
|
1121
|
+
if getv(from_object, ['audio_stream_end']) is not None:
|
|
1122
|
+
setv(to_object, ['audioStreamEnd'], getv(from_object, ['audio_stream_end']))
|
|
3070
1123
|
|
|
3071
|
-
if getv(from_object, ['
|
|
3072
|
-
setv(to_object, ['
|
|
1124
|
+
if getv(from_object, ['video']) is not None:
|
|
1125
|
+
setv(to_object, ['video'], t.t_image_blob(getv(from_object, ['video'])))
|
|
1126
|
+
|
|
1127
|
+
if getv(from_object, ['text']) is not None:
|
|
1128
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
1129
|
+
|
|
1130
|
+
if getv(from_object, ['activity_start']) is not None:
|
|
1131
|
+
setv(to_object, ['activityStart'], getv(from_object, ['activity_start']))
|
|
3073
1132
|
|
|
3074
|
-
if getv(from_object, ['
|
|
3075
|
-
setv(to_object, ['
|
|
1133
|
+
if getv(from_object, ['activity_end']) is not None:
|
|
1134
|
+
setv(to_object, ['activityEnd'], getv(from_object, ['activity_end']))
|
|
3076
1135
|
|
|
3077
1136
|
return to_object
|
|
3078
1137
|
|
|
3079
1138
|
|
|
3080
|
-
def
|
|
1139
|
+
def _LiveServerMessage_from_vertex(
|
|
3081
1140
|
from_object: Union[dict[str, Any], object],
|
|
3082
1141
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3083
1142
|
) -> dict[str, Any]:
|
|
3084
1143
|
to_object: dict[str, Any] = {}
|
|
3085
|
-
if getv(from_object, ['
|
|
3086
|
-
setv(to_object, ['
|
|
3087
|
-
|
|
3088
|
-
if getv(from_object, ['data']) is not None:
|
|
3089
|
-
setv(to_object, ['data'], getv(from_object, ['data']))
|
|
1144
|
+
if getv(from_object, ['setupComplete']) is not None:
|
|
1145
|
+
setv(to_object, ['setup_complete'], getv(from_object, ['setupComplete']))
|
|
3090
1146
|
|
|
3091
|
-
if getv(from_object, ['
|
|
3092
|
-
setv(to_object, ['
|
|
1147
|
+
if getv(from_object, ['serverContent']) is not None:
|
|
1148
|
+
setv(to_object, ['server_content'], getv(from_object, ['serverContent']))
|
|
3093
1149
|
|
|
3094
|
-
|
|
1150
|
+
if getv(from_object, ['toolCall']) is not None:
|
|
1151
|
+
setv(to_object, ['tool_call'], getv(from_object, ['toolCall']))
|
|
3095
1152
|
|
|
1153
|
+
if getv(from_object, ['toolCallCancellation']) is not None:
|
|
1154
|
+
setv(
|
|
1155
|
+
to_object,
|
|
1156
|
+
['tool_call_cancellation'],
|
|
1157
|
+
getv(from_object, ['toolCallCancellation']),
|
|
1158
|
+
)
|
|
3096
1159
|
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
1160
|
+
if getv(from_object, ['usageMetadata']) is not None:
|
|
1161
|
+
setv(
|
|
1162
|
+
to_object,
|
|
1163
|
+
['usage_metadata'],
|
|
1164
|
+
_UsageMetadata_from_vertex(
|
|
1165
|
+
getv(from_object, ['usageMetadata']), to_object
|
|
1166
|
+
),
|
|
1167
|
+
)
|
|
3104
1168
|
|
|
3105
|
-
if getv(from_object, ['
|
|
3106
|
-
setv(to_object, ['
|
|
1169
|
+
if getv(from_object, ['goAway']) is not None:
|
|
1170
|
+
setv(to_object, ['go_away'], getv(from_object, ['goAway']))
|
|
3107
1171
|
|
|
3108
|
-
if getv(from_object, ['
|
|
3109
|
-
setv(
|
|
1172
|
+
if getv(from_object, ['sessionResumptionUpdate']) is not None:
|
|
1173
|
+
setv(
|
|
1174
|
+
to_object,
|
|
1175
|
+
['session_resumption_update'],
|
|
1176
|
+
getv(from_object, ['sessionResumptionUpdate']),
|
|
1177
|
+
)
|
|
3110
1178
|
|
|
3111
1179
|
return to_object
|
|
3112
1180
|
|
|
3113
1181
|
|
|
3114
|
-
def
|
|
1182
|
+
def _Part_to_mldev(
|
|
3115
1183
|
from_object: Union[dict[str, Any], object],
|
|
3116
1184
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3117
1185
|
) -> dict[str, Any]:
|
|
3118
1186
|
to_object: dict[str, Any] = {}
|
|
3119
|
-
if getv(from_object, ['
|
|
1187
|
+
if getv(from_object, ['media_resolution']) is not None:
|
|
1188
|
+
setv(
|
|
1189
|
+
to_object, ['mediaResolution'], getv(from_object, ['media_resolution'])
|
|
1190
|
+
)
|
|
1191
|
+
|
|
1192
|
+
if getv(from_object, ['code_execution_result']) is not None:
|
|
3120
1193
|
setv(
|
|
3121
1194
|
to_object,
|
|
3122
|
-
['
|
|
3123
|
-
|
|
3124
|
-
getv(from_object, ['videoMetadata']), to_object
|
|
3125
|
-
),
|
|
1195
|
+
['codeExecutionResult'],
|
|
1196
|
+
getv(from_object, ['code_execution_result']),
|
|
3126
1197
|
)
|
|
3127
1198
|
|
|
3128
|
-
if getv(from_object, ['
|
|
3129
|
-
setv(to_object, ['
|
|
1199
|
+
if getv(from_object, ['executable_code']) is not None:
|
|
1200
|
+
setv(to_object, ['executableCode'], getv(from_object, ['executable_code']))
|
|
3130
1201
|
|
|
3131
|
-
if getv(from_object, ['
|
|
1202
|
+
if getv(from_object, ['file_data']) is not None:
|
|
3132
1203
|
setv(
|
|
3133
1204
|
to_object,
|
|
3134
|
-
['
|
|
3135
|
-
|
|
1205
|
+
['fileData'],
|
|
1206
|
+
_FileData_to_mldev(getv(from_object, ['file_data']), to_object),
|
|
3136
1207
|
)
|
|
3137
1208
|
|
|
3138
|
-
if getv(from_object, ['
|
|
1209
|
+
if getv(from_object, ['function_call']) is not None:
|
|
3139
1210
|
setv(
|
|
3140
1211
|
to_object,
|
|
3141
|
-
['
|
|
3142
|
-
|
|
1212
|
+
['functionCall'],
|
|
1213
|
+
_FunctionCall_to_mldev(getv(from_object, ['function_call']), to_object),
|
|
3143
1214
|
)
|
|
3144
1215
|
|
|
3145
|
-
if getv(from_object, ['
|
|
1216
|
+
if getv(from_object, ['function_response']) is not None:
|
|
3146
1217
|
setv(
|
|
3147
1218
|
to_object,
|
|
3148
|
-
['
|
|
3149
|
-
getv(from_object, ['
|
|
1219
|
+
['functionResponse'],
|
|
1220
|
+
getv(from_object, ['function_response']),
|
|
3150
1221
|
)
|
|
3151
1222
|
|
|
3152
|
-
if getv(from_object, ['
|
|
1223
|
+
if getv(from_object, ['inline_data']) is not None:
|
|
3153
1224
|
setv(
|
|
3154
1225
|
to_object,
|
|
3155
|
-
['
|
|
3156
|
-
getv(from_object, ['
|
|
1226
|
+
['inlineData'],
|
|
1227
|
+
_Blob_to_mldev(getv(from_object, ['inline_data']), to_object),
|
|
3157
1228
|
)
|
|
3158
1229
|
|
|
3159
|
-
if getv(from_object, ['
|
|
3160
|
-
setv(to_object, ['
|
|
1230
|
+
if getv(from_object, ['text']) is not None:
|
|
1231
|
+
setv(to_object, ['text'], getv(from_object, ['text']))
|
|
3161
1232
|
|
|
3162
|
-
if getv(from_object, ['
|
|
3163
|
-
setv(to_object, ['
|
|
1233
|
+
if getv(from_object, ['thought']) is not None:
|
|
1234
|
+
setv(to_object, ['thought'], getv(from_object, ['thought']))
|
|
3164
1235
|
|
|
3165
|
-
if getv(from_object, ['
|
|
1236
|
+
if getv(from_object, ['thought_signature']) is not None:
|
|
3166
1237
|
setv(
|
|
3167
1238
|
to_object,
|
|
3168
|
-
['
|
|
3169
|
-
getv(from_object, ['
|
|
1239
|
+
['thoughtSignature'],
|
|
1240
|
+
getv(from_object, ['thought_signature']),
|
|
3170
1241
|
)
|
|
3171
1242
|
|
|
3172
|
-
if getv(from_object, ['
|
|
3173
|
-
setv(to_object, ['
|
|
1243
|
+
if getv(from_object, ['video_metadata']) is not None:
|
|
1244
|
+
setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
|
|
3174
1245
|
|
|
3175
1246
|
return to_object
|
|
3176
1247
|
|
|
3177
1248
|
|
|
3178
|
-
def
|
|
1249
|
+
def _SessionResumptionConfig_to_mldev(
|
|
3179
1250
|
from_object: Union[dict[str, Any], object],
|
|
3180
1251
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3181
1252
|
) -> dict[str, Any]:
|
|
3182
1253
|
to_object: dict[str, Any] = {}
|
|
3183
|
-
if getv(from_object, ['
|
|
3184
|
-
setv(
|
|
3185
|
-
to_object,
|
|
3186
|
-
['parts'],
|
|
3187
|
-
[
|
|
3188
|
-
_Part_from_vertex(item, to_object)
|
|
3189
|
-
for item in getv(from_object, ['parts'])
|
|
3190
|
-
],
|
|
3191
|
-
)
|
|
1254
|
+
if getv(from_object, ['handle']) is not None:
|
|
1255
|
+
setv(to_object, ['handle'], getv(from_object, ['handle']))
|
|
3192
1256
|
|
|
3193
|
-
if getv(from_object, ['
|
|
3194
|
-
|
|
1257
|
+
if getv(from_object, ['transparent']) is not None:
|
|
1258
|
+
raise ValueError('transparent parameter is not supported in Gemini API.')
|
|
3195
1259
|
|
|
3196
1260
|
return to_object
|
|
3197
1261
|
|
|
3198
1262
|
|
|
3199
|
-
def
|
|
1263
|
+
def _SpeechConfig_to_vertex(
|
|
3200
1264
|
from_object: Union[dict[str, Any], object],
|
|
3201
1265
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3202
1266
|
) -> dict[str, Any]:
|
|
3203
1267
|
to_object: dict[str, Any] = {}
|
|
3204
|
-
if getv(from_object, ['
|
|
3205
|
-
setv(to_object, ['
|
|
1268
|
+
if getv(from_object, ['language_code']) is not None:
|
|
1269
|
+
setv(to_object, ['languageCode'], getv(from_object, ['language_code']))
|
|
3206
1270
|
|
|
3207
|
-
if getv(from_object, ['
|
|
3208
|
-
setv(to_object, ['
|
|
1271
|
+
if getv(from_object, ['voice_config']) is not None:
|
|
1272
|
+
setv(to_object, ['voiceConfig'], getv(from_object, ['voice_config']))
|
|
1273
|
+
|
|
1274
|
+
if getv(from_object, ['multi_speaker_voice_config']) is not None:
|
|
1275
|
+
raise ValueError(
|
|
1276
|
+
'multi_speaker_voice_config parameter is not supported in Vertex AI.'
|
|
1277
|
+
)
|
|
3209
1278
|
|
|
3210
1279
|
return to_object
|
|
3211
1280
|
|
|
3212
1281
|
|
|
3213
|
-
def
|
|
1282
|
+
def _Tool_to_mldev(
|
|
3214
1283
|
from_object: Union[dict[str, Any], object],
|
|
3215
1284
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3216
1285
|
) -> dict[str, Any]:
|
|
3217
1286
|
to_object: dict[str, Any] = {}
|
|
3218
|
-
if getv(from_object, ['
|
|
1287
|
+
if getv(from_object, ['function_declarations']) is not None:
|
|
3219
1288
|
setv(
|
|
3220
1289
|
to_object,
|
|
3221
|
-
['
|
|
3222
|
-
|
|
1290
|
+
['functionDeclarations'],
|
|
1291
|
+
[item for item in getv(from_object, ['function_declarations'])],
|
|
3223
1292
|
)
|
|
3224
1293
|
|
|
3225
|
-
if getv(from_object, ['
|
|
3226
|
-
|
|
3227
|
-
|
|
3228
|
-
if getv(from_object, ['interrupted']) is not None:
|
|
3229
|
-
setv(to_object, ['interrupted'], getv(from_object, ['interrupted']))
|
|
1294
|
+
if getv(from_object, ['retrieval']) is not None:
|
|
1295
|
+
raise ValueError('retrieval parameter is not supported in Gemini API.')
|
|
3230
1296
|
|
|
3231
|
-
if getv(from_object, ['
|
|
1297
|
+
if getv(from_object, ['google_search_retrieval']) is not None:
|
|
3232
1298
|
setv(
|
|
3233
1299
|
to_object,
|
|
3234
|
-
['
|
|
3235
|
-
getv(from_object, ['
|
|
1300
|
+
['googleSearchRetrieval'],
|
|
1301
|
+
getv(from_object, ['google_search_retrieval']),
|
|
3236
1302
|
)
|
|
3237
1303
|
|
|
3238
|
-
if getv(from_object, ['
|
|
3239
|
-
setv(
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
1304
|
+
if getv(from_object, ['computer_use']) is not None:
|
|
1305
|
+
setv(to_object, ['computerUse'], getv(from_object, ['computer_use']))
|
|
1306
|
+
|
|
1307
|
+
if getv(from_object, ['file_search']) is not None:
|
|
1308
|
+
setv(to_object, ['fileSearch'], getv(from_object, ['file_search']))
|
|
1309
|
+
|
|
1310
|
+
if getv(from_object, ['code_execution']) is not None:
|
|
1311
|
+
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
|
1312
|
+
|
|
1313
|
+
if getv(from_object, ['enterprise_web_search']) is not None:
|
|
1314
|
+
raise ValueError(
|
|
1315
|
+
'enterprise_web_search parameter is not supported in Gemini API.'
|
|
3243
1316
|
)
|
|
3244
1317
|
|
|
3245
|
-
if getv(from_object, ['
|
|
1318
|
+
if getv(from_object, ['google_maps']) is not None:
|
|
3246
1319
|
setv(
|
|
3247
1320
|
to_object,
|
|
3248
|
-
['
|
|
3249
|
-
|
|
3250
|
-
getv(from_object, ['inputTranscription']), to_object
|
|
3251
|
-
),
|
|
1321
|
+
['googleMaps'],
|
|
1322
|
+
_GoogleMaps_to_mldev(getv(from_object, ['google_maps']), to_object),
|
|
3252
1323
|
)
|
|
3253
1324
|
|
|
3254
|
-
if getv(from_object, ['
|
|
1325
|
+
if getv(from_object, ['google_search']) is not None:
|
|
3255
1326
|
setv(
|
|
3256
1327
|
to_object,
|
|
3257
|
-
['
|
|
3258
|
-
|
|
3259
|
-
getv(from_object, ['outputTranscription']), to_object
|
|
3260
|
-
),
|
|
1328
|
+
['googleSearch'],
|
|
1329
|
+
_GoogleSearch_to_mldev(getv(from_object, ['google_search']), to_object),
|
|
3261
1330
|
)
|
|
3262
1331
|
|
|
3263
|
-
|
|
3264
|
-
|
|
3265
|
-
|
|
3266
|
-
def _FunctionCall_from_vertex(
|
|
3267
|
-
from_object: Union[dict[str, Any], object],
|
|
3268
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
3269
|
-
) -> dict[str, Any]:
|
|
3270
|
-
to_object: dict[str, Any] = {}
|
|
3271
|
-
|
|
3272
|
-
if getv(from_object, ['args']) is not None:
|
|
3273
|
-
setv(to_object, ['args'], getv(from_object, ['args']))
|
|
3274
|
-
|
|
3275
|
-
if getv(from_object, ['name']) is not None:
|
|
3276
|
-
setv(to_object, ['name'], getv(from_object, ['name']))
|
|
1332
|
+
if getv(from_object, ['url_context']) is not None:
|
|
1333
|
+
setv(to_object, ['urlContext'], getv(from_object, ['url_context']))
|
|
3277
1334
|
|
|
3278
1335
|
return to_object
|
|
3279
1336
|
|
|
3280
1337
|
|
|
3281
|
-
def
|
|
1338
|
+
def _Tool_to_vertex(
|
|
3282
1339
|
from_object: Union[dict[str, Any], object],
|
|
3283
1340
|
parent_object: Optional[dict[str, Any]] = None,
|
|
3284
1341
|
) -> dict[str, Any]:
|
|
3285
1342
|
to_object: dict[str, Any] = {}
|
|
3286
|
-
if getv(from_object, ['
|
|
1343
|
+
if getv(from_object, ['function_declarations']) is not None:
|
|
3287
1344
|
setv(
|
|
3288
1345
|
to_object,
|
|
3289
|
-
['
|
|
1346
|
+
['functionDeclarations'],
|
|
3290
1347
|
[
|
|
3291
|
-
|
|
3292
|
-
for item in getv(from_object, ['
|
|
1348
|
+
_FunctionDeclaration_to_vertex(item, to_object)
|
|
1349
|
+
for item in getv(from_object, ['function_declarations'])
|
|
3293
1350
|
],
|
|
3294
1351
|
)
|
|
3295
1352
|
|
|
3296
|
-
|
|
1353
|
+
if getv(from_object, ['retrieval']) is not None:
|
|
1354
|
+
setv(to_object, ['retrieval'], getv(from_object, ['retrieval']))
|
|
3297
1355
|
|
|
1356
|
+
if getv(from_object, ['google_search_retrieval']) is not None:
|
|
1357
|
+
setv(
|
|
1358
|
+
to_object,
|
|
1359
|
+
['googleSearchRetrieval'],
|
|
1360
|
+
getv(from_object, ['google_search_retrieval']),
|
|
1361
|
+
)
|
|
3298
1362
|
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
3302
|
-
) -> dict[str, Any]:
|
|
3303
|
-
to_object: dict[str, Any] = {}
|
|
3304
|
-
if getv(from_object, ['ids']) is not None:
|
|
3305
|
-
setv(to_object, ['ids'], getv(from_object, ['ids']))
|
|
1363
|
+
if getv(from_object, ['computer_use']) is not None:
|
|
1364
|
+
setv(to_object, ['computerUse'], getv(from_object, ['computer_use']))
|
|
3306
1365
|
|
|
3307
|
-
|
|
1366
|
+
if getv(from_object, ['file_search']) is not None:
|
|
1367
|
+
raise ValueError('file_search parameter is not supported in Vertex AI.')
|
|
3308
1368
|
|
|
1369
|
+
if getv(from_object, ['code_execution']) is not None:
|
|
1370
|
+
setv(to_object, ['codeExecution'], getv(from_object, ['code_execution']))
|
|
3309
1371
|
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
setv(to_object, ['modality'], getv(from_object, ['modality']))
|
|
1372
|
+
if getv(from_object, ['enterprise_web_search']) is not None:
|
|
1373
|
+
setv(
|
|
1374
|
+
to_object,
|
|
1375
|
+
['enterpriseWebSearch'],
|
|
1376
|
+
getv(from_object, ['enterprise_web_search']),
|
|
1377
|
+
)
|
|
3317
1378
|
|
|
3318
|
-
if getv(from_object, ['
|
|
3319
|
-
setv(to_object, ['
|
|
1379
|
+
if getv(from_object, ['google_maps']) is not None:
|
|
1380
|
+
setv(to_object, ['googleMaps'], getv(from_object, ['google_maps']))
|
|
1381
|
+
|
|
1382
|
+
if getv(from_object, ['google_search']) is not None:
|
|
1383
|
+
setv(to_object, ['googleSearch'], getv(from_object, ['google_search']))
|
|
1384
|
+
|
|
1385
|
+
if getv(from_object, ['url_context']) is not None:
|
|
1386
|
+
setv(to_object, ['urlContext'], getv(from_object, ['url_context']))
|
|
3320
1387
|
|
|
3321
1388
|
return to_object
|
|
3322
1389
|
|
|
@@ -3370,153 +1437,31 @@ def _UsageMetadata_from_vertex(
|
|
|
3370
1437
|
setv(
|
|
3371
1438
|
to_object,
|
|
3372
1439
|
['prompt_tokens_details'],
|
|
3373
|
-
[
|
|
3374
|
-
_ModalityTokenCount_from_vertex(item, to_object)
|
|
3375
|
-
for item in getv(from_object, ['promptTokensDetails'])
|
|
3376
|
-
],
|
|
1440
|
+
[item for item in getv(from_object, ['promptTokensDetails'])],
|
|
3377
1441
|
)
|
|
3378
1442
|
|
|
3379
1443
|
if getv(from_object, ['cacheTokensDetails']) is not None:
|
|
3380
1444
|
setv(
|
|
3381
1445
|
to_object,
|
|
3382
1446
|
['cache_tokens_details'],
|
|
3383
|
-
[
|
|
3384
|
-
_ModalityTokenCount_from_vertex(item, to_object)
|
|
3385
|
-
for item in getv(from_object, ['cacheTokensDetails'])
|
|
3386
|
-
],
|
|
1447
|
+
[item for item in getv(from_object, ['cacheTokensDetails'])],
|
|
3387
1448
|
)
|
|
3388
1449
|
|
|
3389
1450
|
if getv(from_object, ['candidatesTokensDetails']) is not None:
|
|
3390
1451
|
setv(
|
|
3391
1452
|
to_object,
|
|
3392
1453
|
['response_tokens_details'],
|
|
3393
|
-
[
|
|
3394
|
-
_ModalityTokenCount_from_vertex(item, to_object)
|
|
3395
|
-
for item in getv(from_object, ['candidatesTokensDetails'])
|
|
3396
|
-
],
|
|
1454
|
+
[item for item in getv(from_object, ['candidatesTokensDetails'])],
|
|
3397
1455
|
)
|
|
3398
1456
|
|
|
3399
1457
|
if getv(from_object, ['toolUsePromptTokensDetails']) is not None:
|
|
3400
1458
|
setv(
|
|
3401
1459
|
to_object,
|
|
3402
1460
|
['tool_use_prompt_tokens_details'],
|
|
3403
|
-
[
|
|
3404
|
-
_ModalityTokenCount_from_vertex(item, to_object)
|
|
3405
|
-
for item in getv(from_object, ['toolUsePromptTokensDetails'])
|
|
3406
|
-
],
|
|
1461
|
+
[item for item in getv(from_object, ['toolUsePromptTokensDetails'])],
|
|
3407
1462
|
)
|
|
3408
1463
|
|
|
3409
1464
|
if getv(from_object, ['trafficType']) is not None:
|
|
3410
1465
|
setv(to_object, ['traffic_type'], getv(from_object, ['trafficType']))
|
|
3411
1466
|
|
|
3412
1467
|
return to_object
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
def _LiveServerGoAway_from_vertex(
|
|
3416
|
-
from_object: Union[dict[str, Any], object],
|
|
3417
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
3418
|
-
) -> dict[str, Any]:
|
|
3419
|
-
to_object: dict[str, Any] = {}
|
|
3420
|
-
if getv(from_object, ['timeLeft']) is not None:
|
|
3421
|
-
setv(to_object, ['time_left'], getv(from_object, ['timeLeft']))
|
|
3422
|
-
|
|
3423
|
-
return to_object
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
def _LiveServerSessionResumptionUpdate_from_vertex(
|
|
3427
|
-
from_object: Union[dict[str, Any], object],
|
|
3428
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
3429
|
-
) -> dict[str, Any]:
|
|
3430
|
-
to_object: dict[str, Any] = {}
|
|
3431
|
-
if getv(from_object, ['newHandle']) is not None:
|
|
3432
|
-
setv(to_object, ['new_handle'], getv(from_object, ['newHandle']))
|
|
3433
|
-
|
|
3434
|
-
if getv(from_object, ['resumable']) is not None:
|
|
3435
|
-
setv(to_object, ['resumable'], getv(from_object, ['resumable']))
|
|
3436
|
-
|
|
3437
|
-
if getv(from_object, ['lastConsumedClientMessageIndex']) is not None:
|
|
3438
|
-
setv(
|
|
3439
|
-
to_object,
|
|
3440
|
-
['last_consumed_client_message_index'],
|
|
3441
|
-
getv(from_object, ['lastConsumedClientMessageIndex']),
|
|
3442
|
-
)
|
|
3443
|
-
|
|
3444
|
-
return to_object
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
def _LiveServerMessage_from_vertex(
|
|
3448
|
-
from_object: Union[dict[str, Any], object],
|
|
3449
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
3450
|
-
) -> dict[str, Any]:
|
|
3451
|
-
to_object: dict[str, Any] = {}
|
|
3452
|
-
if getv(from_object, ['setupComplete']) is not None:
|
|
3453
|
-
setv(
|
|
3454
|
-
to_object,
|
|
3455
|
-
['setup_complete'],
|
|
3456
|
-
_LiveServerSetupComplete_from_vertex(
|
|
3457
|
-
getv(from_object, ['setupComplete']), to_object
|
|
3458
|
-
),
|
|
3459
|
-
)
|
|
3460
|
-
|
|
3461
|
-
if getv(from_object, ['serverContent']) is not None:
|
|
3462
|
-
setv(
|
|
3463
|
-
to_object,
|
|
3464
|
-
['server_content'],
|
|
3465
|
-
_LiveServerContent_from_vertex(
|
|
3466
|
-
getv(from_object, ['serverContent']), to_object
|
|
3467
|
-
),
|
|
3468
|
-
)
|
|
3469
|
-
|
|
3470
|
-
if getv(from_object, ['toolCall']) is not None:
|
|
3471
|
-
setv(
|
|
3472
|
-
to_object,
|
|
3473
|
-
['tool_call'],
|
|
3474
|
-
_LiveServerToolCall_from_vertex(
|
|
3475
|
-
getv(from_object, ['toolCall']), to_object
|
|
3476
|
-
),
|
|
3477
|
-
)
|
|
3478
|
-
|
|
3479
|
-
if getv(from_object, ['toolCallCancellation']) is not None:
|
|
3480
|
-
setv(
|
|
3481
|
-
to_object,
|
|
3482
|
-
['tool_call_cancellation'],
|
|
3483
|
-
_LiveServerToolCallCancellation_from_vertex(
|
|
3484
|
-
getv(from_object, ['toolCallCancellation']), to_object
|
|
3485
|
-
),
|
|
3486
|
-
)
|
|
3487
|
-
|
|
3488
|
-
if getv(from_object, ['usageMetadata']) is not None:
|
|
3489
|
-
setv(
|
|
3490
|
-
to_object,
|
|
3491
|
-
['usage_metadata'],
|
|
3492
|
-
_UsageMetadata_from_vertex(
|
|
3493
|
-
getv(from_object, ['usageMetadata']), to_object
|
|
3494
|
-
),
|
|
3495
|
-
)
|
|
3496
|
-
|
|
3497
|
-
if getv(from_object, ['goAway']) is not None:
|
|
3498
|
-
setv(
|
|
3499
|
-
to_object,
|
|
3500
|
-
['go_away'],
|
|
3501
|
-
_LiveServerGoAway_from_vertex(getv(from_object, ['goAway']), to_object),
|
|
3502
|
-
)
|
|
3503
|
-
|
|
3504
|
-
if getv(from_object, ['sessionResumptionUpdate']) is not None:
|
|
3505
|
-
setv(
|
|
3506
|
-
to_object,
|
|
3507
|
-
['session_resumption_update'],
|
|
3508
|
-
_LiveServerSessionResumptionUpdate_from_vertex(
|
|
3509
|
-
getv(from_object, ['sessionResumptionUpdate']), to_object
|
|
3510
|
-
),
|
|
3511
|
-
)
|
|
3512
|
-
|
|
3513
|
-
return to_object
|
|
3514
|
-
|
|
3515
|
-
|
|
3516
|
-
def _LiveMusicServerMessage_from_vertex(
|
|
3517
|
-
from_object: Union[dict[str, Any], object],
|
|
3518
|
-
parent_object: Optional[dict[str, Any]] = None,
|
|
3519
|
-
) -> dict[str, Any]:
|
|
3520
|
-
to_object: dict[str, Any] = {}
|
|
3521
|
-
|
|
3522
|
-
return to_object
|