A programming framework for agentic AI
Made a configurable constant (#1819)
Rohit Singh Rathaurb0a8e6e08c8f
diff --git a/autogen/agentchat/groupchat.py b/autogen/agentchat/groupchat.pyindex 832c5fd68..a26f65798 100644--- a/autogen/agentchat/groupchat.py+++ b/autogen/agentchat/groupchat.py@@ -78,6 +78,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):@@ -244,10 +249,11 @@ Then select the next role from {[agent.name for agent in agents]} to play. Onlyif 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."""