Skip to content

Conversation

@Pavan-Microsoft
Copy link
Contributor

Purpose

This pull request primarily updates how citation markers are handled and formatted in agent responses, ensuring stricter adherence to source data and improving the mapping and filtering of citations. It also introduces a temperature parameter for search agents to control response variability.

Citation handling and formatting improvements:

  • Refined the agent_instructions in conversation_agent_factory.py to clarify that citation markers and the citations list must not be modified, normalized, or simplified, and that only the plugin is responsible for their formatting and content. Added instructions for omitting citations when using conversation history without tools/plugins.
  • In chat_with_data_plugin.py, replaced the previous citation marker conversion logic with a new mapping system that assigns sequential indices to citation markers as they appear, ensuring that only used citations are included and reordered accordingly in the final response. [1] [2]

Agent configuration:

  • Added a temperature=0.7 parameter when creating agents in search_agent_factory.py to control the randomness of generated responses.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

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

Fixes mismatches between citation numbers shown in agent answers and the corresponding referenced links by tightening citation-marker handling and adjusting agent configuration.

Changes:

  • Reworked citation-marker remapping in ChatWithDataPlugin.get_call_insights() to renumber markers sequentially and filter citations to only those used.
  • Updated ConversationAgentFactory instructions to discourage citation normalization and to omit citations when responding from conversation history without tools.
  • Set a non-zero temperature for the search agent to increase response variability.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
src/api/plugins/chat_with_data_plugin.py Adds citation-marker remapping + citation list filtering/reordering logic for search answers.
src/api/agents/search_agent_factory.py Sets temperature=0.7 when creating the Azure AI Search agent.
src/api/agents/conversation_agent_factory.py Refines agent instructions around citation handling and when to omit citations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Pavan-Microsoft Pavan-Microsoft marked this pull request as ready for review January 23, 2026 10:12
@Avijit-Microsoft Avijit-Microsoft merged commit 824a769 into dev Jan 23, 2026
7 checks passed
@Pavan-Microsoft Pavan-Microsoft deleted the pk-km-citationissue branch January 23, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants