From a492bc2242c44c4b1326c69c2818f5b1807c4969 Mon Sep 17 00:00:00 2001 From: vision Date: Thu, 26 Jun 2025 19:24:39 +0800 Subject: [PATCH 1/3] docs: expand channel usage --- README.md | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 72 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 83aba36..f90ece4 100644 --- a/README.md +++ b/README.md @@ -635,7 +635,78 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn) -更多通道说明:Coming soon... +
+微信公众号 + +本项目支持订阅号和服务号两种公众号,通过服务号(`wechatmp_service`)体验更佳。将下列配置加入 `config.json`: + +```json +{ + "channel_type": "wechatmp", + "wechatmp_token": "TOKEN", + "wechatmp_port": 8080, + "wechatmp_app_id": "APPID", + "wechatmp_app_secret": "APPSECRET", + "wechatmp_aes_key": "" +} +``` + +服务器默认监听8080端口,可通过端口转发使微信服务器访问80或443端口。 + +
+ +
+企业微信应用 + +企业微信自建应用接入需在后台创建应用并启用消息回调,配置示例: + +```json +{ + "channel_type": "wechatcom_app", + "wechatcom_corp_id": "CORPID", + "wechatcomapp_token": "TOKEN", + "wechatcomapp_port": 9898, + "wechatcomapp_secret": "SECRET", + "wechatcomapp_agent_id": "AGENTID", + "wechatcomapp_aes_key": "AESKEY" +} +``` + +扫码关注企业后即可与机器人对话。 + +
+ +
+钉钉 + +钉钉需要在开放平台创建智能机器人应用,将以下配置填入 `config.json`: + +```json +{ + "channel_type": "dingtalk", + "dingtalk_client_id": "CLIENT_ID", + "dingtalk_client_secret": "CLIENT_SECRET" +} +``` + +
+ +
+飞书 + +飞书机器人回调服务依赖 `feishu_app_id` 等参数: + +```json +{ + "channel_type": "feishu", + "feishu_app_id": "APP_ID", + "feishu_app_secret": "APP_SECRET", + "feishu_token": "VERIFICATION_TOKEN", + "feishu_port": 80 +} +``` + +

From 94e78365a50100499d40e865ee22d12cbe841bf7 Mon Sep 17 00:00:00 2001 From: 6vision Date: Sun, 29 Jun 2025 17:49:26 +0800 Subject: [PATCH 2/3] docs: expand channel usage --- README.md | 16 ++++++++-------- channel/wechatcom/README.md | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index f90ece4..e87be30 100644 --- a/README.md +++ b/README.md @@ -617,7 +617,7 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn) "web_port": 9899 } ``` - +- `web_port`: 默认为 9899,需服务器防火墙和安全组放行该端口。如更改了端口配置,请访问 `http://localhost:ports/chat` (请将url中的ports替换为实际的端口)
@@ -644,14 +644,15 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn) { "channel_type": "wechatmp", "wechatmp_token": "TOKEN", - "wechatmp_port": 8080, + "wechatmp_port": 80, "wechatmp_app_id": "APPID", "wechatmp_app_secret": "APPSECRET", "wechatmp_aes_key": "" } ``` +- `channel_type`: 个人订阅号为`wechatmp`,企业服务号为`wechatmp_service` -服务器默认监听8080端口,可通过端口转发使微信服务器访问80或443端口。 +详细步骤和参数说明参考 [微信公众号接入](https://docs.link-ai.tech/cow/multi-platform/wechat-mp)
@@ -671,8 +672,7 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn) "wechatcomapp_aes_key": "AESKEY" } ``` - -扫码关注企业后即可与机器人对话。 +详细步骤和参数说明参考 [企微自建应用接入](https://docs.link-ai.tech/cow/multi-platform/wechat-com) @@ -688,13 +688,13 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn) "dingtalk_client_secret": "CLIENT_SECRET" } ``` - +详细步骤和参数说明参考 [钉钉接入](https://docs.link-ai.tech/cow/multi-platform/dingtalk)
飞书 -飞书机器人回调服务依赖 `feishu_app_id` 等参数: +通过自建应用接入AI相关能力到飞书应用中,默认已是飞书的企业用户,且具有企业管理权限,将以下配置填入 `config.json`:: ```json { @@ -705,7 +705,7 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn) "feishu_port": 80 } ``` - +详细步骤和参数说明参考 [飞书接入](https://docs.link-ai.tech/cow/multi-platform/feishu)

diff --git a/channel/wechatcom/README.md b/channel/wechatcom/README.md index 2f54a79..a4cf04f 100644 --- a/channel/wechatcom/README.md +++ b/channel/wechatcom/README.md @@ -78,8 +78,8 @@ Error code: 60020, message: "not allow to access from your ip, ...from ip: xx.xx ~~填写配置后,将部署完成后的网址```**.railway.app/wxcomapp```,填写在上一步的URL中。发送信息后观察日志,把报错的IP加入到可信IP。(每次重启后都需要加入可信IP)~~ -## 测试体验 +~~## 测试体验~~ -AIGC开放社区中已经部署了多个可免费使用的Bot,扫描下方的二维码会自动邀请你来体验。 +~~AIGC开放社区中已经部署了多个可免费使用的Bot,扫描下方的二维码会自动邀请你来体验。~~ - +~~~~ From e75bed1be51bbd28560a166c65f93aab1b888a2a Mon Sep 17 00:00:00 2001 From: 6vision Date: Sun, 29 Jun 2025 18:34:49 +0800 Subject: [PATCH 3/3] docs: update README.md --- README.md | 6 ++++-- channel/web/web_channel.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e87be30..282689f 100644 --- a/README.md +++ b/README.md @@ -609,7 +609,7 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn)
Web -项目启动后默认运行web通道,可以通过访问 http://localhost:9899/chat 在网页端进行对话,通过修改 `web_port` 配置可自定义服务端口。 +项目启动后默认运行web通道,配置如下: ```json { @@ -617,7 +617,9 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn) "web_port": 9899 } ``` -- `web_port`: 默认为 9899,需服务器防火墙和安全组放行该端口。如更改了端口配置,请访问 `http://localhost:ports/chat` (请将url中的ports替换为实际的端口) +- `web_port`: 默认为 9899,可按需更改,需要服务器防火墙和安全组放行该端口 +- 如本地运行,启动后请访问 `http://localhost:port/chat` ;如服务器运行,请访问 `http://ip:port/chat` +> 注:请将上述 url 中的 ip 或者 port 替换为实际的值
diff --git a/channel/web/web_channel.py b/channel/web/web_channel.py index b937f87..7721728 100644 --- a/channel/web/web_channel.py +++ b/channel/web/web_channel.py @@ -198,7 +198,7 @@ class WebChannel(ChatChannel): 5. wechatcom_app: 企微自建应用 6. dingtalk: 钉钉 7. feishu: 飞书""") - logger.info(f"Web对话网页已运行, 请使用浏览器访问 http://localhost:{port}/chat") + logger.info(f"Web对话网页已运行, 请使用浏览器访问 http://localhost:{port}/chat(本地运行)或 http://ip:{port}/chat(服务器运行) ") # 确保静态文件目录存在 static_dir = os.path.join(os.path.dirname(__file__), 'static')