Skip to content

Conversation

@M-Hietala
Copy link
Contributor

add tracing support for structured output agent creation

Copilot AI review requested due to automatic review settings November 26, 2025 19:57
Copilot finished reviewing on behalf of M-Hietala November 26, 2025 20:00
Copy link
Contributor

Copilot AI left a comment

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 adds tracing support for structured output in agent creation. When agents are created with a JSON schema for structured output (using ResponseTextFormatConfigurationJsonSchema), the schema is now captured in telemetry events alongside any instructions, enabling better observability of agent configuration.

Key Changes

  • Enhanced the _add_instructions_event method to accept and serialize response schemas
  • Modified start_create_agent_span to extract schemas from the text parameter's format configuration
  • Added comprehensive test coverage for all combinations of instructions/schema presence and content recording settings

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/ai/azure-ai-projects/azure/ai/projects/telemetry/_ai_project_instrumentor.py Modified _add_instructions_event to handle response schemas; updated start_create_agent_span to extract and pass schema from text.format.schema
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor_async.py Added 4 async test cases covering structured output scenarios with/without instructions and content recording enabled/disabled
sdk/ai/azure-ai-projects/tests/agents/telemetry/test_ai_agents_instrumentor.py Added 4 sync test cases mirroring the async tests for comprehensive coverage
sdk/ai/azure-ai-projects/CHANGELOG.md Documented new tracing feature for structured output agents
sdk/ai/azure-ai-projects/assets.json Updated asset tag reference for test recordings

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

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.

3 participants