fix: remove duplicate FINAL ANSWER output in CLI query#263
Open
octo-patch wants to merge 1 commit intozilliztech:masterfrom
Open
fix: remove duplicate FINAL ANSWER output in CLI query#263octo-patch wants to merge 1 commit intozilliztech:masterfrom
octo-patch wants to merge 1 commit intozilliztech:masterfrom
Conversation
…ech#246) The query() method in each agent (deep_search, naive_rag, chain_of_rag) already prints the '==== FINAL ANSWER====' header and answer content as part of its execution. cli.py was printing it a second time after the call returned, causing duplicate output in the terminal. Remove the redundant print from cli.py; keep only the References section which is unique to the CLI.
Collaborator
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: octo-patch The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Author
|
/assign @xiaofan-luan |
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.
Fixes #246
Problem
When running
deepsearcher query, the final answer is printed twice to the console:DeepSearch,NaiveRAG,ChainOfRAG) already prints==== FINAL ANSWER====and the answer content inside its ownquery()method as part of the streaming thought-process output.cli.pythen prints==== FINAL ANSWER====and the same answer again afterquery()returns.The second print also includes a
### Referencessection with different content (references are shown the second time but not the first), making the duplication even more confusing.Solution
Remove the redundant
==== FINAL ANSWER====header and answer body fromcli.py. The agents already handle printing the answer. The### Referencessection is kept incli.pysince it is not printed by the agents.Testing
Traced the execution path for
deepsearcher query "...":cli.pycallsonline_query.query()→default_searcher.query()==== FINAL ANSWER====+ answer during executioncli.pyno longer re-prints the same content; only appends the references list