一、登陆OpenAI官网登录你的账号,获取API key

官网:www.openai.com

二、Wechat-Chatgpt项目

https://github.com/fuergaosi233/wechat-chatgpt

三、开始配置服务器

安装Node环境

sudo apt update && sudo apt upgrade

curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -

sudo apt-get install nodejs

克隆项目

git clone https://github.com/fuergaosi233/wechat-chatgpt.git

安装依赖并创建配置文件

# 进去wechat-chatgpt目录
cd wechat-chatgpt

# 切换到new-wechatgpt分支
git checkout new-wechatgpt

# 安装依赖
npm install

# 创建配置文件
cp config.yaml.example config.yaml
cp .env.example .env

修改配置文件

config.yaml内容如下:

chatGPTAccountPool:
  - email: 填写你的ChatGPT账号
    password: 填写你的ChatGPT密码
    isGoogleLogin: false
chatPrivateTiggerKeyword: ""
openAIProxy: ""

.env内容如下:

CHAT_GPT_EMAIL=
CHAT_GPT_PASSWORD=
CHAT_GPT_RETRY_TIMES=
CHAT_PRIVATE_TRIGGER_KEYWORD=
OPENAI_PROXY=
NOPECHA_KEY=
CAPTCHA_TOKEN=
OPENAI_API_KEY=填写你的API_KEY

修改模型

打开文件:

cd wechat-chatgpt
vi node_modules/chatgpt/build/index.js          

(73行)

修改模型为:

text-davinci-003

启动服务并扫码登录

npm run dev
image-20230215103143231