Giter Club home page Giter Club logo

crewai-tools's Introduction

Logo of crewAI, two people rowing on a boat

crewAI Tools

This document provides a comprehensive guide for setting up sophisticated tools for crewAI agents, facilitating the creation of bespoke tooling to empower your AI solutions.

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.

Table of contents

Creating Your Tools

Tools are always expect to return strings, as they are meant to be used by the agents to generate responses.

There are three ways to create tools for crewAI agents:

Subclassing BaseTool

from crewai_tools import BaseTool

class MyCustomTool(BaseTool):
    name: str = "Name of my tool"
    description: str = "Clear description for what this tool is useful for, you agent will need this information to use it."

    def _run(self, argument: str) -> str:
        # Implementation goes here
        pass

Define a new class inheriting from BaseTool, specifying name, description, and the _run method for operational logic.

Utilizing the tool Decorator

For a simpler approach, create a Tool object directly with the required attributes and a functional logic.

from crewai_tools import tool
@tool("Name of my tool")
def my_tool(question: str) -> str:
    """Clear description for what this tool is useful for, you agent will need this information to use it."""
    # Function logic here

The tool decorator simplifies the process, transforming functions into tools with minimal overhead.

Contribution Guidelines

We eagerly welcome contributions to enrich this toolset. To contribute:

  1. Fork the Repository: Begin with forking the repository to your GitHub account.
  2. Feature Branch: Create a new branch in your fork for the feature or improvement.
  3. Implement Your Feature: Add your contribution to the new branch.
  4. Pull Request: Submit a pull request from your feature branch to the main repository.

Your contributions are greatly appreciated and will help enhance this project.

Development Setup

Installing Dependencies:

poetry install

Activating Virtual Environment:

poetry shell

Setting Up Pre-commit Hooks:

pre-commit install

Running Tests:

poetry run pytest

Static Type Checking:

poetry run pyright

Packaging:

poetry build

Local Installation:

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.

crewai-tools's People

Contributors

joaomdmoura avatar gvieira avatar slavakurilyak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.