Apply suggestions from code review

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
chetantoshniwal
2026-04-13 15:20:58 -07:00
committed by GitHub
Unverified
parent d907590494
commit bab4c9ad76
3 changed files with 4 additions and 2 deletions
@@ -1732,6 +1732,8 @@ async def evaluate_workflow(
if workflow_result is None and queries is None:
raise ValueError("Provide either 'workflow_result' or 'queries'.")
if expected_output is not None and queries is None:
raise ValueError("Provide 'queries' when using 'expected_output'; 'expected_output' is not supported with 'workflow_result' only.")
if expected_output is not None and queries is not None and len(expected_output) != len(queries):
raise ValueError(f"Got {len(queries)} queries but {len(expected_output)} expected_output values.")
@@ -692,7 +692,7 @@ class FoundryEvals:
]
if item.context:
d["context"] = item.context
if item.expected_output:
if item.expected_output is not None:
d["ground_truth"] = item.expected_output
dicts.append(d)
@@ -5,7 +5,7 @@
This sample demonstrates three patterns:
1. Post-hoc: Run the workflow, then evaluate the result you already have.
2. Run + evaluate: Pass queries and let evaluate_workflow() run the workflow for you.
3. Similarity: Evaluate an agent's output against ground-truth reference answers.
3. Similarity: Evaluate the workflow's final output against ground-truth reference answers.
Patterns 1 & 2 return a list of results (one per provider), each with a per-agent
breakdown in sub_results so you can identify which agent is underperforming.