@@ -130,6 +130,13 @@ def _CreateEvaluationRunParameters_to_vertex(
130130 if getv (from_object , ["config" ]) is not None :
131131 setv (to_object , ["config" ], getv (from_object , ["config" ]))
132132
133+ if getv (from_object , ["analysis_configs" ]) is not None :
134+ setv (
135+ to_object ,
136+ ["analysisConfigs" ],
137+ [item for item in getv (from_object , ["analysis_configs" ])],
138+ )
139+
133140 return to_object
134141
135142
@@ -603,6 +610,13 @@ def _EvaluationRun_from_vertex(
603610 if getv (from_object , ["labels" ]) is not None :
604611 setv (to_object , ["labels" ], getv (from_object , ["labels" ]))
605612
613+ if getv (from_object , ["analysisConfigs" ]) is not None :
614+ setv (
615+ to_object ,
616+ ["analysis_configs" ],
617+ [item for item in getv (from_object , ["analysisConfigs" ])],
618+ )
619+
606620 return to_object
607621
608622
@@ -1159,6 +1173,7 @@ def _create_evaluation_run(
11591173 dict [str , types .EvaluationRunInferenceConfigOrDict ]
11601174 ] = None ,
11611175 config : Optional [types .CreateEvaluationRunConfigOrDict ] = None ,
1176+ analysis_configs : Optional [list [types .AnalysisConfigOrDict ]] = None ,
11621177 ) -> types .EvaluationRun :
11631178 """
11641179 Creates an EvaluationRun.
@@ -1172,6 +1187,7 @@ def _create_evaluation_run(
11721187 labels = labels ,
11731188 inference_configs = inference_configs ,
11741189 config = config ,
1190+ analysis_configs = analysis_configs ,
11751191 )
11761192
11771193 request_url_dict : Optional [dict [str , str ]]
@@ -2616,6 +2632,7 @@ def create_evaluation_run(
26162632 labels : Optional [dict [str , str ]] = None ,
26172633 loss_analysis_metrics : Optional [list [Union [str , types .MetricOrDict ]]] = None ,
26182634 loss_analysis_configs : Optional [list [types .LossAnalysisConfigOrDict ]] = None ,
2635+ red_teaming_config : Optional [types .RedTeamingAnalysisConfigOrDict ] = None ,
26192636 config : Optional [types .CreateEvaluationRunConfigOrDict ] = None ,
26202637 ) -> types .EvaluationRun :
26212638 """Creates an EvaluationRun.
@@ -2734,6 +2751,9 @@ def create_evaluation_run(
27342751 loss_analysis_configs = loss_analysis_configs ,
27352752 inference_configs = inference_configs ,
27362753 )
2754+ resolved_analysis_configs = _evals_utils ._resolve_red_teaming_config (
2755+ red_teaming_config
2756+ )
27372757 evaluation_config = types .EvaluationRunConfig (
27382758 output_config = output_config ,
27392759 metrics = resolved_metrics ,
@@ -2751,6 +2771,7 @@ def create_evaluation_run(
27512771 data_source = resolved_dataset ,
27522772 evaluation_config = evaluation_config ,
27532773 inference_configs = resolved_inference_configs ,
2774+ analysis_configs = resolved_analysis_configs ,
27542775 labels = resolved_labels ,
27552776 config = config ,
27562777 )
@@ -3299,6 +3320,7 @@ async def _create_evaluation_run(
32993320 dict [str , types .EvaluationRunInferenceConfigOrDict ]
33003321 ] = None ,
33013322 config : Optional [types .CreateEvaluationRunConfigOrDict ] = None ,
3323+ analysis_configs : Optional [list [types .AnalysisConfigOrDict ]] = None ,
33023324 ) -> types .EvaluationRun :
33033325 """
33043326 Creates an EvaluationRun.
@@ -3312,6 +3334,7 @@ async def _create_evaluation_run(
33123334 labels = labels ,
33133335 inference_configs = inference_configs ,
33143336 config = config ,
3337+ analysis_configs = analysis_configs ,
33153338 )
33163339
33173340 request_url_dict : Optional [dict [str , str ]]
@@ -4395,6 +4418,7 @@ async def create_evaluation_run(
43954418 inference_configs : Optional [
43964419 dict [str , types .EvaluationRunInferenceConfigOrDict ]
43974420 ] = None ,
4421+ red_teaming_config : Optional [types .RedTeamingAnalysisConfigOrDict ] = None ,
43984422 labels : Optional [dict [str , str ]] = None ,
43994423 loss_analysis_metrics : Optional [list [Union [str , types .MetricOrDict ]]] = None ,
44004424 loss_analysis_configs : Optional [list [types .LossAnalysisConfigOrDict ]] = None ,
@@ -4426,6 +4450,11 @@ async def create_evaluation_run(
44264450 this will be automatically constructed using `agent_info` and `user_simulator_config`.
44274451 Example:
44284452 {"candidate-1": types.EvaluationRunInferenceConfig(model="gemini-2.5-flash")}
4453+ red_teaming_config: This field is experimental and may change in future
4454+ versions. Optional configuration for automated Agent Red Teaming
4455+ analysis. Specifies attack categories and vulnerable tools to
4456+ test. When provided, the server runs a red teaming pipeline
4457+ instead of standard evaluation metrics.
44294458 labels: The labels to apply to the evaluation run.
44304459 loss_analysis_metrics: This field is experimental and may change in future
44314460 versions. Optional list of metrics to run loss analysis on. The
@@ -4511,6 +4540,9 @@ async def create_evaluation_run(
45114540 loss_analysis_configs = loss_analysis_configs ,
45124541 inference_configs = inference_configs ,
45134542 )
4543+ resolved_analysis_configs = _evals_utils ._resolve_red_teaming_config (
4544+ red_teaming_config
4545+ )
45144546 evaluation_config = types .EvaluationRunConfig (
45154547 output_config = output_config ,
45164548 metrics = resolved_metrics ,
@@ -4529,6 +4561,7 @@ async def create_evaluation_run(
45294561 data_source = resolved_dataset ,
45304562 evaluation_config = evaluation_config ,
45314563 inference_configs = resolved_inference_configs ,
4564+ analysis_configs = resolved_analysis_configs ,
45324565 labels = resolved_labels ,
45334566 config = config ,
45344567 )
0 commit comments