Giter VIP home page Giter VIP logo

nonebot_plugin_chatgpt_turbo's Introduction

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-chatgpt-turbo

介绍

  • 本插件适配OpenAI在2023年3月1日发布的最新版API,可以在nonebot中调用OpenAI的ChatGPT生产环境下的模型(GPT3.5-turbo)进行回复。
  • 接口调用速度与网络环境有关,经过测试,大陆外的服务器的OpenAI API响应时间能在十秒之内。
  • 免费版OpenAI的调用速度限制为20次/min
  • 本插件具有上下文回复功能(可选),根据每个成员与机器人最近30条(可修改)的聊天记录进行响应回复,该功能消耗服务器资源较大

安装

  • 手动安装

    git clone https://github.com/Alpaca4610/nonebot_plugin_chatgpt_turbo.git
    

    下载完成后在bot项目的pyproject.toml文件手动添加插件:

    plugin_dirs = ["xxxxxx","xxxxxx",......,"下载完成的插件路径/nonebot-plugin-gpt3.5-turbo"]
    
  • 使用 pip

    pip install nonebot-plugin-chatgpt-turbo
    

配置文件

在Bot根目录下的.env文件中追加如下内容:

OPENAI_API_KEY = key
OPENAI_MODEL_NAME = "gpt-3.5-turbo"
OPENAI_HTTP_PROXY = "http://127.0.0.1:8001"    # 请使用代理访问api,**大陆/香港IP调用API有几率会被封禁

可选内容:

OPENAI_MAX_HISTORY_LIMIT = 30   # 保留与每个用户的聊天记录条数
ENABLE_PRIVATE_CHAT = True   # 私聊开关,默认开启,改为False关闭

使用方法

  • @机器人发送问题时机器人不具有上下文回复的能力
  • chat 使用该命令进行问答时,机器人具有上下文回复的能力
  • clear 清除当前用户的聊天记录

nonebot_plugin_chatgpt_turbo's People

Contributors

alpaca4610 avatar kexue-z avatar qnlanyang 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.