-
Notifications
You must be signed in to change notification settings - Fork 273
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@giorgossideris] Add prompt rewriting for multiple messages in ReasoningAgent #1140
Conversation
* Enable code execution in reasoning agent 1. enable code execution 2. remove the "verbose" parameter, and replace with AG2's default "silent" parameter. * init _user_proxy * notebook update * notebook update * add test case for running code in reasoning agent * use mock credential for reasoning test * reasoning prompt update * mock credentials for more tests * Update .secrets.baseline * clear notebook outputs * remove variable F
* Enable code execution in reasoning agent 1. enable code execution 2. remove the "verbose" parameter, and replace with AG2's default "silent" parameter. * init _user_proxy * notebook update * notebook update * add test case for running code in reasoning agent * use mock credential for reasoning test * reasoning prompt update * mock credentials for more tests * Update .secrets.baseline * clear notebook outputs * remove variable F
* Fix swarm tests by including transit messages * Fix for Gemini library for async use * pre-commit fix
* Enable code execution in reasoning agent 1. enable code execution 2. remove the "verbose" parameter, and replace with AG2's default "silent" parameter. * init _user_proxy * notebook update * notebook update * add test case for running code in reasoning agent * use mock credential for reasoning test * reasoning prompt update * mock credentials for more tests * Update .secrets.baseline * clear notebook outputs * remove variable F
* Enable code execution in reasoning agent 1. enable code execution 2. remove the "verbose" parameter, and replace with AG2's default "silent" parameter. * init _user_proxy * notebook update * notebook update * add test case for running code in reasoning agent * use mock credential for reasoning test * reasoning prompt update * mock credentials for more tests * Update .secrets.baseline * clear notebook outputs * remove variable F
* Enable code execution in reasoning agent 1. enable code execution 2. remove the "verbose" parameter, and replace with AG2's default "silent" parameter. * init _user_proxy * notebook update * notebook update * add test case for running code in reasoning agent * use mock credential for reasoning test * reasoning prompt update * mock credentials for more tests * Update .secrets.baseline * clear notebook outputs * remove variable F
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments, and I think I spotted a bug elsewhere
Hello @alecsolder thank you for your detailed review! Before handling the proposed changes I would like to verify that this approach is the way to go. As I mentioned in the #755 another way to address this issue would be to modify the input of However, there may be a specific reason behind the current structuring of the arguments, so I’d love to hear your thoughts on this (@alecsolder, @BabyCNM, @Hk669). If you consider that the current approach is preferable, I will work on the proposed changes! |
@giorgossideris Thanks for your prompt reply! Your branch is protected, so I can’t modify your code directly. As a result, I had to create a separate branch and PR. In the future, you can enable the “Allow edits by maintainers” option when creating a PR, which would allow us to make direct modifications to your code. Regarding where to store the chat history, the prompt variable in functions like mcts_reply is a suitable place. However, it requires concatenating all messages into a single string rather than passing a list (messages). Otherwise, some LLMs might misinterpret the chat history as “few-shot examples” and ignore the system message (e.g., instructions to provide options or evaluate choices). I prefer your approach because it condenses the chat history efficiently, reducing token usage for some LLMs (though the savings are minimal for OpenAI models since cached tokens are inexpensive). Additionally, it helps summarize key reasoning from previous steps. Please proceed with any reasonable changes you find necessary, and feel free to ignore or resolve comments that are not applicable. Thanks again! |
@giorgossideris could you please reply and/or resolve comments made by @alecsolder above? |
Yes, I will do so today. |
@davorrunje I opened a PR to resolve the remained comments. |
This rewriting: 1) generalizes 'STEPS ALREADY EXECUTED' to 'ACTIVITY LOG', and 2) generalizes 'current/last question asked by the user' to 'current/last question to be addressed'
…g-prompt-ag2 [comments handling] Add prompt rewriting for multiple messages in ReasoningAgent
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
Why are these changes needed?
Main Contributor: @giorgossideris
Duplicates #758 and finish the pre-commit checks.
Resolve the issue: #755
Related issue number
Checks