Update sample human evaluations code with agent identifiers#47441
Closed
seangayler-msft wants to merge 16 commits into
Closed
Update sample human evaluations code with agent identifiers#47441seangayler-msft wants to merge 16 commits into
seangayler-msft wants to merge 16 commits into
Conversation
* sample update routines * Add test for routines samples and update sample skipping logic
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the azure-ai-projects human evaluation sample (and its unit tests) to include OpenTelemetry GenAI agent identifiers on emitted gen_ai.evaluation.result events, enabling correlation of human evaluation results back to a specific agent.
Changes:
- Added required
agent_name/agent_versioninputs to the sample emit helpers and emittedgen_ai.agent.name+gen_ai.agent.id. - Updated the sample’s runnable
__main__example to pass agent metadata. - Updated unit tests to enforce agent metadata is required and to validate the new emitted attributes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
sdk/ai/azure-ai-projects/tests/evaluations/test_human_evaluations.py |
Wraps sample emitters to always include agent metadata; adds assertions and tests covering required agent fields and new attributes. |
sdk/ai/azure-ai-projects/samples/evaluations/sample_human_evaluations.py |
Extends sample event emission to include gen_ai.agent.name and gen_ai.agent.id, and updates sample docs/usage accordingly. |
Comment on lines
+31
to
+32
| def emit_5_point_ordinal_evaluation(**kwargs: Any) -> None: | ||
| _sample_emit_5_point_ordinal_evaluation(agent_name=AGENT_NAME, agent_version=AGENT_VERSION, **kwargs) |
Author
There was a problem hiding this comment.
This sample will significantly rehauled in the future when we provide a dedicated API interface for leaving human evaluations. I don't think this change is necessary now.
YoYoJa
previously approved these changes
Jun 10, 2026
Author
|
Closing in favor of this #47444 |
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