/QQ-ChatGPT-Bot

实现ChatGPT qq机器人聊天功能,使用gpt-3.5-turbo基于go-cqhttp+golang原生跨平台

Primary LanguageGoMIT LicenseMIT

QQ-ChatGPT-Bot

实现openai qq对话功能,原生跨平台 image.png

如何使用

  1. 下载go-cqhttp
  2. 下载QQ-ChatGPT-Bot

Windows

  • 双击go-cqhttp可执行文件,按照提示登录QQ,选择2正向WebSocket
  • 双击QQ-ChatGPT-Bot可执行文件,将openai的api_key 填入config.cfg中,再次运行
  • 如果要使用角色扮演功能,则请在config中的identity下填写想要bot扮演的角色的信息。同时,请将openai配置下的model更换成“text-davinci-003”。如不想使用角色扮演功能,请直接删掉identity下prompt里双引号内的内容。

Linux

./go-cqhttp*
# 按照提示操作,选择2正向websocket,将本地登录过的`sesssion.token`复制进服务器,防止tx风控
./QQ-ChatGPT*
# 在config.cfg填入openai的api_key 
# 关掉窗口,运行:
nohup ./go-cqhttp* &
nohup ./QQ-ChatGPT* &
# config.yaml cqhttp配置文件
servers:
  # 添加方式,同一连接方式可添加多个,具体配置说明请查看文档
  #- http: # http 通信
  #- ws:   # 正向 Websocket
  #- ws-reverse: # 反向 Websocket
  #- pprof: #性能分析服务器
  # 正向WS设置
  - ws:
      # 正向WS服务器监听地址
      address: 0.0.0.0:8080
      middlewares:
        <<: *default # 引用默认中间件