/ChatGPT-weBot

Chat with ChatGPT (GPT-3.5),WeChat hook interface based

Primary LanguagePython

ChatGPT-weBot

[TOC]

Using ChatGPT-weBot based on ChatGPT(Non-API key call) and official WeChat hook interface. 中文文档 | English

Author

Snapdragon Lee (github.com)

cover created from DALL·E2 (openai.com)

Support & Features

  • Support conversation.
  • Support context-aware question answering
  • Never get banned by using official WeChat execution.
  • Set the keywords to wake up the WeChat robot in private.
  • Set the keywords to wake up the WeChat robot in the group.
  • Support replying at-message when mentioning your bot in the group. (have bugs)
  • Get help doc in line.
  • Set keywords to reset the previous conversation.
  • Regenerate to get another answer.
  • Rollback conversation.
  • Other

Default configs (Follow steps before you start server)

{
  // Setting host running locally (only local)
  "server_host": "127.0.0.1:5555",

  // Whether to enable ChatGPT auto-reply function
  "autoReply": true,
  // Setting keyword to wake up bot in group chat
  "groupChatKey": "-c",
  // Using reply mode in group chat
  "grpReplyMode": false,
  // Origin question quote on head of answer in group chat
  "grpCitationMode": true,
  // Setting keyword to wake up bot in private chat
  "privateChatKey": "-c",
  // Using reply mode in private chat
  "prvReplyMode": true,
  // Origin question quote on head of answer in private chat
  "prvCitationMode": false,

  // View available command help
  "helpKey": "-h",
  // Setting keyword to reset context
  "resetChatKey": "-rs",
  // Setting keyword to regenerate previous answer
  "regenerateKey": "-rg",
  // Setting keyword to roll back to previous n questions
  "rollbackKey": "-rb"
}

Step to Start

  1. Install all packages listed in requirements.txt , use the command like:

    pip install -r ./requirements.txt
    
  2. Download package from Github Releases.

  3. Install WeChat-3.6.0.18.exe on your computer, if your version is higher than 3.6.0.18, you can downgrade instantly. Then get your account online.

  4. Monitoring WeChat message by running a server. Here are two methods to achieve this, please choose 1 method :

    • Using injector named DLLinjector_V1.0.3.exe, then choose file named 3.6.0.18-0.0.0.008.dll to inject.

      image-20230221044543472

    • Running funtool_3.6.0.18-1.0.0013.exe , and press Start .

      image-20230221044609319

  5. The last step is fill json files listed in .config/ .

    • In config.json , you need to configure your custom options based on your preferences.

    • In rev_config.json , you need to fill your ChatGPT login information by choosing 1 method:

      • Email/Password (Not supported for Google/Microsoft accounts)

      • session_token (supported for Google/Microsoft accounts)

        1. Go to chat.openai.com/chat and log in or sign up.
        2. Press F12 to open dev tools.
        3. Copy cookies as __Secure-next-auth.session-token .
  6. Run main.py by using command:

    python main.py
    

    Everything is ready, feel free to go online with your ChatGPT-weBot !

    No limitation, No usage counting, and no payment needed.

Q&A

  1. How to get all response? You can say "continue" in your language.
  2. Have problems? Feel free to create an issue.

Who has starred

Stargazers repo roster for @SnapdragonLee/ChatGPT-weBot

Stargazers over time

Stargazers over time

Log

  • 2023.2.25 Add the option in config.json to quote the original question before answering
  • 2023.2.25 Complete all API function on features and Debugs for errors
  • 2023.2.23 Accomplish some API listed on features
  • 2023.2.23 Fix streaming issue when connecting to reverse server
  • 2023.2.21 Report issue on ChatGPT API
  • 2023.2.20 v0.90-dev released, for basic ChatGPT API usage on WeChat
  • 2023.2.17 Start to develop the whole process
Reference