From a22d1cad50b3630b3a42956f533e885e223a3610 Mon Sep 17 00:00:00 2001 From: RohitRathore1 Date: Thu, 29 Feb 2024 04:02:14 +0000 Subject: [PATCH 1/2] Made a configurable constant --- autogen/agentchat/groupchat.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/autogen/agentchat/groupchat.py b/autogen/agentchat/groupchat.py index 5997b093a36..e4d0bf60146 100644 --- a/autogen/agentchat/groupchat.py +++ b/autogen/agentchat/groupchat.py @@ -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): @@ -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.""" From d18bb6aaacbd2e642cbb2c4d8d528836cbb11851 Mon Sep 17 00:00:00 2001 From: Rohit Singh Rathaur Date: Fri, 8 Mar 2024 11:57:48 +0100 Subject: [PATCH 2/2] Fix typo Co-authored-by: Joshua Kim --- autogen/agentchat/groupchat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autogen/agentchat/groupchat.py b/autogen/agentchat/groupchat.py index e4d0bf60146..9d0ace25042 100644 --- a/autogen/agentchat/groupchat.py +++ b/autogen/agentchat/groupchat.py @@ -241,7 +241,7 @@ def introductions_msg(self, agents: Optional[List[Agent]] = None) -> str: if agents is None: agents = self.agents - # USe the class attribute instead of a hardcoded string + # Use the class attribute instead of a hardcoded string intro_msg = self.DEFAULT_INTRO_MSG participant_roles = self._participant_roles(agents)