> ## 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.

# Arxiv

**ArxivTools** 允许代理在 Arxiv 上搜索出版物。

## 先决条件

以下示例需要 `arxiv` 和 `pypdf` 库。

```shell theme={null}
pip install -U arxiv pypdf
```

## 示例

下面的代理将搜索 arXiv 中关于“语言模型”的内容并打印响应。

```python cookbook/tools/arxiv_tools.py theme={null}
from agno.agent import Agent
from agno.tools.arxiv import ArxivTools

agent = Agent(tools=[ArxivTools()], show_tool_calls=True)
agent.print_response("Search arxiv for 'language models'", markdown=True)
```

## Toolkit 参数

| 参数                  | 类型     | 默认值    | 描述                 |
| ------------------- | ------ | ------ | ------------------ |
| `search_arxiv`      | `bool` | `True` | 启用搜索 arXiv 数据库的功能。 |
| `read_arxiv_papers` | `bool` | `True` | 允许直接阅读 arXiv 论文。   |
| `download_dir`      | `Path` | -      | 指定下载文件将保存的目录路径。    |

## Toolkit 函数

| 函数                                       | 描述                               |
| ---------------------------------------- | -------------------------------- |
| `search_arxiv_and_update_knowledge_base` | 此函数在 arXiv 上搜索主题，将结果添加到知识库并返回它们。 |
| `search_arxiv`                           | 在 arXiv 上搜索查询。                   |

## Developer Resources

* 查阅 [Tools](https://github.com/agno-agi/agno/blob/main/libs/agno/agno/tools/arxiv.py)
* 查阅 [Cookbook](https://github.com/agno-agi/agno/blob/main/cookbook/tools/arxiv_tools.py)
