General Introduction
ChatGPT-on-WeChat project is a big model-based intelligent dialog bot that supports multi-platform access for personal WeChat, WeChat public number, enterprise WeChat application, Feishu, Nail and so on. Users can choose from a variety of models such as GPT3.5, GPT-4, Claude, Wenxin Yiyin, Xunfei Starfire, Tongyi Thousand Questions, Gemini, GLM-4, Kimi, etc. It can process text, voice and images, access the operating system and the Internet, and support customized enterprise intelligent customer service based on its own knowledge base. Some of the capabilities are provided by LinkAI Provide support.
Function List
- multiterminal deployment: Supports WeChat, enterprise WeChat apps, Flybook, pinning, and many other deployment methods.
- BASIC DIALOGUE: Intelligent replies to messages in private and group chats, with support for multiple rounds of session context memorization.
- phonetic ability: Recognizes voice messages and replies via text or speech, supporting multiple voice models.
- image capability: Supports image generation, image recognition, diagram generation (e.g., photo restoration), and multiple image models can be selected.
- Rich Plug-ins: Support for personalized plug-in extensions, has implemented multiple role switching, text adventures, sensitive word filtering, chat log summaries, document summaries and conversations, networking search and other plug-ins.
- repository: Customize the exclusive bot by uploading knowledge base files, which can be used as digital splitter, intelligent customer service, private domain assistant, based on LinkAI implementation.
Using Help
Installation process
- Preparing the environment: Support Linux, MacOS, Windows system (can run on Linux server for a long time), and need to install Python at the same time. suggested Python version between 3.7.1~3.9.X, recommended version 3.8.
- Cloning Project Code::
git clone https://github.com/zhayujie/chatgpt-on-wechat cd chatgpt-on-wechat/
- Installing core dependencies::
pip3 install -r requirements.txt
- configuration file: Copy the profile template and create the final effective profile:
cp config-template.json config.json
Then fill out the configuration in config.json with the following configuration items:
{ "model": "gpt-3.5-turbo", "open_ai_api_key". "single_chat_prefix": ["bot", "@bot"], "single_chat_reply_prefix": "[bot]", "group_chat_prefix": ["@bot"], "group_name_white_list": ["ChatGPT Test Groups", "ChatGPT Test Group 2"], "image_create_prefix": ["draw", "look", "find"], "conversation_max_tokens": 1000, "speech_recognition": false, "group_speech_recognition". "group_speech_recognition": false, "voice_reply_voice": false, "voice_reply_voice": false, "character_desc": false "character_desc": "You are an AI intelligent assistant based on a big language model designed to answer and solve any question people have and can communicate with people in multiple languages." , "use_linkai": false, "linkai_api_key": "", "linkai_app_code": "" }
- local operation: Executed in the project root directory:
python3 app.py
After the terminal outputs the QR code, scan the code and log in. When "Start auto replying" is output, it means the auto replying program has been successfully run.
Regarding the transit API, it supports third-party OpenAI proxies and API keys, you can find the "open_ai_api_base" parameter in the config.py file, copy it to the config.json file, and fill in the URL of the proxy service.
"open_ai_api_base": "Transit api address, example: https://exmaple.com/v1"
Instructions for use
- private chatIn a private chat, the bot needs to be triggered by something starting with "bot" or "@bot", which corresponds to the configuration item single_chat_prefix, and the bot's reply is prefixed with "[ bot]" to distinguish it from a real person, which corresponds to the configuration item single_chat_reply_prefix. bot]" as a prefix to distinguish it from a real person, corresponding to the single_chat_reply_prefix.
- group chatIn group chat, group name needs to be configured in group_name_white_list in order to enable group chat auto-reply. By default, the bot will be triggered to reply as long as it is @. In addition, the bot will also reply as long as it detects content starting with "@bot" in the group chat, which corresponds to the configuration item group_chat_prefix.
- Image Generation: In addition to satisfying the individual or group trigger conditions, an additional keyword prefix is required to trigger, corresponding to the configuration item image_create_prefix.
- speech recognitionAdd "speech_recognition": true to enable speech recognition, default is to use openai's whisper model to recognize as text, and reply with text, this parameter only supports private chat.
- Plug-in use: Supports personalized plug-in extensions that provide the ability to role-play, text adventures, interact with the operating system, access network data, and more.