Code Monkey home page Code Monkey logo

qqchannelchatgpt's Introduction

⭐体验

扫码加入QQ频道

image

推荐Windows一键安装(版本更新更及时)!! 请前往Release下载最新版本

详细部署教程链接https://soulter.top/posts/qpdg.html

详细部署教程链接https://soulter.top/posts/qpdg.html

有任何问题请加频道反馈。

⭐功能:

基本功能

✅ 回复符合上下文
  • 程序向API发送近多次对话内容,模型根据上下文生成回复

  • 你可在configs/config.yaml中修改total_token_limit来近似控制缓存大小。

✅ 超额自动切换
  • 超额时,程序自动切换openai的key,方便快捷
✅ 支持统计频道、消息数量等信息
  • 实现了简单的统计功能
✅ 多并发处理,回复速度快
  • 使用了协程,理论最高可以支持每个子频道每秒回复5条信息
✅ 持久化转储历史记录,重启不丢失
  • 使用内置的sqlite数据库存储历史记录到本地

  • 方式为定时转储,可在config.yaml下修改dump_history_interval来修改间隔时间,单位为分钟。

✅ 支持指令控制
  • 详见下方指令功能
✅ 官方API,稳定
  • 不使用ChatGPT逆向接口,而使用官方API接口,稳定方便。

  • QQ频道机器人框架为QQ官方开源的框架,稳定。

关于token:token就相当于是AI中的单词数(但是不等于单词数),text-davinci-003模型中最大可以支持4097个token。在发送信息时,这个机器人会将用户的历史聊天记录打包发送给ChatGPT,因此,token也会相应的累加,为了保证聊天的上下文的逻辑性,就有了缓存token。

指令功能

需要先@机器人之后再输入指令

  • /reset重置prompt
  • /his查看历史记录(每个用户都有独立的会话)
  • /his [页码数]查看不同页码的历史记录。例如/his 2查看第2页
  • /token查看当前缓存的总token数
  • /count 查看统计
  • /status 查看chatGPT的配置
  • /help 查看帮助
  • /key 动态添加key
  • /set 人格设置面板

📰使用方法:

安装第三方库

使用Python的pip工具安装

  • qq-botpy (QQ频道官方Python SDK)
  • openai (OpenAI 库)
pip install -r requirements.txt

⚠注意,由于qq-botpy需要运行在Python 3.8+的版本上,因此本项目也需要在此之上运行

配置

  • 获得 OpenAI的key OpenAI
  • 获得 QQ开放平台下QQ频道机器人的token和appid QQ开放平台,一个QQ频道机器人(很容易创建~)
  • 在configs/config.yaml下进行配置

启动

  • 启动main.py

DEMO

1.jpg 3.jpg 2.jpg

qqchannelchatgpt's People

Contributors

soulter avatar lan-ce-lot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.