Skip to content

Commit

Permalink
Merge pull request #781 from RealTong/chatgpt-api
Browse files Browse the repository at this point in the history
Add documents
  • Loading branch information
RealTong authored Mar 22, 2023
2 parents 02b0aac + 0eba8b8 commit 173faae
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ OPENAI_API_KEY=""
MODEL="gpt-3.5-turbo"
CHAT_PRIVATE_TRIGGER_KEYWORD=
TEMPERATURE=
BLOCK_WORDS="SB, VPN"
BLOCK_WORDS="VPN"
CHATGPT_BLOCK_WORDS="VPN"
WECHATY_PUPPET=wechaty-puppet-wechat
1 change: 0 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@ WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
#ENV WECHATY_PUPPET_WECHAT_ENDPOINT=/usr/bin/google-chrome
CMD xvfb-run --server-args="-screen 0 1280x800x24 -ac -nolisten tcp -dpi 96 +extension RANDR" npm run dev
40 changes: 21 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,23 @@
[![Deploy on Railway](https://railway.app/button.svg)](https://railway.app/template/dMLG70?referralCode=bIYugQ)

## 🌟 Feature

- [x] Use ChatGPT on WeChat with [wechaty](https://github.com/wechaty/wechaty)
and [Official API](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
- [x] Add conversation Support
- [x] Add Dockerfile, you can use it with [docker](#use-with-docker---recommended-)
- [x] Publish to Docker.hub
- [x] Deploy using [docker compose](#use-with-docker-compose---recommended-)
- [x] Add Railway deploy
- [x] Add Fly.io deploy
- [x] ~~Supports custom ChatGPT API~~
- [x] Set prompt
- [x] Continuous conversation
- [x] Support command setting
- [ ] Support proxy
## 🌟 Features

- Interact with WeChat and ChatGPT:
- Use ChatGPT on WeChat with [wechaty](https://github.com/wechaty/wechaty) and [Official API](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
- Add conversation support
- Support command setting

- Deployment and configuration options:
- Add Dockerfile, deployable with [docker](#use-with-docker)
- Support deployment using [docker compose](#use-with-docker-compose)
- Support [Railway](#use-with-railway) and [Fly.io](#use-with-flyio) deployment

- Other features:
- Support [Dall·E](https://labs.openai.com/)
- Support [whisper](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
- Support setting prompt
- Support proxy (in development)

## 🚀 Usage
- [Use with Railway](#use-with-railway)(PaaS, Free, Stable, ✅Recommended)
Expand Down Expand Up @@ -141,11 +143,11 @@ npm npm dev
| OPENAI_API_KEY | 123456789 | sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | [create new secret key](https://platform.openai.com/account/api-keys) |
| MODEL | gpt-3.5-turbo | | ID of the model to use. Currently, only gpt-3.5-turbo and gpt-3.5-turbo-0301 are supported. |
| TEMPERATURE | 0.6 | | 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 | | | |
| DISABLE_GROUP_MESSAGE | true | | |
| CHAT_TRIGGER_RULE | | | Private chat triggering rules. |
| DISABLE_GROUP_MESSAGE | true | | Prohibited to use ChatGPT in group chat. |
| CHAT_PRIVATE_TRIGGER_KEYWORD | | | Keyword to trigger ChatGPT reply in WeChat private chat |
| BLOCK_WORDS | | "WORD1,WORD2,WORD3" | Chat blocker words, (works for both private and group chats, Use, Split) |
| CHATGPT_BLOCK_WORDS | | "WORD1,WORD2,WORD3" | The blocked words returned by ChatGPT(works for both private and group chats, Use, Split) |
| BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | Chat blocker words, (works for both private and group chats, Use, Split) |
| CHATGPT_BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | The blocked words returned by ChatGPT(works for both private and group chats, Use, Split) |

## 📝 Using Custom ChatGPT API

Expand Down
36 changes: 19 additions & 17 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,21 @@

## 🌟 功能点

- [x] 通过 [wechaty](https://github.com/wechaty/wechaty)
[官方 API](https://openai.com/blog/introducing-chatgpt-and-whisper-apis),将 ChatGPT 接入微信
- [x] 加入了持续对话的功能
- [x] 加入 Dockerfile, 通过 [Docker](#通过docker使用-推荐) 进行部署
- [x] 发布到 Docker.hub
- [x] 使用[docker compose](#通过docker-compose使用-推荐)进行部署
- [x] 通过 Railway 进行部署
- [x] 通过 Fly.io 进行部署
- [x] ~~支持自定义ChatGPT API~~
- [x] 支持设置prompt
- [x] 支持连续对话
- [x] 支持命令设置
- [ ] 支持代理
- 使用 WeChat 和 ChatGPT 进行互动:
- 基于 [wechaty](https://github.com/wechaty/wechaty)[Official API](https://openai.com/blog/introducing-chatgpt-and-whisper-apis) 在微信中使用 ChatGPT
- 支持多轮对话
- 支持[命令](#-命令)设置

- 部署和配置选项:
- 提供 Dockerfile,可以通过 [docker](#通过docker使用) 进行部署
- 支持使用 [docker compose](#通过docker-compose使用) 进行部署
- 支持在 [Railway](#使用railway进行部署)[Fly.io](#通过flyio进行部署) 上部署

- 其他功能:
- 支持 [Dall·E](https://labs.openai.com/)
- 支持 [whisper](https://openai.com/blog/introducing-chatgpt-and-whisper-apis)
- 支持设置 prompt
- 支持代理(开发中)

## 🚀 使用

Expand Down Expand Up @@ -146,11 +148,11 @@ npm run dev
| OPENAI_API_KEY | 123456789 | sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX | [创建你的 API 密钥](https://platform.openai.com/account/api-keys) |
| MODEL | gpt-3.5-turbo | | 要使用的模型ID, 目前仅支持`gpt-3.5-turbo``gpt-3.5-turbo-0301` |
| TEMPERATURE | 0.6 | | 在0和2之间。较高的数值如0.8会使 ChatGPT 输出更加随机,而较低的数值如0.2会使其更加稳定。 |
| CHAT_TRIGGER_RULE | | | |
| DISABLE_GROUP_MESSAGE | true | | |
| CHAT_TRIGGER_RULE | | | 私聊触发规则 |
| DISABLE_GROUP_MESSAGE | true | | 禁用在群聊里使用ChatGPT |
| CHAT_PRIVATE_TRIGGER_KEYWORD | | | 在私聊中触发ChatGPT的关键词, 默认是无需关键词即可触发 |
| BLOCK_WORDS | | "WORD1,WORD2,WORD3" | 聊天屏蔽关键词(同时在群组和私聊中生效, 避免 bot 用户恶意提问导致封号 |
| CHATGPT_BLOCK_WORDS | | "WORD1,WORD2,WORD3" | ChatGPT回复屏蔽词, 如果ChatGPT的回复中包含了屏蔽词, 则不回复 |
| BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | 聊天屏蔽关键词(同时在群组和私聊中生效, 避免 bot 用户恶意提问导致封号 |
| CHATGPT_BLOCK_WORDS | "VPN" | "WORD1,WORD2,WORD3" | ChatGPT回复屏蔽词, 如果ChatGPT的回复中包含了屏蔽词, 则不回复 |

## 📝 使用自定义ChatGPT API
> https://github.com/fuergaosi233/openai-proxy
Expand Down

0 comments on commit 173faae

Please sign in to comment.