GroupChat
Group Chat with Tools
This user guide explains how to set up a group chat where each agent has unique capabilities and is equipped with specialized tools to perform specific tasks.
Installation
Note: If you have been using
autogen
orpyautogen
, all you need to do is upgrade it using:or
as
pyautogen
,autogen
, andag2
are aliases for the same PyPI package.
Imports
Agent Configuration
The GroupChat
will contain three agents:
sales_agent
- Responsible for selling tickets.cancellation_agent
- Handles ticket cancellations.user_proxy
- Acts as an intermediary between the user and other agents.
Tools Registration
In AG2, tool usage follows two steps:
- An agent suggests a tool to use (via its LLM).
- Another agent executes the tool.
We will define two tools:
buy_airplane_ticket
: Suggested bysales_agent
and executed byuser_proxy
after user verification.cancel_airplane_ticket
: Suggested bycancellation_agent
and executed byuser_proxy
after user verification.
Creating and Initiating the Group Chat
Now, let’s create and start the GroupChat
with the three agents.