Skip to content

Commit fcf14ee

Browse files
authored
Remove default trigger value for register_nested_chats (#1833)
* remove default trigger value for register_nested_chats * update notebook and test
1 parent 0a49f2a commit fcf14ee

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

autogen/agentchat/conversable_agent.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -362,15 +362,15 @@ def _summary_from_nested_chats(
362362
def register_nested_chats(
363363
self,
364364
chat_queue: List[Dict[str, Any]],
365-
trigger: Union[Type[Agent], str, Agent, Callable[[Agent], bool], List] = [Agent, None],
365+
trigger: Union[Type[Agent], str, Agent, Callable[[Agent], bool], List],
366366
reply_func_from_nested_chats: Union[str, Callable] = "summary_from_nested_chats",
367367
position: int = 2,
368368
**kwargs,
369369
) -> None:
370370
"""Register a nested chat reply function.
371371
Args:
372372
chat_queue (list): a list of chat objects to be initiated.
373-
trigger (Agent class, str, Agent instance, callable, or list): Default to [Agent, None]. Ref to `register_reply` for details.
373+
trigger (Agent class, str, Agent instance, callable, or list): refer to `register_reply` for details.
374374
reply_func_from_nested_chats (Callable, str): the reply function for the nested chat.
375375
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.
376376
Default to "summary_from_nested_chats", which corresponds to a built-in reply function that get summary from the nested chat_queue.

notebook/agentchat_nestedchat.ipynb

+1
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@
800800
"]\n",
801801
"assistant_1.register_nested_chats(\n",
802802
" nested_chat_queue,\n",
803+
" trigger=user,\n",
803804
")\n",
804805
"# user.initiate_chat(assistant, message=tasks[0], max_turns=1)\n",
805806
"\n",

test/agentchat/test_nested.py

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def writing_message(recipient, messages, sender, config):
112112
]
113113
assistant.register_nested_chats(
114114
nested_chat_queue,
115+
trigger=user,
115116
)
116117
user.initiate_chats([{"recipient": assistant, "message": tasks[0]}, {"recipient": assistant, "message": tasks[1]}])
117118

0 commit comments

Comments
 (0)