diff --git a/autogen/agentchat/groupchat.py b/autogen/agentchat/groupchat.py index 832c5fd68be..a26f657982a 100644 --- a/autogen/agentchat/groupchat.py +++ b/autogen/agentchat/groupchat.py @@ -78,6 +78,11 @@ def custom_speaker_selection_func( _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): @@ -244,10 +249,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."""