A programming framework for agentic AI
Remove default trigger value for register_nested_chats (#1833)
Eric Zhufcf14ee9e929
diff --git a/autogen/agentchat/conversable_agent.py b/autogen/agentchat/conversable_agent.pyindex 6439c2099..d952fc35e 100644--- a/autogen/agentchat/conversable_agent.py+++ b/autogen/agentchat/conversable_agent.py@@ -362,7 +362,7 @@ class ConversableAgent(LLMAgent):def register_nested_chats(self,chat_queue: List[Dict[str, Any]],- trigger: Union[Type[Agent], str, Agent, Callable[[Agent], bool], List] = [Agent, None],+ trigger: Union[Type[Agent], str, Agent, Callable[[Agent], bool], List],reply_func_from_nested_chats: Union[str, Callable] = "summary_from_nested_chats",position: int = 2,**kwargs,@@ -370,7 +370,7 @@ class ConversableAgent(LLMAgent):"""Register a nested chat reply function.Args:chat_queue (list): a list of chat objects to be initiated.- trigger (Agent class, str, Agent instance, callable, or list): Default to [Agent, None]. Ref to `register_reply` for details.+ trigger (Agent class, str, Agent instance, callable, or list): refer to `register_reply` for details.reply_func_from_nested_chats (Callable, str): the reply function for the nested chat.The function takes a chat_queue for nested chat, recipient agent, a list of messages, a sender agent and a config as input and returns a reply message.Default to "summary_from_nested_chats", which corresponds to a built-in reply function that get summary from the nested chat_queue.diff --git a/notebook/agentchat_nestedchat.ipynb b/notebook/agentchat_nestedchat.ipynbindex c4a25871e..f9a7f78ef 100644--- a/notebook/agentchat_nestedchat.ipynb+++ b/notebook/agentchat_nestedchat.ipynb@@ -800,6 +800,7 @@"]\n","assistant_1.register_nested_chats(\n"," nested_chat_queue,\n",+ " trigger=user,\n",")\n","# user.initiate_chat(assistant, message=tasks[0], max_turns=1)\n","\n",diff --git a/test/agentchat/test_nested.py b/test/agentchat/test_nested.pyindex 7addbe2c1..a04fd0093 100755--- a/test/agentchat/test_nested.py+++ b/test/agentchat/test_nested.py@@ -112,6 +112,7 @@ def test_nested():]assistant.register_nested_chats(nested_chat_queue,+ trigger=user,)user.initiate_chats([{"recipient": assistant, "message": tasks[0]}, {"recipient": assistant, "message": tasks[1]}])