Metadata-Version: 2.4
Name: cropioai-tools
Version: 0.0.14
Summary: Set of tools for the cropioAI framework
Author-email: Cropio <cropioindia@gmail.com>
License-File: LICENSE
Requires-Python: <=3.13,>=3.10
Requires-Dist: chromadb>=0.4.22
Requires-Dist: click>=8.1.8
Requires-Dist: cropioai>=0.0.4
Requires-Dist: docker>=7.1.0
Requires-Dist: embedchain>=0.1.114
Requires-Dist: lancedb>=0.5.4
Requires-Dist: openai>=1.12.0
Requires-Dist: pydantic>=2.6.1
Requires-Dist: pyright>=1.1.350
Requires-Dist: pytube>=15.0.0
Requires-Dist: requests>=2.31.0
Provides-Extra: beautifulsoup4
Requires-Dist: beautifulsoup4>=4.12.3; extra == 'beautifulsoup4'
Provides-Extra: browserbase
Requires-Dist: browserbase>=1.0.5; extra == 'browserbase'
Provides-Extra: composio-core
Requires-Dist: composio-core>=0.6.11.post1; extra == 'composio-core'
Provides-Extra: firecrawl-py
Requires-Dist: firecrawl-py>=1.8.0; extra == 'firecrawl-py'
Provides-Extra: hyperbrowser
Requires-Dist: hyperbrowser>=0.18.0; extra == 'hyperbrowser'
Provides-Extra: linkup-sdk
Requires-Dist: linkup-sdk>=0.2.2; extra == 'linkup-sdk'
Provides-Extra: multion
Requires-Dist: multion>=1.1.0; extra == 'multion'
Provides-Extra: patronus
Requires-Dist: patronus>=0.0.16; extra == 'patronus'
Provides-Extra: scrapegraph-py
Requires-Dist: scrapegraph-py>=1.9.0; extra == 'scrapegraph-py'
Provides-Extra: scrapfly-sdk
Requires-Dist: scrapfly-sdk>=0.8.19; extra == 'scrapfly-sdk'
Provides-Extra: selenium
Requires-Dist: selenium>=4.27.1; extra == 'selenium'
Provides-Extra: serpapi
Requires-Dist: serpapi>=0.1.5; extra == 'serpapi'
Provides-Extra: snowflake
Requires-Dist: cryptography>=43.0.3; extra == 'snowflake'
Requires-Dist: snowflake-connector-python>=3.12.4; extra == 'snowflake'
Requires-Dist: snowflake-sqlalchemy>=1.7.3; extra == 'snowflake'
Provides-Extra: spider-client
Requires-Dist: spider-client>=0.1.25; extra == 'spider-client'
Provides-Extra: sqlalchemy
Requires-Dist: sqlalchemy>=2.0.35; extra == 'sqlalchemy'
Provides-Extra: weaviate-client
Requires-Dist: weaviate-client>=4.10.2; extra == 'weaviate-client'
Description-Content-Type: text/markdown

<div align="center">

![Logo of cropioAI, two people rowing on a boat](./assets/cropioai_logo.png)

<div align="left">

# **cropioAI Tools**
Welcome to cropioAI Tools! This repository provides a comprehensive guide for setting up sophisticated tools for [cropioAI](https://github.com/cropioAIInc/cropioAI) agents, empowering your AI solutions with bespoke tooling.

In the realm of CropioAI 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.

</div>

<h3>

[Homepage](https://www.cropioai.io/) | [Documentation](https://docs.cropioai.com/) | [Chat with Docs](https://chatg.pt/DWjSBZn) | [Examples](https://github.com/cropioAIInc/cropioAI-examples) | [Discord](https://discord.com/invite/X4JWnZnxPb) | [Discourse](https://community.cropioai.com/)

</h3>

</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

cropioAI Tools provides a wide range of pre-built tools, including:

- File operations (FileWriterTool, FileReadTool)
- Web scraping (ScrapeWebsiteTool, SeleniumScrapingTool)
- Database interactions (PGSearchTool, MySQLSearchTool)
- API integrations (SerperApiTool, EXASearchTool)
- 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.

## 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 cropioAI agents:
- [Subclassing `BaseTool`](#subclassing-basetool)
- [Using the `tool` decorator](#utilizing-the-tool-decorator)

### Subclassing `BaseTool`

```python
from cropioai.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.

```python
from cropioai.tools import BaseTool
@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 welcome contributions! Here's how you can help:

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

Please ensure your code adheres to our coding standards and includes appropriate tests.

## **Development Setup**

**Installing Dependencies:**

```bash
uv sync
```

**Activating Virtual Environment:**

```bash
uv venv
source .venv/bin/activate
```

**Setting Up Pre-commit Hooks:**

```bash
pre-commit install
```

**Running Tests:**

```bash
uv run pytest
```

**Static Type Checking:**

```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.cropioai.com/) or open an issue in this repository.
