max_round
to set a limit on the number of replies. Each round represents an agent speaking and includes the initial message.
initiate_chat
use max_turns
. Each turn represents a round trip of both agents speaking and includes the initial message.
True
, the chat will be ended. This check is carried out before they reply.
When constructing an agent, use the is_termination_msg
parameter with a Callable. To save creating a function, you can use a lambda function as in the example below.
It’s important to put the termination check on the agents that will receive the message, not the agent creating the message.
human_input_mode
is “ALWAYS” or ‘TERMINATE’ (ConversableAgent’s default), you will be asked for input and can decide to end the chat. If it is “NEVER” it will end immediately.max_consecutive_auto_reply
parameter to set this.
human_input_mode
is “ALWAYS” or ‘TERMINATE’ (ConversableAgent’s default), you will be asked for input and can decide to end the chat. If it is “NEVER” it will end immediately.None
to end the chat.
TerminateTarget
it will end the chat. The DefaultPattern
pattern’s group-level after work is TerminateTarget
and this will apply to any agent in the group chat that doesn’t have an after work handoff specified.
Additionally, if you transition to RevertToUserTarget
but have not specified a user_agent
in initiate_group_chat
then it will end the chat.
register_reply
.
In your function, return a Tuple
of True, None
to indicate that the reply is final with None
indicating there’s no reply and it should end the chat.