Skip to content

Commit 621e8e3

Browse files
1aifanaticclaude
andauthored
Python: pass judge model in evaluate_traces sample (#9576)
evaluate_traces() requires a keyword-only `model` argument for the evaluator LLM judge. The sample omitted it, so both calls raised TypeError before reaching Foundry. Reuse the FOUNDRY_MODEL deployment the sample already reads for the chat client. Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 6ae0f40 commit 621e8e3

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

‎python/samples/05-end-to-end/evaluation/foundry_evals/evaluate_traces_sample.py‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@
2727

2828

2929
async def main() -> None:
30-
# 1. Set up the chat client
30+
# 1. Set up the chat client. evaluate_traces() also needs the model
31+
# deployment that Foundry should use as the evaluator LLM judge.
32+
model = os.environ.get("FOUNDRY_MODEL", "gpt-4o")
3133
chat_client = FoundryChatClient(
3234
project_endpoint=os.environ["FOUNDRY_PROJECT_ENDPOINT"],
33-
model=os.environ.get("FOUNDRY_MODEL", "gpt-4o"),
35+
model=model,
3436
credential=AzureCliCredential(),
3537
)
3638

@@ -54,6 +56,7 @@ async def main() -> None:
5456
response_ids=response_ids,
5557
evaluators=[FoundryEvals.RELEVANCE, FoundryEvals.GROUNDEDNESS, FoundryEvals.TOOL_CALL_ACCURACY],
5658
client=chat_client,
59+
model=model,
5760
)
5861

5962
print(f"Status: {results.status}")
@@ -78,6 +81,7 @@ async def main() -> None:
7881
response_ids=response_ids,
7982
evaluators=[FoundryEvals.RELEVANCE, FoundryEvals.COHERENCE],
8083
client=chat_client,
84+
model=model,
8185
)
8286

8387
print(f"Status: {results.status}")
@@ -88,6 +92,7 @@ async def main() -> None:
8892
# agent_id="travel-bot",
8993
# evaluators=[FoundryEvals.INTENT_RESOLUTION, FoundryEvals.TASK_ADHERENCE],
9094
# client=chat_client,
95+
# model=model,
9196
# lookback_hours=24,
9297
# )
9398

0 commit comments

Comments
 (0)