-
Notifications
You must be signed in to change notification settings - Fork 4k
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
WIP! add a silent option to GroupChatManager to reduce noise on the command line #2212
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2212 +/- ##
==========================================
+ Coverage 37.98% 47.95% +9.96%
==========================================
Files 75 77 +2
Lines 7589 7712 +123
Branches 1636 1791 +155
==========================================
+ Hits 2883 3698 +815
+ Misses 4463 3701 -762
- Partials 243 313 +70
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@@ -74,6 +74,7 @@ def custom_speaker_selection_func( | |||
speaker_transitions_type: Literal["allowed", "disallowed", None] = None | |||
enable_clear_history: Optional[bool] = False | |||
send_introductions: bool = False | |||
silent: bool = False |
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.
Argument is not used in this class
@@ -516,6 +517,7 @@ def __init__( | |||
max_consecutive_auto_reply: Optional[int] = sys.maxsize, | |||
human_input_mode: Optional[str] = "NEVER", | |||
system_message: Optional[Union[str, List]] = "Group chat manager.", | |||
silent: Optional[bool] = False, |
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.
you need to add an object variable self._silent = silent
in the init for it to be useable in the rest of the class
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.
silent: Optional[bool] = False, | |
silent: bool = False, |
@@ -596,7 +598,7 @@ def run_chat( | |||
# Broadcast the intro | |||
intro = groupchat.introductions_msg() | |||
for agent in groupchat.agents: | |||
self.send(intro, agent, request_reply=False, silent=True) | |||
self.send(intro, agent, request_reply=False, silent=self.silent) |
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.
self.send(intro, agent, request_reply=False, silent=self.silent) | |
self.send(intro, agent, request_reply=False, silent=self._silent) |
@@ -671,7 +673,7 @@ async def a_run_chat( | |||
# Broadcast the intro | |||
intro = groupchat.introductions_msg() | |||
for agent in groupchat.agents: | |||
await self.a_send(intro, agent, request_reply=False, silent=True) | |||
await self.a_send(intro, agent, request_reply=False, silent=self.silent) |
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.
await self.a_send(intro, agent, request_reply=False, silent=self.silent) | |
await self.a_send(intro, agent, request_reply=False, silent=self._silent) |
@@ -689,7 +691,7 @@ async def a_run_chat( | |||
# broadcast the message to all agents except the speaker | |||
for agent in groupchat.agents: | |||
if agent != speaker: | |||
await self.a_send(message, agent, request_reply=False, silent=True) | |||
await self.a_send(message, agent, request_reply=False, silent=self.silent) |
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.
await self.a_send(message, agent, request_reply=False, silent=self.silent) | |
await self.a_send(message, agent, request_reply=False, silent=self._silent) |
@@ -710,7 +712,7 @@ async def a_run_chat( | |||
if reply is None: | |||
break | |||
# The speaker sends the message without requesting a reply | |||
await speaker.a_send(reply, self, request_reply=False) | |||
await speaker.a_send(reply, self, request_reply=False, silent=self.silent) |
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.
await speaker.a_send(reply, self, request_reply=False, silent=self.silent) | |
await speaker.a_send(reply, self, request_reply=False, silent=self._silent) |
@@ -516,6 +517,7 @@ def __init__( | |||
max_consecutive_auto_reply: Optional[int] = sys.maxsize, | |||
human_input_mode: Optional[str] = "NEVER", | |||
system_message: Optional[Union[str, List]] = "Group chat manager.", | |||
silent: Optional[bool] = False, | |||
**kwargs, | |||
): | |||
if ( |
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.
if ( | |
self._silent = silent | |
if ( |
Just a reminder, you can take a look at the recent changes in conversable agent: using iostream instead of print for info output to websocket |
@jtoy I noticed this open PR for the functionality we're both interested in. Do you have plans to wrap it up soon? I'd be happy to help finish it if you're tied up with other commitments. |
Resolved/replaced via #2712 |
Why are these changes needed?
This will make management on the CLI easier. It is not done yet.
Related issue number
Closes #1335
Checks