mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-06-02 00:57:41 +08:00
refactor(wechat_kf): rename channel from wechatcom_kf and split corp_id
Rename the WeCom customer-service channel and give it its own corp_id
field so users no longer have to share `wechatcom_corp_id` with the
self-built WeCom app channel.
Renames (channel-side):
- channel type / const: wechatcom_kf -> wechat_kf
- package dir: channel/wechatcom_kf/ -> channel/wechat_kf/
- python files / classes: WechatComKf* -> WechatKf*
- config keys: wechatcom_kf_{secret,token,aes_key,port} ->
wechat_kf_{secret,token,aes_key,port}; new wechat_kf_corp_id
- env vars: WECHATCOM_KF_* -> WECHAT_KF_*; new WECHAT_KF_CORP_ID
- log prefix / cursor file: [wechatcom_kf] -> [wechat_kf]
- web console CHANNEL_DEFS key + startup log line
Renames (docs):
- docs/channels/wecom-kf.mdx -> docs/channels/wechat-kf.mdx (zh/en/ja)
- update docs.json sidebar entries and all field names inside the docs
In addition, the Web Console "微信客服" entry now exposes its own
Corp ID field instead of reusing the wechatcom_app one, and includes
the screenshot of the visual config in the channel guide.
Web Console onboarding section is added (Tabs: Web Console / config
file) and the local URL `http://127.0.0.1:9899/` parenthetical is
dropped for consistency with other channel docs.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
21
config.py
21
config.py
@@ -151,12 +151,12 @@ available_setting = {
|
||||
"wechatcomapp_secret": "", # 企业微信app的secret
|
||||
"wechatcomapp_agent_id": "", # 企业微信app的agent_id
|
||||
"wechatcomapp_aes_key": "", # 企业微信app的aes_key
|
||||
# 微信客服(wechatcom_kf)的配置
|
||||
# 注意: 微信客服与企微自建应用是两套不同的应用,共用 corp_id,但 secret/token/aes_key 各自独立
|
||||
"wechatcom_kf_token": "", # 微信客服回调token
|
||||
"wechatcom_kf_port": 9888, # 微信客服回调服务端口
|
||||
"wechatcom_kf_secret": "", # 微信客服应用的secret
|
||||
"wechatcom_kf_aes_key": "", # 微信客服回调aes_key
|
||||
# 微信客服(wechat_kf)的配置
|
||||
"wechat_kf_corp_id": "", # 微信客服所在企业的corp_id
|
||||
"wechat_kf_token": "", # 微信客服回调token
|
||||
"wechat_kf_port": 9888, # 微信客服回调服务端口
|
||||
"wechat_kf_secret": "", # 微信客服应用的secret
|
||||
"wechat_kf_aes_key": "", # 微信客服回调aes_key
|
||||
# 飞书配置
|
||||
"feishu_port": 80, # 飞书bot监听端口,仅webhook模式需要
|
||||
"feishu_app_id": "", # 飞书机器人应用APP Id
|
||||
@@ -180,7 +180,7 @@ available_setting = {
|
||||
# chatgpt指令自定义触发词
|
||||
"clear_memory_commands": ["#清除记忆"], # 重置会话指令,必须以#开头
|
||||
# channel配置
|
||||
"channel_type": "", # 通道类型,支持多渠道同时运行。单个: "feishu",多个: "feishu, dingtalk" 或 ["feishu", "dingtalk"]。可选值: web,feishu,dingtalk,wecom_bot,weixin,wechatmp,wechatmp_service,wechatcom_app,wechatcom_kf
|
||||
"channel_type": "", # 通道类型,支持多渠道同时运行。单个: "feishu",多个: "feishu, dingtalk" 或 ["feishu", "dingtalk"]。可选值: web,feishu,dingtalk,wecom_bot,weixin,wechatmp,wechatmp_service,wechatcom_app,wechat_kf
|
||||
"web_console": True, # 是否自动启动Web控制台(默认启动)。设为False可禁用
|
||||
"subscribe_msg": "", # 订阅消息, 支持: wechatmp, wechatmp_service, wechatcom_app
|
||||
"debug": False, # 是否开启debug模式,开启后会打印更多日志
|
||||
@@ -417,9 +417,10 @@ def load_config():
|
||||
"wechatcomapp_agent_id": "WECHATCOMAPP_AGENT_ID",
|
||||
"wechatcomapp_secret": "WECHATCOMAPP_SECRET",
|
||||
"wechatcom_corp_id": "WECHATCOM_CORP_ID",
|
||||
"wechatcom_kf_secret": "WECHATCOM_KF_SECRET",
|
||||
"wechatcom_kf_token": "WECHATCOM_KF_TOKEN",
|
||||
"wechatcom_kf_aes_key": "WECHATCOM_KF_AES_KEY",
|
||||
"wechat_kf_corp_id": "WECHAT_KF_CORP_ID",
|
||||
"wechat_kf_secret": "WECHAT_KF_SECRET",
|
||||
"wechat_kf_token": "WECHAT_KF_TOKEN",
|
||||
"wechat_kf_aes_key": "WECHAT_KF_AES_KEY",
|
||||
"qq_app_id": "QQ_APP_ID",
|
||||
"qq_app_secret": "QQ_APP_SECRET",
|
||||
"weixin_token": "WEIXIN_TOKEN",
|
||||
|
||||
Reference in New Issue
Block a user