zhayujie / chatgpt-on-wechat

基于大模型搭建的聊天机器人,同时支持 微信公众号、企业微信应用、飞书、钉钉 等接入,可选择GPT3.5/GPT-4o/GPT4.0/ Claude/文心一言/讯飞星火/通义千问/ Gemini/GLM-4/Claude/Kimi/LinkAI,能处理文本、语音和图片,访问操作系统和互联网,支持基于自有知识库进行定制企业智能客服。
https://docs.link-ai.tech/cow
MIT License
29.48k stars 7.8k forks source link

使用docker部署 微信公众号模式 但是启动后没有端口监听 #1960

Closed Lands-1203 closed 3 months ago

Lands-1203 commented 3 months ago

前置确认

⚠️ 搜索issues中是否已存在类似问题

操作系统类型?

Linux

运行的python版本是?

python 3.8

使用的chatgpt-on-wechat版本是?

Latest Release

运行的channel类型是?

wechatmp_service(公众号, 服务号)

复现步骤 🕹

version: '2.0'
services:
  chatgpt-on-wechat:
    image: zhayujie/chatgpt-on-wechat
    container_name: chatgpt-on-wechat
    security_opt:
      - seccomp:unconfined
    environment:
      OPEN_AI_API_KEY: 'xxxxxx'
      OPEN_AI_API_BASE: 'https://xxxxxx.com/api'
      MODEL: 'gpt-3.5-turbo'
      PROXY: ''
      SINGLE_CHAT_PREFIX: '["bot", "@bot"]'
      SINGLE_CHAT_REPLY_PREFIX: '"[bot] "'
      GROUP_CHAT_PREFIX: '["@bot"]'
      GROUP_NAME_WHITE_LIST: '["ChatGPT测试群", "ChatGPT测试群2"]'
      IMAGE_CREATE_PREFIX: '["画", "看", "找"]'
      CONVERSATION_MAX_TOKENS: 1000
      SPEECH_RECOGNITION: 'False'
      CHARACTER_DESC: '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。'
      EXPIRES_IN_SECONDS: 3600
      USE_GLOBAL_PLUGIN_CONFIG: 'True'
      USE_LINKAI: 'False'
      LINKAI_API_KEY: ''
      LINKAI_APP_CODE: ''

       # wechatmp的配置
      channel_type: "wechatmp" 
      wechatmp_token: 'xxxxxx' # 微信公众平台的Token
      wechatmp_port: 8080  # 微信公众平台的端口需要端口转发到80或443
      wechatmp_app_id: 'xxxxxx'  # 微信公众平台的appID
      wechatmp_app_secret: 'xxxxxx'  # 微信公众平台的appsecret
      wechatmp_aes_key: 'xxxxxx'  # 微信公众平台的EncodingAESKey,加密模式需要    

问题描述 😯

使用docker部署 运行完成后没有服务启动

终端日志 📒

[root@faamc chatgpt-on-wechat]# docker logs 87662c54a4a7
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: wechatmp_app_secret=xxxxxxxx
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: linkai_api_key=
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: group_chat_prefix=["@bot"]
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: image_create_prefix=["画", "看", "找"]
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: single_chat_reply_prefix="[bot] "
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: conversation_max_tokens=1000
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: open_ai_api_base=https://fastgpt-xxxx.xxxxx.com/api
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: expires_in_seconds=3600
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: single_chat_prefix=["bot", "@bot"]
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: model=gpt-3.5-turbo
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: use_linkai=False
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: wechatmp_token=xxxxxxx
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: proxy=
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: character_desc=你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使 用多种语言与人交流。
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: linkai_app_code=
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: speech_recognition=False
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: group_name_white_list=["ChatGPT测试群", "ChatGPT测试群2"]
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: wechatmp_aes_key=xxxx
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: channel_type=wechatmp
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: wechatmp_app_id=xxxxxxxxxxxx
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: use_global_plugin_config=True
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: open_ai_api_key=fastgpt-xxxxx
[INFO][2024-05-10 08:52:30][config.py:245] - [INIT] override config by environ args: wechatmp_port=8080
[INFO][2024-05-10 08:52:30][config.py:260] - [INIT] load config: {'channel_type': 'wechatmp', 'model': 'gpt-3.5-turbo', 'open_ai_api_key': 'fastgpt-xxxxxxxxxx', 'claude_api_key': 'YOUR API KEY', 'text_to_image': 'dall-e-2', 'voice_to_text': 'openai', 'text_to_voice': 'openai', 'proxy': '', 'hot_reload': False, 'single_chat_prefix': ['bot', '@bot'], 'single_chat_reply_prefix': '[bot] ', 'group_chat_prefix': ['@bot'], 'group_name_white_list': ['ChatGPT测试群', 'ChatGPT测试群2'], 'image_create_prefix': ['画', '看', ' 找'], 'speech_recognition': False, 'group_speech_recognition': False, 'voice_reply_voice': False, 'conversation_max_tokens': 1000, 'expires_in_seconds': 3600, 'character_desc': '你是ChatGPT, 一个由OpenAI训练的大型语言模型, 你旨在回答并解决人们的任何问题,并且可以使用多种语言与人交流。', 'temperature': 0.7, 'subscribe_msg': '感谢您的关注!\n这里是AI智能助手,可以自由对话。\n支持语音对话。\n支持图片输入。\n支持图片输出,画字开头的消息将按要求创作图片。\n支持tool、角色扮演和文字冒险等丰富的插件。\n输入{trigger_prefix}#help 查看详细指令。', 'use_linkai': False, 'linkai_api_key': '', 'linkai_app_code': '', 'wechatmp_app_secret': 'd96a392998ecd11b15479aa7457dad0f', 'open_ai_api_base': 'https://fastgpt-xxxx.xxxxxxx.com/api', 'wechatmp_token': 'xxxx', 'wechatmp_aes_key': 'xxxxxxxx', 'wechatmp_app_id': 'xxxxxxxx', 'use_global_plugin_config': True, 'wechatmp_port': 8080}
[INFO][2024-05-10 08:52:30][config.py:210] - [Config] User datas file not found, ignore.
[INFO][2024-05-10 08:52:30][plugin_manager.py:50] - Loading plugins config...
[INFO][2024-05-10 08:52:30][plugin_manager.py:88] - Scaning plugins ...
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin Banwords_v1.0 registered, path=./plugins/banwords
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin BDunit_v0.1 registered, path=./plugins/bdunit
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin Dungeon_v1.0 registered, path=./plugins/dungeon
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin Finish_v1.0 registered, path=./plugins/finish
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin Godcmd_v1.0 registered, path=./plugins/godcmd
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin Hello_v0.1 registered, path=./plugins/hello
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin Keyword_v0.1 registered, path=./plugins/keyword
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin linkai_v0.1.0 registered, path=./plugins/linkai
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin Role_v1.0 registered, path=./plugins/role
chatgpt-tool-hub version: 0.5.0
[INFO][2024-05-10 08:52:30][plugin_manager.py:41] - Plugin tool_v0.5 registered, path=./plugins/tool
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin GODCMD not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin KEYWORD not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin BANWORDS not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin LINKAI not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin TOOL not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin ROLE not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin DUNGEON not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin BDUNIT not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin HELLO not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][plugin_manager.py:123] - Plugin FINISH not found in pconfig, adding to pconfig...
[INFO][2024-05-10 08:52:30][godcmd.py:194] - [Godcmd] 因未设置口令,本次的临时口令为2508。
[INFO][2024-05-10 08:52:30][godcmd.py:210] - [Godcmd] inited
[INFO][2024-05-10 08:52:30][keyword.py:40] - [keyword] {}
[INFO][2024-05-10 08:52:30][keyword.py:42] - [keyword] inited.
[WARNING][2024-05-10 08:52:30][banwords.py:54] - [Banwords] init failed, ignore or see https://github.com/zhayujie/chatgpt-on-wechat/tree/master/plugins/banwords .
[WARNING][2024-05-10 08:52:30][plugin_manager.py:150] - Failed to init BANWORDS, diabled. [Errno 2] No such file or directory: '/app/plugins/banwords/banwords.txt'
[INFO][2024-05-10 08:52:30][linkai.py:34] - [LinkAI] inited, config={'group_app_map': {'测试群名1': 'default', '测试群名2': 'Kv2fXJcH'}, 'midjourney': {'enabled': False, 'auto_translate': True, 'img_proxy': True, 'max_tasks': 3, 'max_tasks_per_user': 1, 'use_image_create_prefix': True}, 'summary': {'enabled': False, 'group_enabled': True, 'max_file_size': 5000, 'type': ['FILE', 'SHARING']}}
[INFO][2024-05-10 08:52:32][tool.py:28] - [tool] inited
[INFO][2024-05-10 08:52:32][role.py:69] - [Role] inited
[INFO][2024-05-10 08:52:32][dungeon.py:56] - [Dungeon] inited
[WARNING][2024-05-10 08:52:32][bdunit.py:42] - [BDunit] init failed, ignore
[WARNING][2024-05-10 08:52:32][plugin_manager.py:150] - Failed to init BDUNIT, diabled. config.json not found
[INFO][2024-05-10 08:52:32][hello.py:38] - [Hello] inited
[INFO][2024-05-10 08:52:32][finish.py:23] - [Finish] inited
LCYOKO commented 2 months ago

这个问题咋解决的呀

LCYOKO commented 2 months ago

@Lands-1203

Lands-1203 commented 2 months ago

image @LCYOKO

Lands-1203 commented 2 months ago

注意在wechatmp_port的配置是否是8080