Skip to content

Commit 8c16227

Browse files
authored
Merge pull request #2612 from 6vision/master
docs: expand channel usage
2 parents 29c056c + e75bed1 commit 8c16227

File tree

3 files changed

+80
-7
lines changed

3 files changed

+80
-7
lines changed

README.md

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -609,15 +609,17 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn)
609609
<details>
610610
<summary>Web</summary>
611611

612-
项目启动后默认运行web通道,可以通过访问 http://localhost:9899/chat 在网页端进行对话,通过修改 `web_port` 配置可自定义服务端口。
612+
项目启动后默认运行web通道,配置如下:
613613

614614
```json
615615
{
616616
"channel_type": "web",
617617
"web_port": 9899
618618
}
619619
```
620-
620+
- `web_port`: 默认为 9899,可按需更改,需要服务器防火墙和安全组放行该端口
621+
- 如本地运行,启动后请访问 `http://localhost:port/chat` ;如服务器运行,请访问 `http://ip:port/chat`
622+
> 注:请将上述 url 中的 ip 或者 port 替换为实际的值
621623
</details>
622624
623625
<details>
@@ -635,7 +637,78 @@ API Key创建:在 [控制台](https://aistudio.google.com/app/apikey?hl=zh-cn)
635637

636638
</details>
637639

638-
更多通道说明:Coming soon...
640+
<details>
641+
<summary>微信公众号</summary>
642+
643+
本项目支持订阅号和服务号两种公众号,通过服务号(`wechatmp_service`)体验更佳。将下列配置加入 `config.json`
644+
645+
```json
646+
{
647+
"channel_type": "wechatmp",
648+
"wechatmp_token": "TOKEN",
649+
"wechatmp_port": 80,
650+
"wechatmp_app_id": "APPID",
651+
"wechatmp_app_secret": "APPSECRET",
652+
"wechatmp_aes_key": ""
653+
}
654+
```
655+
- `channel_type`: 个人订阅号为`wechatmp`,企业服务号为`wechatmp_service`
656+
657+
详细步骤和参数说明参考 [微信公众号接入](https://docs.link-ai.tech/cow/multi-platform/wechat-mp)
658+
659+
</details>
660+
661+
<details>
662+
<summary>企业微信应用</summary>
663+
664+
企业微信自建应用接入需在后台创建应用并启用消息回调,配置示例:
665+
666+
```json
667+
{
668+
"channel_type": "wechatcom_app",
669+
"wechatcom_corp_id": "CORPID",
670+
"wechatcomapp_token": "TOKEN",
671+
"wechatcomapp_port": 9898,
672+
"wechatcomapp_secret": "SECRET",
673+
"wechatcomapp_agent_id": "AGENTID",
674+
"wechatcomapp_aes_key": "AESKEY"
675+
}
676+
```
677+
详细步骤和参数说明参考 [企微自建应用接入](https://docs.link-ai.tech/cow/multi-platform/wechat-com)
678+
679+
</details>
680+
681+
<details>
682+
<summary>钉钉</summary>
683+
684+
钉钉需要在开放平台创建智能机器人应用,将以下配置填入 `config.json`
685+
686+
```json
687+
{
688+
"channel_type": "dingtalk",
689+
"dingtalk_client_id": "CLIENT_ID",
690+
"dingtalk_client_secret": "CLIENT_SECRET"
691+
}
692+
```
693+
详细步骤和参数说明参考 [钉钉接入](https://docs.link-ai.tech/cow/multi-platform/dingtalk)
694+
</details>
695+
696+
<details>
697+
<summary>飞书</summary>
698+
699+
通过自建应用接入AI相关能力到飞书应用中,默认已是飞书的企业用户,且具有企业管理权限,将以下配置填入 `config.json`::
700+
701+
```json
702+
{
703+
"channel_type": "feishu",
704+
"feishu_app_id": "APP_ID",
705+
"feishu_app_secret": "APP_SECRET",
706+
"feishu_token": "VERIFICATION_TOKEN",
707+
"feishu_port": 80
708+
}
709+
```
710+
详细步骤和参数说明参考 [飞书接入](https://docs.link-ai.tech/cow/multi-platform/feishu)
711+
</details>
639712

640713
<br/>
641714

channel/web/web_channel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ def startup(self):
198198
5. wechatcom_app: 企微自建应用
199199
6. dingtalk: 钉钉
200200
7. feishu: 飞书""")
201-
logger.info(f"Web对话网页已运行, 请使用浏览器访问 http://localhost:{port}/chat")
201+
logger.info(f"Web对话网页已运行, 请使用浏览器访问 http://localhost:{port}/chat(本地运行)或 http://ip:{port}/chat(服务器运行) ")
202202

203203
# 确保静态文件目录存在
204204
static_dir = os.path.join(os.path.dirname(__file__), 'static')

channel/wechatcom/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ Error code: 60020, message: "not allow to access from your ip, ...from ip: xx.xx
7878

7979
~~填写配置后,将部署完成后的网址```**.railway.app/wxcomapp```,填写在上一步的URL中。发送信息后观察日志,把报错的IP加入到可信IP。(每次重启后都需要加入可信IP)~~
8080

81-
## 测试体验
81+
~~## 测试体验~~
8282

83-
AIGC开放社区中已经部署了多个可免费使用的Bot,扫描下方的二维码会自动邀请你来体验。
83+
~~AIGC开放社区中已经部署了多个可免费使用的Bot,扫描下方的二维码会自动邀请你来体验。~~
8484

85-
<img width="200" src="../../docs/images/aigcopen.png">
85+
~~<img width="200" src="../../docs/images/aigcopen.png">~~

0 commit comments

Comments
 (0)