Use AG2 to solve a set of tasks with a sequence of chats.
autogen.initiate_chats
to solve a set of tasks with a sequence of
chats.
autogen.initiate_chats
interface can take a list of dictionaries
as inputs. Each dictionary preserves the following fields:
sender
: a conversable agent as the sender;recipient
: a conversable agent as the recipient;message
: is a string of text (typically a message containing the
task) or a callable;summary_method
: A string or a callable to get a summary from the
chat. Currently supported choices include last_msg
, which takes
the last message from the chat history as the summary, and
reflection_with_llm
, which uses an LLM call to reflect on the chat
history and summarize a takeaway;initiate_chat
method returns a ChatResult
object, which is a
dataclass object storing information about the chat. Currently, it
includes the following attributes:
chat_history
: a list of chat history.summary
: a string of chat summary. A summary is only available if
a summary_method is provided when initiating the chat.cost
: a tuple of (total_cost, total_actual_cost), where total_cost
is a dictionary of cost information, and total_actual_cost is a
dictionary of information on the actual incurred cost with cache.human_input
: a list of strings of human inputs solicited during
the chat. (Note that since we are setting human_input_mode
to
NEVER
in this notebook, this list is always empty.)