initiate_chat
is the typical method of starting a conversation in AG2. You can call this directly, as shown in the code below, and it is also the mechanism that sits within ConversableAgent’s run method.
agent_A
sends the message (“Tell me a joke”) to our recipient, agent_B
, and requests a reply.
agent-B
receiving the message (API Reference: receive).
agent_A
, any “process_message_before_send” hooks are evaluated, and the message is appended to our messages list.
agent_A
generates their reply to the messages (see Generating a reply).
agent_B
and request a reply.
agent_B
generates a reply and, if they generate one, it gets added to the messages list. The loop then continues until the maximum turns are reached or we reach a point where we need to summarize and end.
initiate_chat
’s summary_method
argument, this is typically either:
summary_method
= “last_msg”)summary_method
= “reflection_with_llm”)