Skip to content

Commit 5f601ac

Browse files
yyyu-googlecopybara-github
authored andcommitted
docs: update doc string to replace Vertex AI with Gemini Enterprise Agent Platform, update method error message to replace Vertex AI with Gemini Enterprise Agent Platform (previously known as Vertex AI), update converter error message to replace Vertex AI with Gemini Enterprise Agent Platform
PiperOrigin-RevId: 900362617
1 parent 693fd9a commit 5f601ac

29 files changed

Lines changed: 475 additions & 212 deletions

google/genai/_live_converters.py

Lines changed: 60 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,10 @@ def _FunctionDeclaration_to_vertex(
199199
)
200200

201201
if getv(from_object, ['behavior']) is not None:
202-
raise ValueError('behavior parameter is not supported in Vertex AI.')
202+
raise ValueError(
203+
'behavior parameter is not supported in Gemini Enterprise Agent'
204+
' Platform.'
205+
)
203206

204207
return to_object
205208

@@ -317,7 +320,8 @@ def _GenerationConfig_to_vertex(
317320

318321
if getv(from_object, ['enable_enhanced_civic_answers']) is not None:
319322
raise ValueError(
320-
'enable_enhanced_civic_answers parameter is not supported in Vertex AI.'
323+
'enable_enhanced_civic_answers parameter is not supported in Gemini'
324+
' Enterprise Agent Platform.'
321325
)
322326

323327
return to_object
@@ -548,7 +552,8 @@ def _LiveClientRealtimeInput_to_vertex(
548552

549553
if getv(from_object, ['audio_stream_end']) is not None:
550554
raise ValueError(
551-
'audio_stream_end parameter is not supported in Vertex AI.'
555+
'audio_stream_end parameter is not supported in Gemini Enterprise Agent'
556+
' Platform.'
552557
)
553558

554559
if getv(from_object, ['video']) is not None:
@@ -738,7 +743,10 @@ def _LiveClientSetup_to_vertex(
738743
)
739744

740745
if getv(from_object, ['history_config']) is not None:
741-
raise ValueError('history_config parameter is not supported in Vertex AI.')
746+
raise ValueError(
747+
'history_config parameter is not supported in Gemini Enterprise Agent'
748+
' Platform.'
749+
)
742750

743751
if getv(from_object, ['avatar_config']) is not None:
744752
setv(to_object, ['avatarConfig'], getv(from_object, ['avatar_config']))
@@ -1094,7 +1102,10 @@ def _LiveConnectConfig_to_vertex(
10941102
)
10951103

10961104
if getv(from_object, ['history_config']) is not None:
1097-
raise ValueError('history_config parameter is not supported in Vertex AI.')
1105+
raise ValueError(
1106+
'history_config parameter is not supported in Gemini Enterprise Agent'
1107+
' Platform.'
1108+
)
10981109

10991110
if getv(from_object, ['avatar_config']) is not None:
11001111
setv(
@@ -1169,19 +1180,26 @@ def _LiveMusicClientMessage_to_vertex(
11691180
) -> dict[str, Any]:
11701181
to_object: dict[str, Any] = {}
11711182
if getv(from_object, ['setup']) is not None:
1172-
raise ValueError('setup parameter is not supported in Vertex AI.')
1183+
raise ValueError(
1184+
'setup parameter is not supported in Gemini Enterprise Agent Platform.'
1185+
)
11731186

11741187
if getv(from_object, ['client_content']) is not None:
1175-
raise ValueError('client_content parameter is not supported in Vertex AI.')
1188+
raise ValueError(
1189+
'client_content parameter is not supported in Gemini Enterprise Agent'
1190+
' Platform.'
1191+
)
11761192

11771193
if getv(from_object, ['music_generation_config']) is not None:
11781194
raise ValueError(
1179-
'music_generation_config parameter is not supported in Vertex AI.'
1195+
'music_generation_config parameter is not supported in Gemini'
1196+
' Enterprise Agent Platform.'
11801197
)
11811198

11821199
if getv(from_object, ['playback_control']) is not None:
11831200
raise ValueError(
1184-
'playback_control parameter is not supported in Vertex AI.'
1201+
'playback_control parameter is not supported in Gemini Enterprise Agent'
1202+
' Platform.'
11851203
)
11861204

11871205
return to_object
@@ -1204,7 +1222,9 @@ def _LiveMusicConnectParameters_to_vertex(
12041222
) -> dict[str, Any]:
12051223
to_object: dict[str, Any] = {}
12061224
if getv(from_object, ['model']) is not None:
1207-
raise ValueError('model parameter is not supported in Vertex AI.')
1225+
raise ValueError(
1226+
'model parameter is not supported in Gemini Enterprise Agent Platform.'
1227+
)
12081228

12091229
return to_object
12101230

@@ -1231,7 +1251,8 @@ def _LiveMusicSetConfigParameters_to_vertex(
12311251
to_object: dict[str, Any] = {}
12321252
if getv(from_object, ['music_generation_config']) is not None:
12331253
raise ValueError(
1234-
'music_generation_config parameter is not supported in Vertex AI.'
1254+
'music_generation_config parameter is not supported in Gemini'
1255+
' Enterprise Agent Platform.'
12351256
)
12361257

12371258
return to_object
@@ -1259,7 +1280,8 @@ def _LiveMusicSetWeightedPromptsParameters_to_vertex(
12591280
to_object: dict[str, Any] = {}
12601281
if getv(from_object, ['weighted_prompts']) is not None:
12611282
raise ValueError(
1262-
'weighted_prompts parameter is not supported in Vertex AI.'
1283+
'weighted_prompts parameter is not supported in Gemini Enterprise Agent'
1284+
' Platform.'
12631285
)
12641286

12651287
return to_object
@@ -1601,13 +1623,22 @@ def _Part_to_vertex(
16011623
setv(to_object, ['videoMetadata'], getv(from_object, ['video_metadata']))
16021624

16031625
if getv(from_object, ['tool_call']) is not None:
1604-
raise ValueError('tool_call parameter is not supported in Vertex AI.')
1626+
raise ValueError(
1627+
'tool_call parameter is not supported in Gemini Enterprise Agent'
1628+
' Platform.'
1629+
)
16051630

16061631
if getv(from_object, ['tool_response']) is not None:
1607-
raise ValueError('tool_response parameter is not supported in Vertex AI.')
1632+
raise ValueError(
1633+
'tool_response parameter is not supported in Gemini Enterprise Agent'
1634+
' Platform.'
1635+
)
16081636

16091637
if getv(from_object, ['part_metadata']) is not None:
1610-
raise ValueError('part_metadata parameter is not supported in Vertex AI.')
1638+
raise ValueError(
1639+
'part_metadata parameter is not supported in Gemini Enterprise Agent'
1640+
' Platform.'
1641+
)
16111642

16121643
return to_object
16131644

@@ -1628,11 +1659,15 @@ def _ReplicatedVoiceConfig_to_vertex(
16281659
)
16291660

16301661
if getv(from_object, ['consent_audio']) is not None:
1631-
raise ValueError('consent_audio parameter is not supported in Vertex AI.')
1662+
raise ValueError(
1663+
'consent_audio parameter is not supported in Gemini Enterprise Agent'
1664+
' Platform.'
1665+
)
16321666

16331667
if getv(from_object, ['voice_consent_signature']) is not None:
16341668
raise ValueError(
1635-
'voice_consent_signature parameter is not supported in Vertex AI.'
1669+
'voice_consent_signature parameter is not supported in Gemini'
1670+
' Enterprise Agent Platform.'
16361671
)
16371672

16381673
return to_object
@@ -1794,7 +1829,10 @@ def _Tool_to_vertex(
17941829
setv(to_object, ['computerUse'], getv(from_object, ['computer_use']))
17951830

17961831
if getv(from_object, ['file_search']) is not None:
1797-
raise ValueError('file_search parameter is not supported in Vertex AI.')
1832+
raise ValueError(
1833+
'file_search parameter is not supported in Gemini Enterprise Agent'
1834+
' Platform.'
1835+
)
17981836

17991837
if getv(from_object, ['google_search']) is not None:
18001838
setv(to_object, ['googleSearch'], getv(from_object, ['google_search']))
@@ -1840,7 +1878,10 @@ def _Tool_to_vertex(
18401878
setv(to_object, ['urlContext'], getv(from_object, ['url_context']))
18411879

18421880
if getv(from_object, ['mcp_servers']) is not None:
1843-
raise ValueError('mcp_servers parameter is not supported in Vertex AI.')
1881+
raise ValueError(
1882+
'mcp_servers parameter is not supported in Gemini Enterprise Agent'
1883+
' Platform.'
1884+
)
18441885

18451886
return to_object
18461887

google/genai/_tokens_converters.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ def _CreateAuthTokenParameters_to_vertex(
171171
) -> dict[str, Any]:
172172
to_object: dict[str, Any] = {}
173173
if getv(from_object, ['config']) is not None:
174-
raise ValueError('config parameter is not supported in Vertex AI.')
174+
raise ValueError(
175+
'config parameter is not supported in Gemini Enterprise Agent Platform.'
176+
)
175177

176178
return to_object
177179

google/genai/_transformers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1025,8 +1025,8 @@ def t_batch_job_source(
10251025
if client.vertexai:
10261026
if mldev_sources or vertex_sources != 1:
10271027
raise ValueError(
1028-
'Exactly one of `gcs_uri`, `bigquery_uri`, or `vertex_dataset_name` must be set, other '
1029-
'sources are not supported in Vertex AI.'
1028+
'Exactly one of `gcs_uri` or `bigquery_uri`, or `vertex_dataset_name` must be set, other '
1029+
'sources are not supported in Gemini Enterprise Agent Platform.'
10301030
)
10311031
else:
10321032
if vertex_sources or mldev_sources != 1:

google/genai/batches.py

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -165,17 +165,21 @@ def _BatchJobDestination_to_vertex(
165165
)
166166

167167
if getv(from_object, ['file_name']) is not None:
168-
raise ValueError('file_name parameter is not supported in Vertex AI.')
168+
raise ValueError(
169+
'file_name parameter is not supported in Gemini Enterprise Agent'
170+
' Platform.'
171+
)
169172

170173
if getv(from_object, ['inlined_responses']) is not None:
171174
raise ValueError(
172-
'inlined_responses parameter is not supported in Vertex AI.'
175+
'inlined_responses parameter is not supported in Gemini Enterprise'
176+
' Agent Platform.'
173177
)
174178

175179
if getv(from_object, ['inlined_embed_content_responses']) is not None:
176180
raise ValueError(
177-
'inlined_embed_content_responses parameter is not supported in'
178-
' Vertex AI.'
181+
'inlined_embed_content_responses parameter is not supported in Gemini'
182+
' Enterprise Agent Platform.'
179183
)
180184

181185
if getv(from_object, ['vertex_dataset']) is not None:
@@ -276,11 +280,15 @@ def _BatchJobSource_to_vertex(
276280
)
277281

278282
if getv(from_object, ['file_name']) is not None:
279-
raise ValueError('file_name parameter is not supported in Vertex AI.')
283+
raise ValueError(
284+
'file_name parameter is not supported in Gemini Enterprise Agent'
285+
' Platform.'
286+
)
280287

281288
if getv(from_object, ['inlined_requests']) is not None:
282289
raise ValueError(
283-
'inlined_requests parameter is not supported in Vertex AI.'
290+
'inlined_requests parameter is not supported in Gemini Enterprise Agent'
291+
' Platform.'
284292
)
285293

286294
if getv(from_object, ['vertex_dataset_name']) is not None:
@@ -595,7 +603,10 @@ def _CreateBatchJobConfig_to_vertex(
595603
)
596604

597605
if getv(from_object, ['webhook_config']) is not None:
598-
raise ValueError('webhook_config parameter is not supported in Vertex AI.')
606+
raise ValueError(
607+
'webhook_config parameter is not supported in Gemini Enterprise Agent'
608+
' Platform.'
609+
)
599610

600611
return to_object
601612

@@ -1847,8 +1858,9 @@ def get(
18471858
Args:
18481859
name (str): A fully-qualified BatchJob resource name or ID.
18491860
Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
1850-
when project and location are initialized in the Vertex AI client. Or
1851-
"batches/abc" using the Gemini Developer AI client.
1861+
when project and location are initialized in the Gemini Enterprise
1862+
Agent Platform client. Or "batches/abc" using the Gemini Developer AI
1863+
client.
18521864
18531865
Returns:
18541866
A BatchJob object that contains details about the batch job.
@@ -2184,10 +2196,11 @@ def create(
21842196
21852197
Args:
21862198
model (str): The model to use for the batch job.
2187-
src: The source of the batch job. Currently Vertex AI supports GCS URI(-s)
2188-
or BigQuery URI. Example: "gs://path/to/input/data" or
2189-
"bq://projectId.bqDatasetId.bqTableId". Gemini Developer API supports
2190-
List of inlined_request, or file name. Example: "files/file_name".
2199+
src: The source of the batch job. Currently Gemini Enterprise Agent
2200+
Platform supports GCS URI(-s) or BigQuery URI. Example:
2201+
"gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
2202+
Gemini Developer API supports List of inlined_request, or file name.
2203+
Example: "files/file_name".
21912204
config (CreateBatchJobConfig): Optional configuration for the batch job.
21922205
21932206
Returns:
@@ -2264,7 +2277,10 @@ def create_embeddings(
22642277
)
22652278

22662279
if self._api_client.vertexai:
2267-
raise ValueError('Vertex AI does not support batches.create_embeddings.')
2280+
raise ValueError(
2281+
'Gemini Enterprise Agent Platform (previously known as Vertex AI)'
2282+
' does not support batches.create_embeddings.'
2283+
)
22682284
else:
22692285
return self._create_embeddings(model=model, src=src, config=config)
22702286

@@ -2465,8 +2481,9 @@ async def get(
24652481
Args:
24662482
name (str): A fully-qualified BatchJob resource name or ID.
24672483
Example: "projects/.../locations/.../batchPredictionJobs/456" or "456"
2468-
when project and location are initialized in the Vertex AI client. Or
2469-
"batches/abc" using the Gemini Developer AI client.
2484+
when project and location are initialized in the Gemini Enterprise
2485+
Agent Platform client. Or "batches/abc" using the Gemini Developer AI
2486+
client.
24702487
24712488
Returns:
24722489
A BatchJob object that contains details about the batch job.
@@ -2808,10 +2825,11 @@ async def create(
28082825
28092826
Args:
28102827
model (str): The model to use for the batch job.
2811-
src: The source of the batch job. Currently Vertex AI supports GCS URI(-s)
2812-
or BigQuery URI. Example: "gs://path/to/input/data" or
2813-
"bq://projectId.bqDatasetId.bqTableId". Gemini Develop API supports List
2814-
of inlined_request, or file name. Example: "files/file_name".
2828+
src: The source of the batch job. Currently Gemini Enterprise Agent
2829+
Platform supports GCS URI(-s) or BigQuery URI. Example:
2830+
"gs://path/to/input/data" or "bq://projectId.bqDatasetId.bqTableId".
2831+
Gemini Develop API supports List of inlined_request, or file name.
2832+
Example: "files/file_name".
28152833
config (CreateBatchJobConfig): Optional configuration for the batch job.
28162834
28172835
Returns:
@@ -2894,7 +2912,10 @@ async def create_embeddings(
28942912
http_options = parameter_model.config.http_options
28952913

28962914
if self._api_client.vertexai:
2897-
raise ValueError('Vertex AI does not support batches.create_embeddings.')
2915+
raise ValueError(
2916+
'Gemini Enterprise Agent Platform (previously known as Vertex AI)'
2917+
' does not support batches.create_embeddings.'
2918+
)
28982919
else:
28992920
return await self._create_embeddings(model=model, src=src, config=config)
29002921

0 commit comments

Comments
 (0)