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

Made a configurable constant #1819

Merged
merged 2 commits into from
Mar 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions autogen/agentchat/groupchat.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ class GroupChat:
_VALID_SPEAKER_SELECTION_METHODS = ["auto", "manual", "random", "round_robin"]
_VALID_SPEAKER_TRANSITIONS_TYPE = ["allowed", "disallowed", None]

# Define a class attribute for the default introduction message
DEFAULT_INTRO_MSG = (
"Hello everyone. We have assembled a great team today to answer questions and solve tasks. In attendance are:"
)

allowed_speaker_transitions_dict: Dict = field(init=False)

def __post_init__(self):
Expand Down Expand Up @@ -236,10 +241,11 @@ def introductions_msg(self, agents: Optional[List[Agent]] = None) -> str:
if agents is None:
agents = self.agents

return f"""Hello everyone. We have assembled a great team today to answer questions and solve tasks. In attendance are:
# Use the class attribute instead of a hardcoded string
intro_msg = self.DEFAULT_INTRO_MSG
participant_roles = self._participant_roles(agents)

{self._participant_roles(agents)}
"""
return f"{intro_msg}\n\n{participant_roles}"

def manual_select_speaker(self, agents: Optional[List[Agent]] = None) -> Union[Agent, None]:
"""Manually select the next speaker."""
Expand Down
Loading