mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
Add pt-BR docs translation (#3039)
* docs: add pt-br translations Powered by a CrewAI Flow https://github.com/danielfsbarreto/docs_translator * Update mcp/overview.mdx brazilian docs Its en-US counterpart was updated after I did a pass, so now it includes the new section about @CrewBase
This commit is contained in:
77
docs/en/tools/file-document/csvsearchtool.mdx
Normal file
77
docs/en/tools/file-document/csvsearchtool.mdx
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
title: CSV RAG Search
|
||||
description: The `CSVSearchTool` is a powerful RAG (Retrieval-Augmented Generation) tool designed for semantic searches within a CSV file's content.
|
||||
icon: file-csv
|
||||
---
|
||||
|
||||
# `CSVSearchTool`
|
||||
|
||||
<Note>
|
||||
**Experimental**: We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
||||
</Note>
|
||||
|
||||
## 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 Code
|
||||
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
|
||||
|
||||
The following parameters can be used to customize the `CSVSearchTool`'s behavior:
|
||||
|
||||
| Argument | Type | Description |
|
||||
|:---------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **csv** | `string` | _Optional_. 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. |
|
||||
|
||||
## Custom model and embeddings
|
||||
|
||||
By default, the tool uses OpenAI for both embeddings and summarization. To customize the model, you can use a config dictionary as follows:
|
||||
|
||||
```python Code
|
||||
tool = CSVSearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # or google, openai, anthropic, llama2, ...
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google", # or openai, ollama, ...
|
||||
config=dict(
|
||||
model="models/embedding-001",
|
||||
task_type="retrieval_document",
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
53
docs/en/tools/file-document/directoryreadtool.mdx
Normal file
53
docs/en/tools/file-document/directoryreadtool.mdx
Normal file
@@ -0,0 +1,53 @@
|
||||
---
|
||||
title: Directory Read
|
||||
description: The `DirectoryReadTool` is a powerful utility designed to provide a comprehensive listing of directory contents.
|
||||
icon: folder-tree
|
||||
---
|
||||
|
||||
# `DirectoryReadTool`
|
||||
|
||||
<Note>
|
||||
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
||||
</Note>
|
||||
|
||||
## Description
|
||||
|
||||
The DirectoryReadTool is a powerful utility designed to provide a comprehensive listing of directory contents.
|
||||
It can recursively navigate through the specified directory, offering users a detailed enumeration of all files, including those within subdirectories.
|
||||
This tool is crucial for tasks that require a thorough inventory of directory structures or for validating the organization of files within directories.
|
||||
|
||||
## Installation
|
||||
|
||||
To utilize the DirectoryReadTool in your project, install the `crewai_tools` package. If this package is not yet part of your environment, you can install it using pip with the command below:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
This command installs the latest version of the `crewai_tools` package, granting access to the DirectoryReadTool among other utilities.
|
||||
|
||||
## Example
|
||||
|
||||
Employing the DirectoryReadTool is straightforward. The following code snippet demonstrates how to set it up and use the tool to list the contents of a specified directory:
|
||||
|
||||
```python Code
|
||||
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 following parameters can be used to customize the `DirectoryReadTool`'s behavior:
|
||||
|
||||
| Argument | Type | Description |
|
||||
|:---------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **directory** | `string` | _Optional_. An 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. |
|
||||
67
docs/en/tools/file-document/directorysearchtool.mdx
Normal file
67
docs/en/tools/file-document/directorysearchtool.mdx
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: Directory RAG Search
|
||||
description: The `DirectorySearchTool` is a powerful RAG (Retrieval-Augmented Generation) tool designed for semantic searches within a directory's content.
|
||||
icon: address-book
|
||||
---
|
||||
|
||||
# `DirectorySearchTool`
|
||||
|
||||
<Note>
|
||||
**Experimental**: The DirectorySearchTool is under continuous development. Features and functionalities might evolve, and unexpected behavior may occur as we refine the tool.
|
||||
</Note>
|
||||
|
||||
## Description
|
||||
|
||||
The DirectorySearchTool enables semantic search within the content of specified directories, leveraging the Retrieval-Augmented Generation (RAG) methodology for efficient navigation through files. Designed for flexibility, it allows users to dynamically specify search directories at runtime or set a fixed directory during initial setup.
|
||||
|
||||
## Installation
|
||||
|
||||
To use the DirectorySearchTool, begin by installing the crewai_tools package. Execute the following command in your terminal:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
## Initialization and Usage
|
||||
|
||||
Import the DirectorySearchTool from the `crewai_tools` package to start. You can initialize the tool without specifying a directory, enabling the setting of the search directory at runtime. Alternatively, the tool can be initialized with a predefined directory.
|
||||
|
||||
```python Code
|
||||
from crewai_tools import DirectorySearchTool
|
||||
|
||||
# For dynamic directory specification at runtime
|
||||
tool = DirectorySearchTool()
|
||||
|
||||
# For fixed directory searches
|
||||
tool = DirectorySearchTool(directory='/path/to/directory')
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- `directory`: A string argument that specifies the search directory. This is optional during initialization but required for searches if not set initially.
|
||||
|
||||
## Custom Model and Embeddings
|
||||
|
||||
The DirectorySearchTool uses OpenAI for embeddings and summarization by default. Customization options for these settings include changing the model provider and configuration, enhancing flexibility for advanced users.
|
||||
|
||||
```python Code
|
||||
tool = DirectorySearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # Options include ollama, google, anthropic, llama2, and more
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# Additional configurations here
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google", # or openai, ollama, ...
|
||||
config=dict(
|
||||
model="models/embedding-001",
|
||||
task_type="retrieval_document",
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
79
docs/en/tools/file-document/docxsearchtool.mdx
Normal file
79
docs/en/tools/file-document/docxsearchtool.mdx
Normal file
@@ -0,0 +1,79 @@
|
||||
---
|
||||
title: DOCX RAG Search
|
||||
description: The `DOCXSearchTool` is a RAG tool designed for semantic searching within DOCX documents.
|
||||
icon: file-word
|
||||
---
|
||||
|
||||
# `DOCXSearchTool`
|
||||
|
||||
<Note>
|
||||
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
||||
</Note>
|
||||
|
||||
## 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
|
||||
uv pip install docx2txt '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 Code
|
||||
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
|
||||
|
||||
The following parameters can be used to customize the `DOCXSearchTool`'s behavior:
|
||||
|
||||
| Argument | Type | Description |
|
||||
|:---------------|:---------|:-------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| **docx** | `string` | _Optional_. An argument that specifies the path to the DOCX file you want to search. If not provided during initialization, the tool allows for later specification of any DOCX file's content path for searching. |
|
||||
|
||||
## Custom model and embeddings
|
||||
|
||||
By default, the tool uses OpenAI for both embeddings and summarization. To customize the model, you can use a config dictionary as follows:
|
||||
|
||||
```python Code
|
||||
tool = DOCXSearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # or google, openai, anthropic, llama2, ...
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google", # or openai, ollama, ...
|
||||
config=dict(
|
||||
model="models/embedding-001",
|
||||
task_type="retrieval_document",
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
44
docs/en/tools/file-document/filereadtool.mdx
Normal file
44
docs/en/tools/file-document/filereadtool.mdx
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
title: File Read
|
||||
description: The `FileReadTool` is designed to read files from the local file system.
|
||||
icon: folders
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
<Note>
|
||||
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
||||
</Note>
|
||||
|
||||
The FileReadTool conceptually represents a suite of functionalities within the crewai_tools package aimed at facilitating file reading and content retrieval.
|
||||
This suite includes tools for processing batch text files, reading runtime configuration files, and importing data for analytics.
|
||||
It supports a variety of text-based file formats such as `.txt`, `.csv`, `.json`, and more. Depending on the file type, the suite offers specialized functionality,
|
||||
such as converting JSON content into a Python dictionary for ease of use.
|
||||
|
||||
## Installation
|
||||
|
||||
To utilize the functionalities previously attributed to the FileReadTool, install the crewai_tools package:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
## Usage Example
|
||||
|
||||
To get started with the FileReadTool:
|
||||
|
||||
```python Code
|
||||
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.
|
||||
50
docs/en/tools/file-document/filewritetool.mdx
Normal file
50
docs/en/tools/file-document/filewritetool.mdx
Normal file
@@ -0,0 +1,50 @@
|
||||
---
|
||||
title: File Write
|
||||
description: The `FileWriterTool` is designed to write content to files.
|
||||
icon: file-pen
|
||||
---
|
||||
|
||||
# `FileWriterTool`
|
||||
|
||||
## Description
|
||||
|
||||
The `FileWriterTool` is a component of the crewai_tools package, designed to simplify the process of writing content to files with cross-platform compatibility (Windows, Linux, macOS).
|
||||
It is particularly useful in scenarios such as generating reports, saving logs, creating configuration files, and more.
|
||||
This tool handles path differences across operating systems, supports UTF-8 encoding, and automatically creates directories if they don't exist, making it easier to organize your output reliably across different platforms.
|
||||
|
||||
## Installation
|
||||
|
||||
Install the crewai_tools package to use the `FileWriterTool` in your projects:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
To get started with the `FileWriterTool`:
|
||||
|
||||
```python Code
|
||||
from crewai_tools import FileWriterTool
|
||||
|
||||
# Initialize the tool
|
||||
file_writer_tool = FileWriterTool()
|
||||
|
||||
# Write content to a file in a specified directory
|
||||
result = file_writer_tool._run('example.txt', 'This is a test content.', 'test_directory')
|
||||
print(result)
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- `filename`: The name of the file you want to create or overwrite.
|
||||
- `content`: The content to write into the file.
|
||||
- `directory` (optional): The path to the directory where the file will be created. Defaults to the current directory (`.`). If the directory does not exist, it will be created.
|
||||
|
||||
## Conclusion
|
||||
|
||||
By integrating the `FileWriterTool` into your crews, the agents can reliably write content to files across different operating systems.
|
||||
This tool is essential for tasks that require saving output data, creating structured file systems, and handling cross-platform file operations.
|
||||
It's particularly recommended for Windows users who may encounter file writing issues with standard Python file operations.
|
||||
|
||||
By adhering to the setup and usage guidelines provided, incorporating this tool into projects is straightforward and ensures consistent file writing behavior across all platforms.
|
||||
75
docs/en/tools/file-document/jsonsearchtool.mdx
Normal file
75
docs/en/tools/file-document/jsonsearchtool.mdx
Normal file
@@ -0,0 +1,75 @@
|
||||
---
|
||||
title: JSON RAG Search
|
||||
description: The `JSONSearchTool` is designed to search JSON files and return the most relevant results.
|
||||
icon: file-code
|
||||
---
|
||||
|
||||
# `JSONSearchTool`
|
||||
|
||||
<Note>
|
||||
The JSONSearchTool is currently in an experimental phase. This means the tool
|
||||
is under active development, and users might encounter unexpected behavior or
|
||||
changes. We highly encourage feedback on any issues or suggestions for
|
||||
improvements.
|
||||
</Note>
|
||||
|
||||
## Description
|
||||
|
||||
The JSONSearchTool is designed to facilitate efficient and precise searches within JSON file contents. It utilizes a RAG (Retrieve and Generate) search mechanism, allowing users to specify a JSON path for targeted searches within a particular JSON file. This capability significantly improves the accuracy and relevance of search results.
|
||||
|
||||
## Installation
|
||||
|
||||
To install the JSONSearchTool, use the following pip command:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
## Usage Examples
|
||||
|
||||
Here are updated examples on how to utilize the JSONSearchTool effectively for searching within JSON files. These examples take into account the current implementation and usage patterns identified in the codebase.
|
||||
|
||||
```python Code
|
||||
from crewai_tools import JSONSearchTool
|
||||
|
||||
# General JSON content search
|
||||
# This approach is suitable when the JSON path is either known beforehand or can be dynamically identified.
|
||||
tool = JSONSearchTool()
|
||||
|
||||
# Restricting search to a specific JSON file
|
||||
# Use this initialization method when you want to limit the search scope to a specific JSON file.
|
||||
tool = JSONSearchTool(json_path='./path/to/your/file.json')
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- `json_path` (str, optional): Specifies the path to the JSON file to be searched. This argument is not required if the tool is initialized for a general search. When provided, it confines the search to the specified JSON file.
|
||||
|
||||
## Configuration Options
|
||||
|
||||
The JSONSearchTool supports extensive customization through a configuration dictionary. This allows users to select different models for embeddings and summarization based on their requirements.
|
||||
|
||||
```python Code
|
||||
tool = JSONSearchTool(
|
||||
config={
|
||||
"llm": {
|
||||
"provider": "ollama", # Other options include google, openai, anthropic, llama2, etc.
|
||||
"config": {
|
||||
"model": "llama2",
|
||||
# Additional optional configurations can be specified here.
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
},
|
||||
},
|
||||
"embedding_model": {
|
||||
"provider": "google", # or openai, ollama, ...
|
||||
"config": {
|
||||
"model": "models/embedding-001",
|
||||
"task_type": "retrieval_document",
|
||||
# Further customization options can be added here.
|
||||
},
|
||||
},
|
||||
}
|
||||
)
|
||||
```
|
||||
73
docs/en/tools/file-document/mdxsearchtool.mdx
Normal file
73
docs/en/tools/file-document/mdxsearchtool.mdx
Normal file
@@ -0,0 +1,73 @@
|
||||
---
|
||||
title: MDX RAG Search
|
||||
description: The `MDXSearchTool` is designed to search MDX files and return the most relevant results.
|
||||
icon: markdown
|
||||
---
|
||||
|
||||
# `MDXSearchTool`
|
||||
|
||||
<Note>
|
||||
The MDXSearchTool is in continuous development. Features may be added or removed, and functionality could change unpredictably as we refine the tool.
|
||||
</Note>
|
||||
|
||||
## Description
|
||||
|
||||
The MDX Search Tool is a component of the `crewai_tools` package aimed at facilitating advanced markdown language extraction. It enables users to effectively search and extract relevant information from MD 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
|
||||
|
||||
Before using the MDX Search Tool, ensure the `crewai_tools` package is installed. If it is not, you can install it with the following command:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
## Usage Example
|
||||
|
||||
To use the MDX Search Tool, you must first set up the necessary environment variables. Then, integrate the tool into your crewAI project to begin your market research. Below is a basic example of how to do this:
|
||||
|
||||
```python Code
|
||||
from crewai_tools import MDXSearchTool
|
||||
|
||||
# Initialize the tool to search any MDX content it learns about during execution
|
||||
tool = MDXSearchTool()
|
||||
|
||||
# OR
|
||||
|
||||
# Initialize the tool with a specific MDX file path for an exclusive search within that document
|
||||
tool = MDXSearchTool(mdx='path/to/your/document.mdx')
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
- mdx: **Optional**. Specifies the MDX file path for the search. It can be provided during initialization.
|
||||
|
||||
## Customization of Model and Embeddings
|
||||
|
||||
The tool defaults to using OpenAI for embeddings and summarization. For customization, utilize a configuration dictionary as shown below:
|
||||
|
||||
```python Code
|
||||
tool = MDXSearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # Options include google, openai, anthropic, llama2, etc.
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# Optional parameters can be included here.
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google", # or openai, ollama, ...
|
||||
config=dict(
|
||||
model="models/embedding-001",
|
||||
task_type="retrieval_document",
|
||||
# Optional title for the embeddings can be added here.
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
88
docs/en/tools/file-document/overview.mdx
Normal file
88
docs/en/tools/file-document/overview.mdx
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
title: "Overview"
|
||||
description: "Read, write, and search through various file formats with CrewAI's document processing tools"
|
||||
icon: "face-smile"
|
||||
---
|
||||
|
||||
These tools enable your agents to work with various file formats and document types. From reading PDFs to processing JSON data, these tools handle all your document processing needs.
|
||||
|
||||
## **Available Tools**
|
||||
|
||||
<CardGroup cols={2}>
|
||||
<Card title="File Read Tool" icon="folders" href="/en/tools/file-document/filereadtool">
|
||||
Read content from any file type including text, markdown, and more.
|
||||
</Card>
|
||||
|
||||
<Card title="File Write Tool" icon="file-pen" href="/en/tools/file-document/filewritetool">
|
||||
Write content to files, create new documents, and save processed data.
|
||||
</Card>
|
||||
|
||||
<Card title="PDF Search Tool" icon="file-pdf" href="/en/tools/file-document/pdfsearchtool">
|
||||
Search and extract text content from PDF documents efficiently.
|
||||
</Card>
|
||||
|
||||
<Card title="DOCX Search Tool" icon="file-word" href="/en/tools/file-document/docxsearchtool">
|
||||
Search through Microsoft Word documents and extract relevant content.
|
||||
</Card>
|
||||
|
||||
<Card title="JSON Search Tool" icon="brackets-curly" href="/en/tools/file-document/jsonsearchtool">
|
||||
Parse and search through JSON files with advanced query capabilities.
|
||||
</Card>
|
||||
|
||||
<Card title="CSV Search Tool" icon="table" href="/en/tools/file-document/csvsearchtool">
|
||||
Process and search through CSV files, extract specific rows and columns.
|
||||
</Card>
|
||||
|
||||
<Card title="XML Search Tool" icon="code" href="/en/tools/file-document/xmlsearchtool">
|
||||
Parse XML files and search for specific elements and attributes.
|
||||
</Card>
|
||||
|
||||
<Card title="MDX Search Tool" icon="markdown" href="/en/tools/file-document/mdxsearchtool">
|
||||
Search through MDX files and extract content from documentation.
|
||||
</Card>
|
||||
|
||||
<Card title="TXT Search Tool" icon="file-lines" href="/en/tools/file-document/txtsearchtool">
|
||||
Search through plain text files with pattern matching capabilities.
|
||||
</Card>
|
||||
|
||||
<Card title="Directory Search Tool" icon="folder-open" href="/en/tools/file-document/directorysearchtool">
|
||||
Search for files and folders within directory structures.
|
||||
</Card>
|
||||
|
||||
<Card title="Directory Read Tool" icon="folder" href="/en/tools/file-document/directoryreadtool">
|
||||
Read and list directory contents, file structures, and metadata.
|
||||
</Card>
|
||||
</CardGroup>
|
||||
|
||||
## **Common Use Cases**
|
||||
|
||||
- **Document Processing**: Extract and analyze content from various file formats
|
||||
- **Data Import**: Read structured data from CSV, JSON, and XML files
|
||||
- **Content Search**: Find specific information within large document collections
|
||||
- **File Management**: Organize and manipulate files and directories
|
||||
- **Data Export**: Save processed results to various file formats
|
||||
|
||||
## **Quick Start Example**
|
||||
|
||||
```python
|
||||
from crewai_tools import FileReadTool, PDFSearchTool, JSONSearchTool
|
||||
|
||||
# Create tools
|
||||
file_reader = FileReadTool()
|
||||
pdf_searcher = PDFSearchTool()
|
||||
json_processor = JSONSearchTool()
|
||||
|
||||
# Add to your agent
|
||||
agent = Agent(
|
||||
role="Document Analyst",
|
||||
tools=[file_reader, pdf_searcher, json_processor],
|
||||
goal="Process and analyze various document types"
|
||||
)
|
||||
```
|
||||
|
||||
## **Tips for Document Processing**
|
||||
|
||||
- **File Permissions**: Ensure your agent has proper read/write permissions
|
||||
- **Large Files**: Consider chunking for very large documents
|
||||
- **Format Support**: Check tool documentation for supported file formats
|
||||
- **Error Handling**: Implement proper error handling for corrupted or inaccessible files
|
||||
71
docs/en/tools/file-document/pdfsearchtool.mdx
Normal file
71
docs/en/tools/file-document/pdfsearchtool.mdx
Normal file
@@ -0,0 +1,71 @@
|
||||
---
|
||||
title: PDF RAG Search
|
||||
description: The `PDFSearchTool` is designed to search PDF files and return the most relevant results.
|
||||
icon: file-pdf
|
||||
---
|
||||
|
||||
# `PDFSearchTool`
|
||||
|
||||
<Note>
|
||||
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
||||
</Note>
|
||||
|
||||
## 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 Code
|
||||
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`: **Optional** 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.
|
||||
|
||||
## Custom model and embeddings
|
||||
|
||||
By default, the tool uses OpenAI for both embeddings and summarization. To customize the model, you can use a config dictionary as follows:
|
||||
|
||||
```python Code
|
||||
tool = PDFSearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # or google, openai, anthropic, llama2, ...
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google", # or openai, ollama, ...
|
||||
config=dict(
|
||||
model="models/embedding-001",
|
||||
task_type="retrieval_document",
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
80
docs/en/tools/file-document/txtsearchtool.mdx
Normal file
80
docs/en/tools/file-document/txtsearchtool.mdx
Normal file
@@ -0,0 +1,80 @@
|
||||
---
|
||||
title: TXT RAG Search
|
||||
description: The `TXTSearchTool` is designed to perform a RAG (Retrieval-Augmented Generation) search within the content of a text file.
|
||||
icon: file-lines
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
<Note>
|
||||
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
||||
</Note>
|
||||
|
||||
This tool is used to perform a RAG (Retrieval-Augmented Generation) search within the content of a text file.
|
||||
It allows for semantic searching of a query within a specified text file's content,
|
||||
making it an invaluable resource for quickly extracting information or finding specific sections of text based on the query provided.
|
||||
|
||||
## Installation
|
||||
|
||||
To use the `TXTSearchTool`, you first need to install the `crewai_tools` package.
|
||||
This can be done using pip, a package manager for Python.
|
||||
Open your terminal or command prompt and enter the following command:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
This command will download and install the TXTSearchTool along with any necessary dependencies.
|
||||
|
||||
## Example
|
||||
|
||||
The following example demonstrates how to use the TXTSearchTool to search within a text file.
|
||||
This example shows both the initialization of the tool with a specific text file and the subsequent search within that file's content.
|
||||
|
||||
```python Code
|
||||
from crewai_tools import TXTSearchTool
|
||||
|
||||
# Initialize the tool to search within any text file's content
|
||||
# the agent learns about during its execution
|
||||
tool = TXTSearchTool()
|
||||
|
||||
# OR
|
||||
|
||||
# Initialize the tool with a specific text file,
|
||||
# so the agent can search within the given text file's content
|
||||
tool = TXTSearchTool(txt='path/to/text/file.txt')
|
||||
```
|
||||
|
||||
## Arguments
|
||||
- `txt` (str): **Optional**. The path to the text file you want to search.
|
||||
This argument is only required if the tool was not initialized with a specific text file;
|
||||
otherwise, the search will be conducted within the initially provided text file.
|
||||
|
||||
## Custom model and embeddings
|
||||
|
||||
By default, the tool uses OpenAI for both embeddings and summarization.
|
||||
To customize the model, you can use a config dictionary as follows:
|
||||
|
||||
```python Code
|
||||
tool = TXTSearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # or google, openai, anthropic, llama2, ...
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google", # or openai, ollama, ...
|
||||
config=dict(
|
||||
model="models/embedding-001",
|
||||
task_type="retrieval_document",
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
77
docs/en/tools/file-document/xmlsearchtool.mdx
Normal file
77
docs/en/tools/file-document/xmlsearchtool.mdx
Normal file
@@ -0,0 +1,77 @@
|
||||
---
|
||||
title: XML RAG Search
|
||||
description: The `XMLSearchTool` is designed to perform a RAG (Retrieval-Augmented Generation) search within the content of a XML file.
|
||||
icon: file-xml
|
||||
---
|
||||
|
||||
# `XMLSearchTool`
|
||||
|
||||
<Note>
|
||||
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
||||
</Note>
|
||||
|
||||
## Description
|
||||
|
||||
The XMLSearchTool is a cutting-edge RAG tool engineered for conducting semantic searches within XML files.
|
||||
Ideal for users needing to parse and extract information from XML content efficiently, this tool supports inputting a search query and an optional XML file path.
|
||||
By specifying an XML path, users can target their search more precisely to the content of that file, thereby obtaining more relevant search outcomes.
|
||||
|
||||
## Installation
|
||||
|
||||
To start using the XMLSearchTool, you must first install the crewai_tools package. This can be easily done with the following command:
|
||||
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
```
|
||||
|
||||
## Example
|
||||
|
||||
Here are two examples demonstrating how to use the XMLSearchTool.
|
||||
The first example shows searching within a specific XML file, while the second example illustrates initiating a search without predefining an XML path, providing flexibility in search scope.
|
||||
|
||||
```python Code
|
||||
from crewai_tools import XMLSearchTool
|
||||
|
||||
# Allow agents to search within any XML file's content
|
||||
#as it learns about their paths during execution
|
||||
tool = XMLSearchTool()
|
||||
|
||||
# OR
|
||||
|
||||
# Initialize the tool with a specific XML file path
|
||||
#for exclusive search within that document
|
||||
tool = XMLSearchTool(xml='path/to/your/xmlfile.xml')
|
||||
```
|
||||
|
||||
## Arguments
|
||||
|
||||
- `xml`: This is the path to the XML file you wish to search.
|
||||
It is an optional parameter during the tool's initialization but must be provided either at initialization or as part of the `run` method's arguments to execute a search.
|
||||
|
||||
## Custom model and embeddings
|
||||
|
||||
By default, the tool uses OpenAI for both embeddings and summarization. To customize the model, you can use a config dictionary as follows:
|
||||
|
||||
```python Code
|
||||
tool = XMLSearchTool(
|
||||
config=dict(
|
||||
llm=dict(
|
||||
provider="ollama", # or google, openai, anthropic, llama2, ...
|
||||
config=dict(
|
||||
model="llama2",
|
||||
# temperature=0.5,
|
||||
# top_p=1,
|
||||
# stream=true,
|
||||
),
|
||||
),
|
||||
embedder=dict(
|
||||
provider="google", # or openai, ollama, ...
|
||||
config=dict(
|
||||
model="models/embedding-001",
|
||||
task_type="retrieval_document",
|
||||
# title="Embeddings",
|
||||
),
|
||||
),
|
||||
)
|
||||
)
|
||||
```
|
||||
Reference in New Issue
Block a user