Skip to main content

No project description provided

Project description

NoneBotPluginLogo

NoneBotPluginText

Nnonebot-plugin-gpt3

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

license Python NoneBot pypi download

功能

  • 上下文
  • 会话导出
  • 返回文字图片渲染
  • 每个人单独会话
  • 更多配置

安装

  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										# 是否需要图片渲染

如何使用?

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.2.0.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

nonebot_plugin_gpt3-0.2.0-py3-none-any.whl (5.1 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