Skip to main content
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 or ag2, all you need to do is upgrade it using:
or
as autogen and ag2 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 by sales_agent and executed by user_proxy after user verification.
  • cancel_airplane_ticket: Suggested by cancellation_agent and executed by user_proxy after user verification.

Creating and Initiating the Group Chat

Now, let’s create and start the GroupChat with the three agents.

Example Console Output