forked from crewAIInc/crewAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
442c324
commit 1766e27
Showing
20 changed files
with
556 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# CSVSearchTool | ||
|
||
## Description | ||
|
||
This tool is used to perform a RAG (Retrieval-Augmented Generation) search within a CSV file's content. It allows users to semantically search for queries in the content of a specified CSV file. This feature is particularly useful for extracting information from large CSV datasets where traditional search methods might be inefficient. All tools with "Search" in their name, including CSVSearchTool, are RAG tools designed for searching different sources of data. | ||
|
||
## Installation | ||
|
||
Install the crewai_tools package | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
|
||
```python | ||
from crewai_tools import CSVSearchTool | ||
|
||
# Initialize the tool with a specific CSV file. This setup allows the agent to only search the given CSV file. | ||
tool = CSVSearchTool(csv='path/to/your/csvfile.csv') | ||
|
||
# OR | ||
|
||
# Initialize the tool without a specific CSV file. Agent will need to provide the CSV path at runtime. | ||
tool = CSVSearchTool() | ||
``` | ||
|
||
## Arguments | ||
|
||
- `csv` : The path to the CSV file you want to search. This is a mandatory argument if the tool was initialized without a specific CSV file; otherwise, it is optional. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# DOCXSearchTool | ||
|
||
## Description | ||
The DOCXSearchTool is a RAG tool designed for semantic searching within DOCX documents. It enables users to effectively search and extract relevant information from DOCX files using query-based searches. This tool is invaluable for data analysis, information management, and research tasks, streamlining the process of finding specific information within large document collections. | ||
|
||
## Installation | ||
Install the crewai_tools package by running the following command in your terminal: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
The following example demonstrates initializing the DOCXSearchTool to search within any DOCX file's content or with a specific DOCX file path. | ||
|
||
```python | ||
from crewai_tools import DOCXSearchTool | ||
|
||
# Initialize the tool to search within any DOCX file's content | ||
tool = DOCXSearchTool() | ||
|
||
# OR | ||
|
||
# Initialize the tool with a specific DOCX file, so the agent can only search the content of the specified DOCX file | ||
tool = DOCXSearchTool(docx='path/to/your/document.docx') | ||
``` | ||
|
||
## Arguments | ||
- `docx`: An optional file path to a specific DOCX document you wish to search. If not provided during initialization, the tool allows for later specification of any DOCX file's content path for searching. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# DirectoryReadTool | ||
|
||
## Description | ||
The DirectoryReadTool is a highly efficient utility designed for the comprehensive listing of directory contents. It recursively navigates through the specified directory, providing users with a detailed enumeration of all files, including those nested within subdirectories. This tool is indispensable for tasks requiring a thorough inventory of directory structures or for validating the organization of files within directories. | ||
|
||
## Installation | ||
Install the `crewai_tools` package to use the DirectoryReadTool in your project. If you haven't added this package to your environment, you can easily install it with pip using the following command: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
This installs the latest version of the `crewai_tools` package, allowing access to the DirectoryReadTool and other utilities. | ||
|
||
## Example | ||
The DirectoryReadTool is simple to use. The code snippet below shows how to set up and use the tool to list the contents of a specified directory: | ||
|
||
```python | ||
from crewai_tools import DirectoryReadTool | ||
|
||
# Initialize the tool so the agent can read any directory's content it learns about during execution | ||
tool = DirectoryReadTool() | ||
|
||
# OR | ||
|
||
# Initialize the tool with a specific directory, so the agent can only read the content of the specified directory | ||
tool = DirectoryReadTool(directory='/path/to/your/directory') | ||
``` | ||
|
||
## Arguments | ||
The DirectoryReadTool requires minimal configuration for use. The essential argument for this tool is as follows: | ||
|
||
- `directory`: **Optional** A argument that specifies the path to the directory whose contents you wish to list. It accepts both absolute and relative paths, guiding the tool to the desired directory for content listing. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# DirectorySearchTool | ||
|
||
## Description | ||
This tool is designed to perform a semantic search for queries within the content of a specified directory. Utilizing the RAG (Retrieval-Augmented Generation) methodology, it offers a powerful means to semantically navigate through the files of a given directory. The tool can be dynamically set to search any directory specified at runtime or can be pre-configured to search within a specific directory upon initialization. | ||
|
||
## Installation | ||
To start using the DirectorySearchTool, you need to install the crewai_tools package. Execute the following command in your terminal: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
The following examples demonstrate how to initialize the DirectorySearchTool for different use cases and how to perform a search: | ||
|
||
```python | ||
from crewai_tools import DirectorySearchTool | ||
|
||
# To enable searching within any specified directory at runtime | ||
tool = DirectorySearchTool() | ||
|
||
# Alternatively, to restrict searches to a specific directory | ||
tool = DirectorySearchTool(directory='/path/to/directory') | ||
``` | ||
|
||
## Arguments | ||
- `directory` : This string argument specifies the directory within which to search. It is mandatory if the tool has not been initialized with a directory; otherwise, the tool will only search within the initialized directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# FileReadTool | ||
|
||
## Description | ||
The FileReadTool is a versatile component of the crewai_tools package, designed to streamline the process of reading and retrieving content from files. It is particularly useful in scenarios such as batch text file processing, runtime configuration file reading, and data importation for analytics. This tool supports various text-based file formats including `.txt`, `.csv`, `.json` and more, and adapts its functionality based on the file type, for instance, converting JSON content into a Python dictionary for easy use. | ||
|
||
## Installation | ||
Install the crewai_tools package to use the FileReadTool in your projects: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
To get started with the FileReadTool: | ||
|
||
```python | ||
from crewai_tools import FileReadTool | ||
|
||
# Initialize the tool to read any files the agents knows or lean the path for | ||
file_read_tool = FileReadTool() | ||
|
||
# OR | ||
|
||
# Initialize the tool with a specific file path, so the agent can only read the content of the specified file | ||
file_read_tool = FileReadTool(file_path='path/to/your/file.txt') | ||
``` | ||
|
||
## Arguments | ||
- `file_path`: The path to the file you want to read. It accepts both absolute and relative paths. Ensure the file exists and you have the necessary permissions to access it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# GitHubSearchTool | ||
|
||
## Description | ||
The GitHubSearchTool is a Read, Append, and Generate (RAG) tool specifically designed for conducting semantic searches within GitHub repositories. Utilizing advanced semantic search capabilities, it sifts through code, pull requests, issues, and repositories, making it an essential tool for developers, researchers, or anyone in need of precise information from GitHub. | ||
|
||
## Installation | ||
To use the GitHubSearchTool, first ensure the crewai_tools package is installed in your Python environment: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
This command installs the necessary package to run the GitHubSearchTool along with any other tools included in the crewai_tools package. | ||
|
||
## Example | ||
Here’s how you can use the GitHubSearchTool to perform semantic searches within a GitHub repository: | ||
```python | ||
from crewai_tools import GitHubSearchTool | ||
|
||
# Initialize the tool for semantic searches within a specific GitHub repository | ||
tool = GitHubSearchTool( | ||
github_repo='https://github.com/example/repo', | ||
content_types=['code', 'issue'] # Options: code, repo, pr, issue | ||
) | ||
|
||
# OR | ||
|
||
# Initialize the tool for semantic searches within a specific GitHub repository, so the agent can search any repository if it learns about during its execution | ||
tool = GitHubSearchTool( | ||
content_types=['code', 'issue'] # Options: code, repo, pr, issue | ||
) | ||
``` | ||
|
||
## Arguments | ||
- `github_repo` : The URL of the GitHub repository where the search will be conducted. This is a mandatory field and specifies the target repository for your search. | ||
- `content_types` : Specifies the types of content to include in your search. You must provide a list of content types from the following options: `code` for searching within the code, `repo` for searching within the repository's general information, `pr` for searching within pull requests, and `issue` for searching within issues. This field is mandatory and allows tailoring the search to specific content types within the GitHub repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# JSONSearchTool | ||
|
||
## Description | ||
This tool is used to perform a RAG search within a JSON file's content. It allows users to initiate a search with a specific JSON path, focusing the search operation within that particular JSON file. If the path is provided at initialization, the tool restricts its search scope to the specified JSON file, thereby enhancing the precision of search results. | ||
|
||
## Installation | ||
Install the crewai_tools package by executing the following command in your terminal: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
Below are examples demonstrating how to use the JSONSearchTool for searching within JSON files. You can either search any JSON content or restrict the search to a specific JSON file. | ||
|
||
```python | ||
from crewai_tools import JSONSearchTool | ||
|
||
# Example 1: Initialize the tool for a general search across any JSON content. This is useful when the path is known or can be discovered during execution. | ||
tool = JSONSearchTool() | ||
|
||
# Example 2: Initialize the tool with a specific JSON path, limiting the search to a particular JSON file. | ||
tool = JSONSearchTool(json_path='./path/to/your/file.json') | ||
``` | ||
|
||
## Arguments | ||
- `json_path` (str): An optional argument that defines the path to the JSON file to be searched. This parameter is only necessary if the tool is initialized without a specific JSON path. Providing this argument restricts the search to the specified JSON file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# MDXSearchTool | ||
|
||
## Description | ||
The MDX Search Tool, a key component of the `crewai_tools` package, is designed for advanced market data extraction, offering invaluable support to researchers and analysts requiring immediate market insights in the AI sector. With its ability to interface with various data sources and tools, it streamlines the process of acquiring, reading, and organizing market data efficiently. | ||
|
||
## Installation | ||
To utilize the MDX Search Tool, ensure the `crewai_tools` package is installed. If not already present, install it using the following command: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
Configuring and using the MDX Search Tool involves setting up environment variables and utilizing the tool within a crewAI project for market research. Here's a simple example: | ||
|
||
```python | ||
from crewai_tools import MDXSearchTool | ||
|
||
# Initialize the tool so the agent can search any MDX content if it learns about during its execution | ||
tool = MDXSearchTool() | ||
|
||
# OR | ||
|
||
# Initialize the tool with a specific MDX file path for exclusive search within that document | ||
tool = MDXSearchTool(mdx='path/to/your/document.mdx') | ||
``` | ||
|
||
## Arguments | ||
- mdx: **Optional** The MDX path for the search. Can be provided at initialization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# PDFSearchTool | ||
|
||
## Description | ||
The PDFSearchTool is a RAG tool designed for semantic searches within PDF content. It allows for inputting a search query and a PDF document, leveraging advanced search techniques to find relevant content efficiently. This capability makes it especially useful for extracting specific information from large PDF files quickly. | ||
|
||
## Installation | ||
To get started with the PDFSearchTool, first, ensure the crewai_tools package is installed with the following command: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
Here's how to use the PDFSearchTool to search within a PDF document: | ||
|
||
```python | ||
from crewai_tools import PDFSearchTool | ||
|
||
# Initialize the tool allowing for any PDF content search if the path is provided during execution | ||
tool = PDFSearchTool() | ||
|
||
# OR | ||
|
||
# Initialize the tool with a specific PDF path for exclusive search within that document | ||
tool = PDFSearchTool(pdf='path/to/your/document.pdf') | ||
``` | ||
|
||
## Arguments | ||
- `pdf`: **Optinal** The PDF path for the search. Can be provided at initialization or within the `run` method's arguments. If provided at initialization, the tool confines its search to the specified document. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# PGSearchTool | ||
|
||
## Description | ||
This tool is designed to facilitate semantic searches within PostgreSQL database tables. Leveraging the RAG (Retrieve and Generate) technology, the PGSearchTool provides users with an efficient means of querying database table content, specifically tailored for PostgreSQL databases. It simplifies the process of finding relevant data through semantic search queries, making it an invaluable resource for users needing to perform advanced queries on extensive datasets within a PostgreSQL database. | ||
|
||
## Installation | ||
To install the `crewai_tools` package and utilize the PGSearchTool, execute the following command in your terminal: | ||
|
||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
Below is an example showcasing how to use the PGSearchTool to conduct a semantic search on a table within a PostgreSQL database: | ||
|
||
```python | ||
from crewai_tools import PGSearchTool | ||
|
||
# Initialize the tool with the database URI and the target table name | ||
tool = PGSearchTool(db_uri='postgresql://user:password@localhost:5432/mydatabase', table_name='employees') | ||
|
||
``` | ||
|
||
## Arguments | ||
The PGSearchTool requires the following arguments for its operation: | ||
|
||
- `db_uri`: A string representing the URI of the PostgreSQL database to be queried. This argument is mandatory and must include the necessary authentication details and the location of the database. | ||
- `table_name`: A string specifying the name of the table within the database on which the semantic search will be performed. This argument is mandatory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# ScrapeWebsiteTool | ||
|
||
## Description | ||
A tool designed to extract and read the content of a specified website. It is capable of handling various types of web pages by making HTTP requests and parsing the received HTML content. This tool can be particularly useful for web scraping tasks, data collection, or extracting specific information from websites. | ||
|
||
## Installation | ||
Install the crewai_tools package | ||
```shell | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
```python | ||
from crewai_tools import ScrapeWebsiteTool | ||
|
||
# To enable scrapping any website it finds during it's execution | ||
tool = ScrapeWebsiteTool() | ||
|
||
# Initialize the tool with the website URL, so the agent can only scrap the content of the specified website | ||
tool = ScrapeWebsiteTool(website_url='https://www.example.com') | ||
``` | ||
|
||
## Arguments | ||
- `website_url` : Mandatory website URL to read the file. This is the primary input for the tool, specifying which website's content should be scraped and read. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SeleniumScrapingTool | ||
|
||
## Description | ||
This tool is designed for efficient web scraping, enabling users to extract content from web pages. It supports targeted scraping by allowing the specification of a CSS selector for desired elements. The flexibility of the tool enables it to be used on any website URL provided by the user, making it a versatile tool for various web scraping needs. | ||
|
||
## Installation | ||
Install the crewai_tools package | ||
``` | ||
pip install 'crewai[tools]' | ||
``` | ||
|
||
## Example | ||
```python | ||
from crewai_tools import SeleniumScrapingTool | ||
|
||
# Example 1: Scrape any website it finds during its execution | ||
tool = SeleniumScrapingTool() | ||
|
||
# Example 2: Scrape the entire webpage | ||
tool = SeleniumScrapingTool(website_url='https://example.com') | ||
|
||
# Example 3: Scrape a specific CSS element from the webpage | ||
tool = SeleniumScrapingTool(website_url='https://example.com', css_element='.main-content') | ||
|
||
# Example 4: Scrape using optional parameters for customized scraping | ||
tool = SeleniumScrapingTool(website_url='https://example.com', css_element='.main-content', cookie={'name': 'user', 'value': 'John Doe'}) | ||
``` | ||
|
||
## Arguments | ||
- `website_url`: Mandatory. The URL of the website to scrape. | ||
- `css_element`: Mandatory. The CSS selector for a specific element to scrape from the website. | ||
- `cookie`: Optional. A dictionary containing cookie information. This parameter allows the tool to simulate a session with cookie information, providing access to content that may be restricted to logged-in users. | ||
- `wait_time`: Optional. The number of seconds the tool waits after loading the website and after setting a cookie, before scraping the content. This allows for dynamic content to load properly. |
Oops, something went wrong.