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

# JinaReader

**JinaReaderTools** 使 Agent 能够执行使用 Jina 的网络搜索任务。

## 先决条件

下面的示例需要 `jina` 库。

```shell theme={null}
pip install -U jina
```

## 示例

下面的 Agent 将使用 Jina API 总结 [https://github.com/AgnoAgi](https://github.com/AgnoAgi) 的内容。

```python cookbook/tools/jinareader.py theme={null}
from agno.agent import Agent
from agno.tools.jina import JinaReaderTools

agent = Agent(tools=[JinaReaderTools()])
agent.print_response("Summarize: https://github.com/AgnoAgi")
```

## Toolkit 参数

| 参数                   | 类型    | 默认值 | 描述                     |
| -------------------- | ----- | --- | ---------------------- |
| `api_key`            | `str` | -   | 用于身份验证的 API 密钥，从配置中检索。 |
| `base_url`           | `str` | -   | API 的基本 URL，从配置中检索。    |
| `search_url`         | `str` | -   | 用于搜索查询的 URL，从配置中检索。    |
| `max_content_length` | `int` | -   | 允许的内容最大长度，从配置中检索。      |

## Toolkit 函数

| 函数             | 描述                                                                          |
| -------------- | --------------------------------------------------------------------------- |
| `read_url`     | 使用 Jina Reader API 读取指定 URL 的内容。参数包括用于读取的 URL 的 `url`。如果请求失败，则返回截断的内容或错误消息。 |
| `search_query` | 基于指定查询使用 Jina Reader API 执行网络搜索。参数包括搜索词的 `query`。如果请求失败，则返回截断的搜索结果或错误消息。    |

## 开发者资源

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