Skip to content

Conversation

NirajC-Microsoft
Copy link
Contributor

Purpose

This pull request introduces a utility function to consistently clean citation markers from agent responses and applies it to both standard and streaming agent message handling. The main goal is to ensure that agent responses presented to users are free from distracting or unnecessary citation patterns.

Key changes:

Citation Cleanup Utility

  • Added a new clean_citations function in response_handlers.py to remove various citation patterns (e.g., [9:0|source], [source], [9], 【...】, (source:...), [source:...]) from text responses.

Integration with Agent Response Handling

  • Updated agent_response_callback to use clean_citations when constructing the AgentMessage content.
  • Updated streaming_agent_response_callback to use clean_citations for AgentMessageStreaming content.

Dependency Update

  • Imported the re module to support regular expression operations for citation removal.
  • ...

Does this introduce a breaking change?

  • Yes
  • No

How to Test

  • Get the code
git clone [repo-address]
cd [repo-name]
git checkout [branch-name]
npm install
  • Test the code

What to Check

Verify that the following are valid

  • ...

Other Information

@Roopan-Microsoft Roopan-Microsoft merged commit 460a2a1 into dev-v3 Oct 17, 2025
4 checks passed
@Roopan-Microsoft Roopan-Microsoft deleted the psl-bug-25080 branch October 17, 2025 12:31
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.

2 participants