mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-07 15:18:29 +00:00
better docs and download missing packaged
This commit is contained in:
@@ -6,7 +6,7 @@ This tool is designed to perform a semantic search for a specified query from a
|
||||
## Installation
|
||||
To incorporate this tool into your project, follow the installation instructions below:
|
||||
```shell
|
||||
pip install 'crewai[tools]'
|
||||
uv add crewai[tools] exa_py
|
||||
```
|
||||
|
||||
## Example
|
||||
@@ -16,7 +16,7 @@ The following example demonstrates how to initialize the tool and execute a sear
|
||||
from crewai_tools import EXASearchTool
|
||||
|
||||
# Initialize the tool for internet searching capabilities
|
||||
tool = EXASearchTool()
|
||||
tool = EXASearchTool(api_key="your_api_key")
|
||||
```
|
||||
|
||||
## Steps to Get Started
|
||||
|
||||
@@ -48,7 +48,19 @@ class EXASearchTool(BaseTool):
|
||||
**kwargs,
|
||||
)
|
||||
if not EXA_INSTALLED:
|
||||
raise ImportError("`exa-py` package not found, please run `uv add exa-py`")
|
||||
import click
|
||||
|
||||
if click.confirm(
|
||||
"You are missing the 'exa_py' package. Would you like to install it?"
|
||||
):
|
||||
import subprocess
|
||||
|
||||
subprocess.run(["uv", "add", "exa_py"], check=True)
|
||||
|
||||
else:
|
||||
raise ImportError(
|
||||
"You are missing the 'exa_py' package. Would you like to install it?"
|
||||
)
|
||||
self.client = Exa(api_key=api_key)
|
||||
self.content = content
|
||||
self.summary = summary
|
||||
|
||||
Reference in New Issue
Block a user