Update sample human evaluations code with agent identifiers - #47444
Closed
seangayler-msft wants to merge 1 commit into
Closed
Update sample human evaluations code with agent identifiers#47444seangayler-msft wants to merge 1 commit into
seangayler-msft wants to merge 1 commit into
Conversation
seangayler-msft
requested review from
bobogogo1990,
dargilco,
glharper,
howieleung,
kingernupur,
nick863,
trangevi and
trrwilson
as code owners
June 10, 2026 21:14
6 tasks
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the azure-ai-projects human-evaluations sample and its tests to require agent metadata and to emit agent identifiers on the gen_ai.evaluation.result event, enabling correlation of human evaluation results back to a specific agent.
Changes:
- Require
agent_nameandagent_versionparameters for the human-evaluation helper functions in the sample. - Emit
gen_ai.agent.nameandgen_ai.agent.idin the generated evaluation event attributes. - Update tests to (a) assert missing agent metadata raises
TypeErrorand (b) validate the emitted agent identifiers.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
sdk/ai/azure-ai-projects/tests/evaluations/test_human_evaluations.py |
Adds agent metadata constants/wrappers, verifies missing agent metadata fails fast, and asserts emitted agent attributes. |
sdk/ai/azure-ai-projects/samples/evaluations/sample_human_evaluations.py |
Extends sample API to take agent metadata and emits gen_ai.agent.* attributes on human evaluation events. |
Comment on lines
+203
to
205
| "gen_ai.agent.name": agent_name, | ||
| "gen_ai.agent.id": f"{agent_name}:{agent_version}", | ||
| "microsoft.gen_ai.human_evaluation.source": "end_user", |
Comment on lines
+141
to
+143
| assert attrs["gen_ai.agent.name"] == AGENT_NAME | ||
| assert attrs["gen_ai.agent.id"] == AGENT_ID | ||
| assert "gen_ai.agent.version" not in attrs |
seangayler-msft
force-pushed
the
feature/azure-ai-projects/fix-human-evals-sample
branch
from
June 10, 2026 21:32
f6c6efe to
9a1b2ec
Compare
Author
|
Discussed change with team. Change not needed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This follows #46962 to add agent identifiers to the human evaluation results. This is essential for correlating evaluation results back to an agent, which is what automated evaluators do.
It specifically adds these attributes:
gen_ai.agent.namegen_ai.agent.idBoth of which are documented in the OTel spec here: https://github.com/open-telemetry/semantic-conventions/blob/785e90b5bcea04072eb000b04ec4fc9c9608e76c/docs/registry/attributes/gen-ai.md
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines