Skip to content

.NET: Python: [Bug]: Azure AI Search citations return generic titles (doc_0, doc_1) instead of index field values #4418

@Pavan-Microsoft

Description

@Pavan-Microsoft

Description

When using AzureAIProjectAgentProvider with Azure AI Search, citation titles always return as doc_0, doc_1, etc. instead of actual field values from the index.

Is there a way to configure field_mapping (like titleField, urlField) on AISearchIndexResource to control which index fields are used for citation titles and URLs — similar to what the Azure AI Foundry SDK supported?
field_mapping = {
"titleField": "chunk_id",
"urlField": "sourceurl",
"contentFields": ["content"],
}

Code Sample

# Index config used when creating the agent
AzureAISearchAgentTool(
                        azure_ai_search=AzureAISearchToolResource(
                            indexes=[
                                AISearchIndexResource(
                                    project_connection_id=azure_ai_search_connection_name,
                                    index_name=azure_ai_search_index,
                                    query_type="vector_simple",
                                    top_k=5
                                )
                            ]
                        )
                    )

# Citation received at runtime
{'type': 'citation',
  'title': 'doc_0',   # <-- always generic, not from index
  'url': 'https://srch-example.search.windows.net/',
  'additional_properties': {
    'annotation_index': 0,
    'get_url': 'https://srch-example.search.windows.net/indexes/call_trans_index/docs/03cbc5cb_01?...$select=id,chunk_id,content,sourceurl'
  }, 'raw_representation': {'type': 'url_citation', 'end_index': 1001, 'start_index': 989, 'title': 'doc_0', 'url': 'https://srch-example.search.windows.net/'}, 'annotated_regions': [{'type': 'text_span', 'start_index': 989, 'end_index': 1001}]}


Is field_mapping (or equivalent) supported in agent-framework? If not, can it be added to AISearchIndexResource?

Error Messages / Stack Traces

No error — the citation object is returned successfully but with generic doc_N titles instead of real index field values.

Package Versions

agent-framework-core==1.0.0rc2 agent-framework-azure-ai==1.0.0rc2

Python Version

Python 3.11

Additional Context

Reference sample used: azure_ai_with_azure_ai_search.py
The get_url in additional_properties does contain the document-specific URL, but the title is not populated from index fields.

Metadata

Metadata

Assignees

Labels

Type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions