廣州化妝品網(wǎng)站制作山西網(wǎng)站seo
安裝
1.拉取項(xiàng)目
項(xiàng)目地址: chatgpt-on-wechat
2.安裝依賴
pip3 install -r requirements.txt
pip3 install -r requirements-optional.txt
3、獲取API信息
當(dāng)前免費(fèi)的有百度的文心一言,訊飛的個(gè)人認(rèn)證提供500萬token的額度。
控制臺(tái)-訊飛開放平臺(tái)
添加鏈接描述
4、修改配置文件
在根目錄的config-template.json中,需復(fù)制該模板創(chuàng)建最終生效的 config.json,然后在config.json中填入配置。
這里我配置的是訊飛Spark-Pro
需要配置xunfei_app_id、xunfei_api_secret、xunfei_api_key
并在配置文件增加
"xunfei_domain":"generalv3","xunfei_spark_url":"wss://spark-api.xf-yun.com/v3.1/chat"
可以通過config.py與官方文檔查看其它的配置方式。
pm2 后臺(tái)運(yùn)行
pm2 是一個(gè) node 軟件包,也可以運(yùn)行python等腳本。可以使用 npm 命令安裝:npm install pm2 -g 安裝完進(jìn)入chatgpt-on-wechat 運(yùn)行
pm2 start app.py -x --interpreter python3
然后使用
pm2 log
查看chatgpt日志,微信掃描日志中的二維碼登錄,出現(xiàn)| Start auto replying.
即可在個(gè)人以及群聊使用ai機(jī)器人啦
后去可以通過pm2 stop app pm2 start app pm2 log 快捷重啟項(xiàng)目
安裝插件
這里我以API為例
先在plugins/godcmd/config.json 配置password
然后啟動(dòng)項(xiàng)目 私聊機(jī)器人發(fā)送 @bot #auth password 進(jìn)行認(rèn)證
然后發(fā)送
@bot #installp https://github.com/6vision/Apilot.git 安裝插件
@bot #scanp掃描插件
@bot #enablep Apilot啟動(dòng)插件
需要配置的就去響應(yīng)config.json中配置 比如Apilot需要配置alapi token
推薦插件
send_msg:https://github.com/Isaac20231231/send_msg 主動(dòng)通過機(jī)器人向微信推送消息
Apilot:https://github.com/6vision/Apilot 提供早報(bào)、微博熱榜、天氣等功能
TaskScheduler:定時(shí)任務(wù) timetask平替,前者不維護(hù)
SimpleTimeTask:https://github.com/Sakura7301/SimpleTimeTask 定時(shí)任務(wù) timetask平替,前者不維護(hù)
各種小插件合集 https://github.com/XcNgg/chatgpt-on-wechat-plugins
https://github.com/Sakura7301/sakuraTools