Skip to main content

Introduction

CrewAI provides a variety of powerful tools designed for tasks such as web scraping, search, code interpretation, and more. These tools are easy to integrate into the AG2 framework, allowing you to enhance your agents with advanced capabilities. You can explore the full list of available tools in the CrewAI Tools repository.

Installation

At the moment CrewAI tool work for python < 3.13, so to use them, please make sure you are using an appropriate version of python.
Install the required packages for integrating CrewAI tools into the AG2 framework. This ensures all dependencies for both frameworks are installed.

Imports

Import necessary modules and tools.

Agent Configuration

Configure the agents for the interaction.
  • config_list defines the LLM configurations, including the model and API key.
  • UserProxyAgent simulates user inputs without requiring actual human interaction (set to NEVER).
  • AssistantAgent represents the AI agent, configured with the LLM settings.

Tool Integration

Integrate the CrewAI tool with AG2.
  • Interoperability converts the CrewAI tool to a format compatible with AG2.
  • ScrapeWebsiteTool is used for web scraping tasks.
  • Register the tool for both execution and interaction with LLMs.

Initiating the chat

Initiate the conversation between the UserProxyAgent and the AssistantAgent to utilize the CrewAI tool.

Output

The chatbot provides results based on the web scraping operation:
You can also access a detailed summary of the interaction: