@@ -683,6 +683,13 @@ def _GenerateUserScenariosParameters_to_vertex(
683683 if getv (from_object , ["config" ]) is not None :
684684 setv (to_object , ["config" ], getv (from_object , ["config" ]))
685685
686+ if getv (from_object , ["allow_cross_region_model" ]) is not None :
687+ setv (
688+ to_object ,
689+ ["allowCrossRegionModel" ],
690+ getv (from_object , ["allow_cross_region_model" ]),
691+ )
692+
686693 return to_object
687694
688695
@@ -1473,6 +1480,7 @@ def _generate_user_scenarios(
14731480 evals_types .UserScenarioGenerationConfigOrDict
14741481 ] = None ,
14751482 config : Optional [types .GenerateUserScenariosConfigOrDict ] = None ,
1483+ allow_cross_region_model : Optional [bool ] = None ,
14761484 ) -> types .GenerateUserScenariosResponse :
14771485 """
14781486 Generates user scenarios for agent evaluation.
@@ -1484,6 +1492,7 @@ def _generate_user_scenarios(
14841492 root_agent_id = root_agent_id ,
14851493 user_scenario_generation_config = user_scenario_generation_config ,
14861494 config = config ,
1495+ allow_cross_region_model = allow_cross_region_model ,
14871496 )
14881497
14891498 request_url_dict : Optional [dict [str , str ]]
@@ -2852,6 +2861,7 @@ def generate_conversation_scenarios(
28522861 * ,
28532862 agent_info : evals_types .AgentInfoOrDict ,
28542863 config : evals_types .UserScenarioGenerationConfigOrDict ,
2864+ allow_cross_region_model : Optional [bool ] = None ,
28552865 ) -> types .EvaluationDataset :
28562866 """Generates an evaluation dataset with user scenarios,
28572867 which helps to generate conversations between a simulated user
@@ -2860,6 +2870,8 @@ def generate_conversation_scenarios(
28602870 Args:
28612871 agent_info: The agent info to generate user scenarios for.
28622872 config: Configuration for generating user scenarios.
2873+ allow_cross_region_model: Opt-in flag to authorize cross-region
2874+ routing for model inference.
28632875
28642876 Returns:
28652877 An EvaluationDataset containing the generated user scenarios.
@@ -2873,6 +2885,7 @@ def generate_conversation_scenarios(
28732885 agents = parsed_agent_info .agents ,
28742886 root_agent_id = parsed_agent_info .root_agent_id ,
28752887 user_scenario_generation_config = config ,
2888+ allow_cross_region_model = allow_cross_region_model ,
28762889 )
28772890 return _evals_utils ._postprocess_user_scenarios_response (response )
28782891
@@ -3592,6 +3605,7 @@ async def _generate_user_scenarios(
35923605 evals_types .UserScenarioGenerationConfigOrDict
35933606 ] = None ,
35943607 config : Optional [types .GenerateUserScenariosConfigOrDict ] = None ,
3608+ allow_cross_region_model : Optional [bool ] = None ,
35953609 ) -> types .GenerateUserScenariosResponse :
35963610 """
35973611 Generates user scenarios for agent evaluation.
@@ -3603,6 +3617,7 @@ async def _generate_user_scenarios(
36033617 root_agent_id = root_agent_id ,
36043618 user_scenario_generation_config = user_scenario_generation_config ,
36053619 config = config ,
3620+ allow_cross_region_model = allow_cross_region_model ,
36063621 )
36073622
36083623 request_url_dict : Optional [dict [str , str ]]
@@ -4622,6 +4637,7 @@ async def generate_conversation_scenarios(
46224637 * ,
46234638 agent_info : evals_types .AgentInfoOrDict ,
46244639 config : evals_types .UserScenarioGenerationConfigOrDict ,
4640+ allow_cross_region_model : Optional [bool ] = None ,
46254641 ) -> types .EvaluationDataset :
46264642 """Generates an evaluation dataset with user scenarios,
46274643 which helps to generate conversations between a simulated user
@@ -4630,6 +4646,8 @@ async def generate_conversation_scenarios(
46304646 Args:
46314647 agent_info: The agent info to generate user scenarios for.
46324648 config: Configuration for generating user scenarios.
4649+ allow_cross_region_model: Opt-in flag to authorize cross-region
4650+ routing for model inference.
46334651
46344652 Returns:
46354653 An EvaluationDataset containing the generated user scenarios.
@@ -4643,6 +4661,7 @@ async def generate_conversation_scenarios(
46434661 agents = parsed_agent_info .agents ,
46444662 root_agent_id = parsed_agent_info .root_agent_id ,
46454663 user_scenario_generation_config = config ,
4664+ allow_cross_region_model = allow_cross_region_model ,
46464665 )
46474666 return _evals_utils ._postprocess_user_scenarios_response (response )
46484667
0 commit comments