-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -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 | ||||||||
|
||||||||
_VALID_SPEAKER_SELECTION_METHODS = ["auto", "manual", "random", "round_robin"] | ||||||||
_VALID_SPEAKER_TRANSITIONS_TYPE = ["allowed", "disallowed", None] | ||||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. you need to add an object variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
**kwargs, | ||||||||
): | ||||||||
if ( | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
# NOTE: We do not also append to groupchat.messages, | ||||||||
# since groupchat handles its own introductions | ||||||||
|
||||||||
|
@@ -609,7 +611,7 @@ def run_chat( | |||||||
# broadcast the message to all agents except the speaker | ||||||||
for agent in groupchat.agents: | ||||||||
if agent != speaker: | ||||||||
self.send(message, agent, request_reply=False, silent=True) | ||||||||
self.send(message, agent, request_reply=False) | ||||||||
if self._is_termination_msg(message) or i == groupchat.max_round - 1: | ||||||||
# The conversation is over or it's the last round | ||||||||
break | ||||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
# NOTE: We do not also append to groupchat.messages, | ||||||||
# since groupchat handles its own introductions | ||||||||
|
||||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
if i == groupchat.max_round - 1: | ||||||||
# the last round | ||||||||
break | ||||||||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
message = self.last_message(speaker) | ||||||||
if self.client_cache is not None: | ||||||||
for a in groupchat.agents: | ||||||||
|
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