> ## Documentation Index
> Fetch the complete documentation index at: https://ikun.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Exa

**ExaTools** 使 Agent 能够使用 Exa 搜索网络、检索 URL 内容、查找相似内容并获得 AI 驱动的答案。

## 前提条件

以下示例需要 `exa-py` 库和 API 密钥，可在 [Exa](https://exa.ai) 获取。

```shell theme={null}
pip install -U exa-py
```

```shell theme={null}
export EXA_API_KEY=***
```

## 示例

以下 Agent 将在 Exa 中搜索 AAPL 新闻并打印响应。

```python cookbook/tools/exa_tools.py theme={null}
from agno.agent import Agent
from agno.tools.exa import ExaTools

agent = Agent(
    tools=[ExaTools(
        include_domains=["cnbc.com", "reuters.com", "bloomberg.com"],
        category="news",
        text_length_limit=1000,
    )],
    show_tool_calls=True,
)
agent.print_response("Search for AAPL news", markdown=True)
```

## Toolkit 函数

| 函数             | 描述                     |
| -------------- | ---------------------- |
| `search_exa`   | 使用可选的类别过滤搜索 Exa        |
| `get_contents` | 从特定 URL 检索详细内容         |
| `find_similar` | 查找与给定 URL 相似的内容        |
| `exa_answer`   | 使用 Exa 搜索结果获取 AI 驱动的答案 |

## Toolkit 参数

| 参数                     | 类型                    | 默认值        | 描述                                |
| ---------------------- | --------------------- | ---------- | --------------------------------- |
| `search`               | `bool`                | `True`     | 启用搜索功能                            |
| `get_contents`         | `bool`                | `True`     | 启用内容检索                            |
| `find_similar`         | `bool`                | `True`     | 启用查找相似内容功能                        |
| `answer`               | `bool`                | `True`     | 启用 AI 驱动的答案                       |
| `text`                 | `bool`                | `True`     | 在结果中包含文本内容                        |
| `text_length_limit`    | `int`                 | `1000`     | 每个结果的最大文本长度                       |
| `highlights`           | `bool`                | `True`     | 包含高亮片段                            |
| `summary`              | `bool`                | `False`    | 包含结果摘要                            |
| `num_results`          | `Optional[int]`       | `None`     | 默认结果数量                            |
| `livecrawl`            | `str`                 | `"always"` | Livecrawl 行为                      |
| `start_crawl_date`     | `Optional[str]`       | `None`     | 包含在此日期之后抓取的结果 (年-月-日)             |
| `end_crawl_date`       | `Optional[str]`       | `None`     | 包含在此日期之前抓取的结果 (年-月-日)             |
| `start_published_date` | `Optional[str]`       | `None`     | 包含在此日期之后发布的结果 (年-月-日)             |
| `end_published_date`   | `Optional[str]`       | `None`     | 包含在此日期之前发布的the results (年-月-日)    |
| `use_autoprompt`       | `Optional[bool]`      | `None`     | 启用 autoprompt 功能                  |
| `type`                 | `Optional[str]`       | `None`     | 内容类型过滤 (例如: article, blog, video) |
| `category`             | `Optional[str]`       | `None`     | 类别过滤 (例如: news, research paper)   |
| `include_domains`      | `Optional[List[str]]` | `None`     | 将结果限制在这些域名内                       |
| `exclude_domains`      | `Optional[List[str]]` | `None`     | 排除这些域名的结果                         |
| `show_results`         | `bool`                | `False`    | 记录搜索结果以用于调试                       |
| `model`                | `Optional[str]`       | `None`     | 要使用的搜索模型 ('exa' or 'exa-pro')     |

### 类别

可用于过滤的类别：

* εταιρεία (company)
* 文章 (research paper)
* 新闻 (news)
* pdf
* github
* 鸣叫 (tweet)
* 个人网站 (personal site)
* 领英个人资料 (linkedin profile)
* 金融报告 (financial report)

## 开发者资源

* 查看 [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/exa.py)
* 查看 [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/tools/exa_tools.py)
