-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Added an 'auto' mode to last_n_messages #693
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #693 +/- ##
==========================================
+ Coverage 28.70% 37.19% +8.49%
==========================================
Files 27 27
Lines 3383 3393 +10
Branches 760 764 +4
==========================================
+ Hits 971 1262 +291
+ Misses 2341 2014 -327
- Partials 71 117 +46
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Looks good. Small nit pick: will be good to say last n used messages
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.
Nice PR. Could you add a test to cover the new code? In test_groupchat.py.
Done :) |
* Added an 'auto' mode to last_n_messages * Added tests for the last_n_messages = 'auto' mode * Added test one additional test case that was overlooked.
Why are these changes needed?
At present, code execution will scan back n messages to find code to run. Here, n is fixed at the time the agent is created (and it defaults to 1). This code make this scanning dynamic, by searching through all the "new" messages that arrived since the agent last spoke (which is also typically when it last tried to execute code).
Related issue number
This, together with #688, and #669, will likely address many issues related to user_proxy spam (issue: #624)
Checks