Skip to content

Update sample human evaluations code with agent identifiers#47441

Closed
seangayler-msft wants to merge 16 commits into
mainfrom
feature/azure-ai-projects/update-human-evals-sample
Closed

Update sample human evaluations code with agent identifiers#47441
seangayler-msft wants to merge 16 commits into
mainfrom
feature/azure-ai-projects/update-human-evals-sample

Conversation

@seangayler-msft

Copy link
Copy Markdown

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.name
  • gen_ai.agent.id

Both 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:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

Copilot AI review requested due to automatic review settings June 10, 2026 19:47
@seangayler-msft seangayler-msft changed the base branch from main to feature/azure-ai-projects/2.3.0 June 10, 2026 19:48

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_version inputs to the sample emit helpers and emitted gen_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 thread sdk/ai/azure-ai-projects/samples/evaluations/sample_human_evaluations.py Outdated
Comment thread sdk/ai/azure-ai-projects/samples/evaluations/sample_human_evaluations.py Outdated
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)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
YoYoJa previously approved these changes Jun 10, 2026
@seangayler-msft seangayler-msft changed the base branch from feature/azure-ai-projects/2.3.0 to main June 10, 2026 21:05
@seangayler-msft seangayler-msft dismissed YoYoJa’s stale review June 10, 2026 21:05

The base branch was changed.

@seangayler-msft

Copy link
Copy Markdown
Author

Closing in favor of this #47444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants