Skip to content

Commit 0c70de8

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Add support for passing agent data for custom code execution metric
PiperOrigin-RevId: 886462684
1 parent 1c50bab commit 0c70de8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

vertexai/_genai/_evals_metric_handlers.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,7 @@ def _build_request_payload(
11891189
eval_case, response_index, self.metric.name
11901190
)
11911191

1192-
if not response_content:
1192+
if not response_content and not getattr(eval_case, "agent_data", None):
11931193
raise ValueError(
11941194
f"Response content missing for candidate {response_index}."
11951195
)
@@ -1211,6 +1211,7 @@ def _build_request_payload(
12111211
response_content
12121212
),
12131213
reference=reference_instance_data,
1214+
agent_data=PredefinedMetricHandler._eval_case_to_agent_data(eval_case),
12141215
)
12151216

12161217
return {

0 commit comments

Comments
 (0)