updatign readme

This commit is contained in:
João Moura
2025-03-09 04:01:12 -07:00
parent 6d8d30178d
commit c19591a689
3 changed files with 61 additions and 92 deletions

153
README.md
View File

@@ -4,140 +4,109 @@
<div align="left"> <div align="left">
# **crewAI Tools** # CrewAI Tools
Welcome to crewAI Tools! This repository provides a comprehensive guide for setting up sophisticated tools for [crewAI](https://github.com/crewAIInc/crewAI) agents, empowering your AI solutions with bespoke tooling.
In the realm of CrewAI agents, tools are pivotal for enhancing functionality. This guide outlines the steps to equip your agents with an arsenal of ready-to-use tools and the methodology to craft your own. Empower your CrewAI agents with powerful, customizable tools to elevate their capabilities and tackle sophisticated, real-world tasks.
</div> CrewAI Tools provide the essential functionality to extend your agents, helping you rapidly enhance your automations with reliable, ready-to-use tools or custom-built solutions tailored precisely to your needs.
<h3> ---
[Homepage](https://www.crewai.io/) | [Documentation](https://docs.crewai.com/) | [Chat with Docs](https://chatg.pt/DWjSBZn) | [Examples](https://github.com/crewAIInc/crewAI-examples) | [Discord](https://discord.com/invite/X4JWnZnxPb) | [Discourse](https://community.crewai.com/) ## Quick Links
</h3> [Homepage](https://www.crewai.com/) | [Documentation](https://docs.crewai.com/) | [Examples](https://github.com/crewAIInc/crewAI-examples) | [Community](https://community.crewai.com/)
</div> ---
## Table of contents
- [Creating Your Tools](#creating-your-tools)
- [Subclassing `BaseTool`](#subclassing-basetool)
- [Utilizing the `tool` Decorator](#utilizing-the-tool-decorator)
- [Contribution Guidelines](#contribution-guidelines)
- [Development Setup](#development-setup)
## Available Tools ## Available Tools
crewAI Tools provides a wide range of pre-built tools, including: CrewAI provides an extensive collection of powerful tools ready to enhance your agents:
- File operations (FileWriterTool, FileReadTool) - **File Management**: `FileReadTool`, `FileWriteTool`
- Web scraping (ScrapeWebsiteTool, SeleniumScrapingTool) - **Web Scraping**: `ScrapeWebsiteTool`, `SeleniumScrapingTool`
- Database interactions (PGSearchTool, MySQLSearchTool) - **Database Integrations**: `PGSearchTool`, `MySQLSearchTool`
- API integrations (SerperApiTool, EXASearchTool) - **API Integrations**: `SerperApiTool`, `EXASearchTool`
- AI-powered tools (DallETool, VisionTool) - **AI-powered Tools**: `DallETool`, `VisionTool`
- And many more!
For a complete list and detailed documentation of each tool, please refer to the individual tool README files in the repository. And many more robust tools to simplify your agent integrations.
## Creating Your Tools ---
Tools are always expect to return strings, as they are meant to be used by the agents to generate responses. ## Creating Custom Tools
There are three ways to create tools for crewAI agents: CrewAI offers two straightforward approaches to creating custom tools:
- [Subclassing `BaseTool`](#subclassing-basetool)
- [Using the `tool` decorator](#utilizing-the-tool-decorator)
### Subclassing `BaseTool` ### Subclassing `BaseTool`
Define your tool by subclassing:
```python ```python
from crewai.tools import BaseTool from crewai.tools import BaseTool
class MyCustomTool(BaseTool): class MyCustomTool(BaseTool):
name: str = "Name of my tool" name: str = "Tool Name"
description: str = "Clear description for what this tool is useful for, you agent will need this information to use it." description: str = "Detailed description here."
def _run(self, argument: str) -> str: def _run(self, *args, **kwargs):
# Implementation goes here # Your tool logic here
pass
``` ```
Define a new class inheriting from `BaseTool`, specifying `name`, `description`, and the `_run` method for operational logic. ### Using the `tool` Decorator
Quickly create lightweight tools using decorators:
### Utilizing the `tool` Decorator
For a simpler approach, create a `Tool` object directly with the required attributes and a functional logic.
```python ```python
from crewai.tools import BaseTool from crewai import tool
@tool("Name of my tool")
def my_tool(question: str) -> str: @tool("Tool Name")
"""Clear description for what this tool is useful for, you agent will need this information to use it.""" def my_custom_function(input):
# Function logic here # Tool logic here
return output
``` ```
The `tool` decorator simplifies the process, transforming functions into tools with minimal overhead. ---
## Why Use CrewAI Tools?
- **Simplicity & Flexibility**: Easy-to-use yet powerful enough for complex workflows.
- **Rapid Integration**: Seamlessly incorporate external services, APIs, and databases.
- **Enterprise Ready**: Built for stability, performance, and consistent results.
---
## Contribution Guidelines ## Contribution Guidelines
We welcome contributions! Here's how you can help: We welcome contributions from the community!
1. Fork the repository 1. Fork and clone the repository.
2. Create a feature branch (`git checkout -b feature/AmazingFeature`) 2. Create a new branch (`git checkout -b feature/my-feature`).
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`) 3. Commit your changes (`git commit -m 'Add my feature'`).
4. Push to the branch (`git push origin feature/AmazingFeature`) 4. Push your branch (`git push origin feature/my-feature`).
5. Open a Pull Request 5. Open a pull request.
Please ensure your code adheres to our coding standards and includes appropriate tests. ---
## **Development Setup** ## Developer Quickstart
**Installing Dependencies:** ```shell
pip install crewai[tools]
```bash
uv sync
``` ```
**Activating Virtual Environment:** ### Development Setup
```bash - Install dependencies: `uv sync`
uv venv - Run tests: `uv run pytest`
source .venv/bin/activate - Run static type checking: `uv run pyright`
``` - Set up pre-commit hooks: `pre-commit install`
**Setting Up Pre-commit Hooks:** ---
```bash ## Support and Community
pre-commit install
```
**Running Tests:** Join our rapidly growing community and receive real-time support:
```bash - [Discourse](https://community.crewai.com/)
uv run pytest - [Open an Issue](https://github.com/crewAIInc/crewAI/issues)
```
**Static Type Checking:** Build smarter, faster, and more powerful AI solutions—powered by CrewAI Tools.
```bash
uv run pyright
```
**Packaging:**
```bash
uv build
```
**Local Installation:**
```bash
pip install dist/*.tar.gz
```
Thank you for your interest in enhancing the capabilities of AI agents through advanced tooling. Your contributions make a significant impact.
## Contact
For questions or support, please join our [Discord community](https://discord.com/invite/X4JWnZnxPb), [Discourse](https://community.crewai.com/) or open an issue in this repository.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 14 KiB