Python: Enhance Azure AI Search Citations with Complete URL Information#2066
Merged
giles17 merged 11 commits intomicrosoft:mainfrom Nov 13, 2025
Merged
Python: Enhance Azure AI Search Citations with Complete URL Information#2066giles17 merged 11 commits intomicrosoft:mainfrom
giles17 merged 11 commits intomicrosoft:mainfrom
Conversation
Member
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances Azure AI Search tool integration to provide complete URL information in citation annotations, replacing placeholder references like "doc_0" with actual document URLs from Azure AI Search responses.
Key Changes:
- Enhanced citation mechanism to capture and include Azure AI Search tool call metadata in
raw_representation - Added infrastructure to capture tool execution data when Azure AI Search steps complete
- Updated sample to demonstrate extracting actual URLs from enhanced citation data
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py |
Implements core functionality: _capture_azure_search_tool_calls() captures tool execution data, _enhance_raw_representation_with_azure_search() enriches citations with tool call metadata, and _process_stream() coordinates the capture process |
python/packages/azure-ai/tests/test_azure_ai_agent_client.py |
Adds unit tests for the new citation enhancement methods and initializes _azure_search_tool_calls in test helper |
python/samples/getting_started/agents/azure_ai/azure_ai_with_azure_ai_search.py |
Demonstrates extracting actual URLs from enhanced citation data using the new azure_ai_search_tool_calls field in raw_representation |
python/samples/getting_started/agents/azure_ai/azure_ai_with_file_search.py |
Refactors API calls from client.project_client.agents to client.agents_client (unrelated to PR's main purpose) |
python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started/agents/azure_ai/azure_ai_with_azure_ai_search.py
Outdated
Show resolved
Hide resolved
python/samples/getting_started/agents/azure_ai/azure_ai_with_azure_ai_search.py
Outdated
Show resolved
Hide resolved
python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py
Outdated
Show resolved
Hide resolved
python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py
Outdated
Show resolved
Hide resolved
python/packages/azure-ai/agent_framework_azure_ai/_chat_client.py
Outdated
Show resolved
Hide resolved
eavanvalkenburg
approved these changes
Nov 12, 2025
…/agent-framework into azure_ai_search_citation
dmytrostruk
approved these changes
Nov 13, 2025
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…on (microsoft#2066) * add get_url to raw rep for absolute path url * fixes * add real url to citation annotation * small fix * project client + openapi fix * openapi sample revert * tool call list fix
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.
Motivation and Context
Enhances Azure AI Search tool integration to provide complete URL information in citation annotations, allowing customers to access actual document URLs instead of placeholder references like "doc_0".
Key Changes
_extract_url_citationsto populatecitation.urlwith real document URLs from Azure AI Search tool calls_capture_azure_search_tool_callsto store Azure AI Search execution metadataAddresses #1889
Description
Contribution Checklist