wechat-chatgpt README

The project's README from github.com/fuergaosi233/wechat-chatgpt. As one markdown file: README.md.

!!!! Project Archived 📦 !!!!

This project has been archived. Thank you to everyone who contributed! 🙌😔

Welcome to wechat-chatgpt 👋

Version License: ISC Twitter: fuergaosi join discord community of github profile readme generator

Use ChatGPT On Wechat via wechaty
English | 中文文档

Deploy on Railway

🌟 Features

🚀 Usage

Use with Railway

Railway offers $5 or 500 hours of runtime per month

  1. Click the Railway button to go to the Railway deployment page
  2. Click the Deploy Now button to enter the Railway deployment page
  3. Fill in the repository name and OPENAI_API_KEY (need to link GitHub account)
  4. Click the Deploy button
  5. Click the View Logs button and wait for the deployment to complete

Use with Fly.io

Please allocate 512MB memory for the application to meet the application requirements

fly.io offers free bills up to $5(Free Allowances 3 256MB are not included in the bill)

  1. Install flyctl
     # macOS
     brew install flyctl
     # Windows
     scoop install flyctl
     # Linux
     curl https://fly.io/install.sh | sh
    
  2. Clone the project and enter the project directory
    git clone https://github.com/fuergaosi233/wechat-chatgpt.git && cd wechat-chatgpt
    
  3. Create a new app
    ➜ flyctl launch 
     ? Would you like to copy its configuration to the new app? No
     ? App Name (leave blank to use an auto-generated name): <YOUR APP NAME>
     ? Select region: <YOUR CHOOSE REGION>
     ? Would you like to setup a Postgresql database now? No
     ? Would you like to deploy now? No
    
  4. Configure the environment variables
    flyctl secrets set OPENAI_API_KEY="<YOUR OPENAI API KEY>" MODEL="<CHATGPT-MODEL>"
    
  5. Deploy the app
    flyctl deploy
    

Use with docker

# pull image
docker pull holegots/wechat-chatgpt
# run container
docker run -d --name wechat-chatgpt \
    -e OPENAI_API_KEY=<YOUR OPENAI API KEY> \
    -e MODEL="gpt-3.5-turbo" \
    -e CHAT_PRIVATE_TRIGGER_KEYWORD="" \
    -v $(pwd)/data:/app/data/wechat-assistant.memory-card.json \
    holegots/wechat-chatgpt:latest
# View the QR code to log in to wechat
docker logs -f wechat-chatgpt

How to get OPENAI API KEY? Click here

Use with docker compose

# Copy the configuration file according to the template
cp .env.example .env
# Edit the configuration file
vim .env
# Start the container
docker-compose up -d
# View the QR code to log in to wechat
docker logs -f wechat-chatgpt

Use with nodejs

You need NodeJS 18.0.0 version and above

# Clone the project
git clone https://github.com/fuergaosi233/wechat-chatgpt.git && cd wechat-chatgpt
# Install dependencies
npm install
# Copy the configuration file according to the template
cp .env.example .env
# Edit the configuration file
vim .env
# Start project
npm run dev

Please make sure your WeChat account can log in WeChat on web

📝 Environment Variables

name description
API API endpoint of ChatGPT
OPENAI_API_KEY create new secret key
MODEL ID of the model to use. Currently, only gpt-3.5-turbo and gpt-3.5-turbo-0301 are supported.
TEMPERATURE What sampling temperature to use, between 0 and 2. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.
CHAT_TRIGGER_RULE Private chat triggering rules.
DISABLE_GROUP_MESSAGE Prohibited to use ChatGPT in group chat.
CHAT_PRIVATE_TRIGGER_KEYWORD Keyword to trigger ChatGPT reply in WeChat private chat
BLOCK_WORDS Chat blocker words, (works for both private and group chats, Use, Split)
CHATGPT_BLOCK_WORDS The blocked words returned by ChatGPT(works for both private and group chats, Use, Split)

📝 Using Custom ChatGPT API

https://github.com/fuergaosi233/openai-proxy

# Clone the project
git clone https://github.com/fuergaosi233/openai-proxy
# Install dependencies
npm install && npm install -g wrangler && npm run build
# Deploy to CloudFlare Workers
npm run deploy
# Custom domain (optional)
Add `Route` to `wrangler.toml`
routes = [
    { pattern = "Your Custom Domain", custom_domain = true },
]

⌨️ Commands

Enter in the WeChat chat box

/cmd help # Show help
/cmd prompt <PROMPT> # Set prompt
/cmd clear # Clear all sessions since last boot

✨ Contributor

🤝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

wechat-chatgpt (fuergaosi233/wechat-chatgpt)

Searching Database…

这是干什么的?一个把 ChatGPT 接入微信的机器人:你自己部署它,之后你的微信账号就能在私聊和群聊里和 GPT-3.5 对话。它基于 wechaty 库构建,调用 OpenAI 官方 API。
这是装进微信 App 里的插件,还是我单独运行的东西?需要单独运行:它是一个 Node.js 机器人,通过 wechaty 用你自己的账号登录微信,所以这个账号必须能在网页版微信上登录。
怎么把它跑起来?有五种方式,README 里都写了:Railway 一键部署、Fly.io、docker、docker compose,或者直接用 Node.js 18+ 运行。推荐 Railway——点击 Deploy,关联 GitHub,填入你的 OPENAI_API_KEY,然后等日志就行。
部署之前我需要准备什么?需要一个 OpenAI API 密钥(即 OPENAI_API_KEY 变量)、一个能登录网页版微信的微信账号;如果不用 Docker,还需要 Node.js 18 或更高版本。用 Fly.io 部署的话应分配 512MB 内存。
这个项目还在积极维护吗?没有了——它已被归档,不会再有更新。而且它只支持旧的 gpt-3.5-turbo 模型,还要求账号能登录网页版微信,所以随时可能失效。
有免费的托管方式吗?有——Railway 每月提供 5 美元或 500 小时运行时长,Fly.io 有最高 5 美元的免费额度,README 把两者都标为推荐的免费方案;用 Docker 自己部署也是免费的。
能让它不说某些内容吗?可以。BLOCK_WORDS 过滤用户能问什么,CHATGPT_BLOCK_WORDS 过滤 ChatGPT 返回的回答;两者都是逗号分隔的列表,在私聊和群聊里都有效。
我能控制在私聊里它什么时候回复吗?可以——CHAT_PRIVATE_TRIGGER_KEYWORD 用来设置触发私聊回复的关键词,CHAT_TRIGGER_RULE 定义私聊的触发规则。
Size
1.3 MB
Stars
13.2K
Age
3y
Commits · 90 Days