mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 08:08:32 +00:00
36 lines
1.5 KiB
Markdown
36 lines
1.5 KiB
Markdown
# DOCXSearchTool
|
|
|
|
!!! note "Depend on OpenAI"
|
|
All RAG tools at the moment can only use openAI to generate embeddings, we are working on adding support for other providers.
|
|
|
|
!!! note "Experimental"
|
|
We are still working on improving tools, so there might be unexpected behavior or changes in the future.
|
|
|
|
## 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.
|