Skip to main content

No project description provided

Project description

NoneBotPluginLogo

NoneBotPluginText

Nnonebot-plugin-gpt3

✨ 基于openai GPT3官方API的对话插件 ✨

license Python NoneBot pypi download

功能

  • 上下文功能
  • 会话导出
  • 返回文字图片渲染
  • 每个人单独会话
  • 人格设置
  • 连续会话

如何使用?

私聊中是直接发送消息,群聊中是以回复的方式发送。

功能列表

指令 需要@ 描述
刷新/重置对话 重置会话记录,开始新的对话
重置人格 重置AI人格
设置人格 设置AI人格
导出会话/导出对话 导出历史会话
自定义的指令前缀 自定义是否需要@ 基本的聊天对话
chat/聊天/开始聊天 开始连续对话
stop/结束/结束聊天 结束连续聊天模式

连续会话

输入chat/聊天/开始聊天即可不加前缀,连续的对话,输入结束/结束聊天,即可结束聊天

image-20221217230058979

人格设置

预设了AI助手/猫娘/nsfw猫娘三种人格,可以通过人格设置切换。内置的设定可以从这里看到

image-20221217231703614

同样也可以手动指定人格

image-20221217232155100

图片渲染

图片渲染可以在配置文件中配置是否,需要渲染

image-20221217233729263

安装

  1. 使用 nb-cli
nb plugin install nonebot_plugin_gpt3
  1. 通过包管理器安装,可以通过nb,pip3,或者poetry等方式安装,以pip为例
pip install nonebot_plugin_gpt3

随后在bot.py中加上如下代码,加载插件

nonebot.load_plugin('nonebot_plugin_gpt3')

配置

对于官方openai接口只需配置API Keys即可,所以请填写API在您配置的chatgpt_token_path下面,默认路径是config/chatgpt_img_config.yml

文件内格式如下,有多个Key请按照如下格式配置。

api_keys:
  - XXX
  - YYY

之后是一些自定义配置,根据注释可以自行修改,如果需要配置请在env.dev下进行配置。

chatgpt_api_key_path = "config/chatgpt_api.yml" # api文件
chatgpt_command_prefix = "chat"                 # 触发聊天的前缀
chatgpt_need_at = False                         # 是否需要@
chatgpt_image_render = False                    # 是否需要图片渲染
chatgpt_image_limit = 100                       # 长度超过多少才会渲染成图片

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nonebot_plugin_gpt3-0.3.0.tar.gz (6.2 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_gpt3-0.3.0-py3-none-any.whl (6.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page