ChatGPT plugin for Yunzai-Bot with official OpenAI API or unofficial OpenAI API with reverse proxy. With additional support to chat with GoogleBard. 使用 openAI 官方 API 或反向代理非官方 API 的 Yunzai-Bot(v3)的 chatGPT 插件. 也可以与GoogleBard交谈.
中文简介在这里
Now you can chat with Google Bard in QQ via Yunzai-Bot freely!
To chat with GoogleBard, first you should sync your npm dependencies via pnpm update -P
. Then sync your config.js
up with the latest config.default.js
,
set the USE_BARD
to true and fill in BARD_COOKIE
with your bard cookie. You
can find the detailed usage.
If you encounter network issues, try using a proxy located in the United States!
The GPT-4 model just released by OpenAI is now supported UNDER UNOFFICIAL VERSION.
To use this brand new model, make sure that You are in ChatGPT Plus Plan. For more details, please refer to Unofficial version, sync your config.js
up with the updated config.default.js
, and set the USE_UNOFFICIAL
and USE_GPT4
to true.
The actual request and response can be seen at ChatGPT website directly due to we are using Unofficial version.
To use this plugin for Yunzai-Bot, you need to pick between these two methods. Both methods can memory your chat history.
Method | Cost | Quality |
---|---|---|
Official version |
OpenAI Credits | Best |
Unofficial version |
Free | Rate limit; Not so robust |
Official version
- Uses the OpenAI officialgpt-3.5-turbo
( orgpt-3.5-turbo-0301
, you can specify inconfig.js
) model. It's rubust, but not free.Unofficial version
- Uses an unofficial reverse proxy server to access ChatGPT. It has a rate limit, and exposes your access token to a third party, and not so robust. But it's free.
Note: I recommend you to use official version for it has OpenAI's guarantee for service quality. If you have problems when using this plugin, please Open an issue.
About proxy: If you want to set proxy and other things, refer to (#Config) section.
-
Sign up for an OpenAI API Key, this is needed later.
-
Clone this reposity into
plugins/
folder in your Yunzai-Bot folder.
cd Yunzai-Bot
cd plugins
git clone https://github.com/Micuks/chatGPT-yunzai.git
- Copy
config.default.js
and rename it asconfig.js
in config folder.
cd config
cp config.default.js config.js
-
Fill your OpenAI API Key into
API_KEY
section inconfig.js
, which can be obtained with your OpenAI account at view your API keys. -
Update dependences use pnpm or npm.
# In chatGPT-yunzai folder
pnpm update
# or npm update if you use npm instead.
# or npm install chatgpt bull
- Run Yunzai-Bot, ask questions!
# In Yunzai-Bot root folder
npm run start
# in QQ
?Tell me something about Python
- Clone this reposity into
plugins/
folder in your Yunzai-Bot folder.
cd Yunzai-Bot
cd plugins
git clone https://github.com/Micuks/chatGPT-yunzai.git
-
Different from official ChatGPT, this version requires an OpenAI access token instead of an OpenAI API Key. To get this, simply access "https://chat.openai.com/api/auth/session" and get your access_token from the JSON object.
Then paste the access_token to
API_ACCESS_TOKEN
section inconfig.js
. -
Copy
config.default.js
and rename it asconfig.js
in config folder.
cd config
cp config.default.js config.js
- run the following commands to get access token. Or get access token from here directly.
python3 get_access_token.py
# Fill in your OpenAI email and password, then copy the access token you were
given.
Then paste the access token to API_ACCESS_TOKEN
section in config.js
.
- Run Yunzai-Bot, ask questions!
# In Yunzai-Bot root folder
npm run start
The basic steps are the same as the previous steps for ChatGPT.
- Clone this reposity into
plugins/
folder in your Yunzai-Bot folder.
cd Yunzai-Bot
cd plugins
git clone https://github.com/Micuks/chatGPT-yunzai.git
- Install pnpm dependencies
pnpm install -P
- Copy
config.default.js
and rename it asconfig.js
in config folder.
cd config
cp config.default.js config.js
- Get
__Secure-1PSID
cookie at Google Bard, and fill it inconfig.json
.
Here's the related config for GoogleBard in config.json
.
{
// Google Bard settings
const USE_BARD = true; // The master switch for Google Bard
const BARD_COOKIE =
"__Secure-1PSID=<**Fill in your __Secure-1PSID cookie section**>";
// Your bard cookie. Remember **not to delete** the `__Secure-1PSID=` prefix
}
- Run Yunzai-Bot, ask questions to Google Bard!
npm run start
The sections in config.js
are described here.
Key | Description |
---|---|
USE_UNOFFICIAL | true to use unofficial version, false to use official version |
PROXY | Fill in your proxy url. For example, http://127.0.0.1:7890 |
MODEL_NAME | The model you want to use. Need not to modify by default |
API_KEY | OpenAI API Key. Needed for Official version |
API_REVERSE_PROXY_URL | Unofficial ChatGPT reverse proxy server. If you don't know what this is, keep it blank. |
API_ACCESS_TOKEN | This is necessary if you use unofficial version |
MODEL_PAID | If you use unofficial and subscribed ChatGPT Plus, set this to true |
USE_GPT4 | true to use GPT-4 in unofficial version |
USE_BARD | set to true to use Google Bard |
This plugin has following features:
Feature | Command | Permission |
---|---|---|
Seek ChatGPT help | #chatgpthelp | Everyone |
Ask a question | ?Question | Everyone |
Continuous Chatting | !Question | Everyone |
Chat with GPT-4 | 4Question | Everyone |
Chat with Google Bard | BQuestion | Everyone |
End current chat | #结束对话 | Everyone |
Get chat statistics [Administrator] | #聊天列表 | Master |