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

# Newspaper

**NewspaperTools** 支持 Agent 使用 Newspaper4k 库阅读新闻文章。

## 前置条件

以下示例需要 `newspaper3k` 库。

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

## 示例

下面的 Agent 将总结维基百科关于语言模型的文章。

```python cookbook/tools/newspaper_tools.py theme={null}
from agno.agent import Agent
from agno.tools.newspaper import NewspaperTools

agent = Agent(tools=[NewspaperTools()])
agent.print_response("Please summarize https://en.wikipedia.org/wiki/Language_model")
```

## Toolkit 参数

| 参数                 | 类型     | 默认值    | 描述           |
| ------------------ | ------ | ------ | ------------ |
| `get_article_text` | `bool` | `True` | 启用检索文章文本的功能。 |

## Toolkit 函数

| 函数                 | 描述                                                   |
| ------------------ | ---------------------------------------------------- |
| `get_article_text` | 从指定的 URL 检索文章文本。参数包括文章的 URL `url`。返回文章文本或检索失败时的错误消息。 |

## 开发者资源

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