Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

jtoy
Copy link
Collaborator

@jtoy jtoy commented Mar 30, 2024

Why are these changes needed?

This will make management on the CLI easier. It is not done yet.

Related issue number

Closes #1335

Checks

@codecov-commenter
Copy link

codecov-commenter commented Mar 30, 2024

Codecov Report

Attention: Patch coverage is 50.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 47.95%. Comparing base (5ef2dfc) to head (f1ebd63).
Report is 12 commits behind head on main.

Files Patch % Lines
autogen/agentchat/groupchat.py 50.00% 3 Missing ⚠️
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     
Flag Coverage Δ
unittest 14.21% <16.66%> (?)
unittests 46.88% <50.00%> (+8.91%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -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
Copy link
Collaborator

@WaelKarkoub WaelKarkoub Apr 1, 2024

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,
Copy link
Collaborator

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

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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 (
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (
self._silent = silent
if (

@ekzhu
Copy link
Collaborator

ekzhu commented Apr 1, 2024

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

@robraux
Copy link
Collaborator

robraux commented May 14, 2024

@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.

@robraux
Copy link
Collaborator

robraux commented May 24, 2024

Resolved/replaced via #2712

@robraux robraux closed this May 24, 2024
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.

[Feature Request]: allow silent=True while initiating a group chat
5 participants