Solve complex tasks with one or more sequence chats nested as inner monologue.
inner_assistant
agent and an inner_code_interpreter
agent. Later we
will use this group chat inside another agent.
user
- assistant_1
for solving the first task, i.e., tasks[0]
.user
- assistant_2
for solving the second task, i.e.,
tasks[1]
.assistant_1
- manager
: This chat intends to delegate the task
received by Assistant_1 to the Manager to solve.
assistant_1
- writer
: This chat takes the output from Nested
Chat 1, i.e., Assistant_1 vs. Manager, and lets the Writer polish
the content to make an engaging and nicely formatted blog post,
which is realized through the writing_message function.
assistant_1
- reviewer
: This chat takes the output from Nested
Chat 2 and intends to let the Reviewer agent review the content from
Nested Chat 2.
assistant_1
- writer
: This chat takes the output from previous
nested chats and intends to let the Writer agent finalize a blog
post.
register_nested_chats
function, which allows one to register one or a
sequence of chats to a particular agent (in this example, the
assistant_1
agent).
Information about the sequence of chats can be specified in the
chat_queue
argument of the register_nested_chats
function. The
following fields are especially useful: - recipient
(required)
specifies the nested agent; - message
specifies what message to send
to the nested recipient agent. In a sequence of nested chats, if the
message
field is not specified, we will use the last message the
registering agent received as the initial message in the first chat and
will skip any subsequent chat in the queue that does not have the
message
field. You can either provide a string or define a callable
that returns a string. - summary_method
decides what to get out of the
nested chat. You can either select from existing options including
"last_msg"
and "reflection_with_llm"
, or or define your own way on
what to get from the nested chat with a Callable. - max_turns
determines how many turns of conversation to have between the concerned
agent pairs.