先决条件
以下示例需要newspaper4k 和 lxml_html_clean 库。
实战示例
以下 Agent 将总结文章:https://www.rockymountaineer.com/blog/experience-icefields-parkway-scenic-drive-lifetime。cookbook/tools/newspaper4k_tools.py
Toolkit 参数
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
read_article | bool | True | 启用读取文章全文的功能。 |
include_summary | bool | False | 指定是否在返回全文的同时包含文章的摘要。 |
article_length | int | - | 要处理或返回的文章或其摘要的最大长度。 |
Toolkit 函数
| 函数 | 描述 |
|---|---|
get_article_data | 此函数读取文章的全文和数据。 |
read_article | 此函数读取文章的全文。 |