Update newsnow_plugin_config.md

This commit is contained in:
Alireza Jahanshahlou 2025-10-12 17:35:46 +03:30 committed by GitHub
parent 032948f8cb
commit 8ea10d6007
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1,105 +1,105 @@
# get_news_from_newsnow 插件新闻源配置指南 # get_news_from_newsnow plugin news source configuration guide
## 概述 ## Overview
`get_news_from_newsnow` 插件现在支持通过Web管理界面动态配置新闻源,不再需要修改代码。用户可以在智控台中为每个智能体配置不同的新闻源。 The `get_news_from_newsnow` plugin now supports dynamic configuration of news sources through the web management interface, eliminating the need for code modifications. Users can configure different news sources for each agent in the dashboard.
## 配置方式 ## Configuration
### 1. 通过Web管理界面配置(推荐) ### 1. Configuration via the Web Management Interface (Recommended)
1. 登录智控台 1. Log in to the smart console
2. 进入"角色配置"页面 2. Enter the "Role Configuration" page
3. 选择要配置的智能体 3. Select the agent to configure
4. 点击"编辑功能"按钮 4. Click the "Edit Function" button
5. 在右侧参数配置区域找到"newsnow新闻聚合"插件 5. Find the "newsnow news aggregation" plug-in in the parameter configuration area on the right
6. 在"新闻源配置"字段中输入分号分隔的中文名称 6. Enter the Chinese name separated by semicolons in the "News Source Configuration" field
### 2. 配置文件方式 ### 2. Configuration file method
在 `config.yaml` 中配置: Configure in `config.yaml`:
```yaml ```yaml
plugins: plugins:
get_news_from_newsnow: get_news_from_newsnow:
url: "https://newsnow.busiyi.world/api/s?id=" url: "https://newsnow.busiyi.world/api/s?id="
news_sources: "澎湃新闻;百度热搜;财联社;微博;抖音" news_sources: "The Paper; Baidu Trending Search; Cailianshe; Weibo; TikTok"
``` ```
## 新闻源配置格式 ## News source configuration format
新闻源配置使用分号分隔的中文名称,格式为: The news source configuration uses Chinese names separated by semicolons in the following format:
``` ```
中文名称1;中文名称2;中文名称3 Chinese name 1; Chinese name 2; Chinese name 3
``` ```
### 配置示例 ### Configuration Example
``` ```
澎湃新闻;百度热搜;财联社;微博;抖音;知乎;36氪 The Paper; Baidu Trending Search; Cailianshe; Weibo; Douyin; Zhihu; 36Kr
``` ```
## 支持的新闻源 ## Supported News Sources
插件支持以下新闻源的中文名称: The plugin supports the following Chinese names of news sources:
- 澎湃新闻 - The Paper
- 百度热搜 - Baidu Hot Search
- 财联社 - Cailianshe
- 微博 - Weibo
- 抖音 - Tik Tok
- 知乎 - Zhihu
- 36氪 - 36Kr
- 华尔街见闻 - Wall Street Journal
- IT之家 - IT Home
- 今日头条 - Toutiao
- 虎扑 - Hupu
- 哔哩哔哩 - Bilibili
- 快手 - Kuaishou
- 雪球 - Snowball
- 格隆汇 - Gelonghui
- 法布财经 - Fab Finance
- 金十数据 - Jinshi Data
- 牛客 - Niuke
- 少数派 - Minority
- 稀土掘金 - Rare Earth Mining
- 凤凰网 - Phoenix.com
- 虫部落 - Bug Tribe
- 联合早报 - Lianhe Zaobao
- 酷安 - Cool Security
- 远景论坛 - Vision Forum
- 参考消息 - Reference News
- 卫星通讯社 - Satellite News Agency
- 百度贴吧 - Baidu Tieba
- 靠谱新闻 - Reliable News
- 以及更多... - and more...
## 默认配置 ## Default Configuration
如果未配置新闻源,插件将使用以下默认配置: If no news source is configured, the plugin will use the following default configuration:
``` ```
澎湃新闻;百度热搜;财联社 The Paper; Baidu Trending Search; Cailianshe
``` ```
## 使用说明 ## Usage Instructions
1. **配置新闻源**:在Web界面或配置文件中设置新闻源的中文名称,用分号分隔 1. **Configure news source**: Set the Chinese name of the news source in the web interface or configuration file, separated by semicolons
2. **调用插件**:用户可以说"播报新闻"或"获取新闻" 2. **Call plugin**: Users can say "broadcast news" or "get news"
3. **指定新闻源**:用户可以说"播报澎湃新闻"或"获取百度热搜" 3. **Specify news source**: Users can say "report The Paper" or "get Baidu trending searches"
4. **获取详情**:用户可以说"详细介绍这条新闻" 4. **Get details**: Users can say "Get more details about this news"
## 工作原理 How it works
1. 插件接受中文名称作为参数(如"澎湃新闻") 1. The plugin accepts Chinese names as parameters (e.g. "The Paper")
2. 根据配置的新闻源列表,将中文名称转换为对应的英文ID(如"thepaper") 2. According to the configured news source list, convert the Chinese name to the corresponding English ID (such as "thepaper")
3. 使用英文ID调用API获取新闻数据 3. Use the English ID to call the API to obtain news data
4. 返回新闻内容给用户 4. Return news content to the user
## 注意事项 ## Notes
1. 配置的中文名称必须与 CHANNEL_MAP 中定义的名称完全一致 1. The configured Chinese name must be exactly the same as the name defined in CHANNEL_MAP
2. 配置更改后需要重启服务或重新加载配置 2. After the configuration changes, you need to restart the service or reload the configuration
3. 如果配置的新闻源无效,插件会自动使用默认新闻源 3. If the configured news source is invalid, the plugin will automatically use the default news source
4. 多个新闻源之间使用英文分号(;)分隔,不要使用中文分号(;) 4. Use English semicolons (;) to separate multiple news sources. Do not use Chinese semicolons (;).