前置条件
以下示例需要newspaper3k 库。
示例
下面的 Agent 将总结维基百科关于语言模型的文章。cookbook/tools/newspaper_tools.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
newspaper3k 库。
pip install -U newspaper3k
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")
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
get_article_text | bool | True | 启用检索文章文本的功能。 |
| 函数 | 描述 |
|---|---|
get_article_text | 从指定的 URL 检索文章文本。参数包括文章的 URL url。返回文章文本或检索失败时的错误消息。 |