Skip to main content

NoneBot2 插件,支持群聊 AI 调用

Project description

✨ nonebot-plugin-testhkk ✨

license pypi python ruff uv

📝 介绍

基于 NoneBot2 的群聊 AI 对话插件,使用 OpenAI API 实现智能对话功能。

功能特点

  • 支持群聊中的 AI 对话
  • 每个用户每天有使用次数限制
  • 支持自定义 OpenAI 模型和参数
  • 简单易用的命令格式

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-testhkk --upgrade

使用 pypi 源安装

nb plugin install nonebot-plugin-testhkk --upgrade -i "https://pypi.org/simple"

使用清华源安装

nb plugin install nonebot-plugin-testhkk --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
uv
uv add nonebot-plugin-testhkk

安装仓库 master 分支

uv add git+https://github.com/Wohaokunr/nonebot-plugin-testhkk@master
pdm
pdm add nonebot-plugin-testhkk

安装仓库 master 分支

pdm add git+https://github.com/Wohaokunr/nonebot-plugin-testhkk@master
poetry
poetry add nonebot-plugin-testhkk

安装仓库 master 分支

poetry add git+https://github.com/Wohaokunr/nonebot-plugin-testhkk@master

打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入

plugins = ["nonebot_plugin_testhkk"]

⚙️ 配置

在 nonebot2 项目的.env文件中添加下表中的必填配置

配置项 必填 默认值 说明
OPENAI_API_KEY OpenAI API 密钥
OPENAI_MODEL gpt-3.5-turbo 使用的 OpenAI 模型
OPENAI_TEMPERATURE 0.7 生成文本的随机性 (0-1)
OPENAI_MAX_TOKENS 1000 生成文本的最大长度
OPENAI_DAILY_LIMIT 10 每人每天可使用次数

🎮 使用方法

AI 对话

在群聊中发送以下命令进行 AI 对话:

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_testhkk-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nonebot_plugin_testhkk-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_testhkk-0.1.0.tar.gz.

File metadata

  • Download URL: nonebot_plugin_testhkk-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for nonebot_plugin_testhkk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 165ead3221b12945143b16ac884117e042a6e3c56fb824c70aaebace43e0796a
MD5 9f41dce57e014f6d19971e0d27b32b1d
BLAKE2b-256 795caa46dc2d30d8d046045b70e00bc19d08b65b073f9374609a1d0074bd8406

See more details on using hashes here.

File details

Details for the file nonebot_plugin_testhkk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_testhkk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1b7d8790441463eeda983b812ea16ccfc310a00a1ea1b5f98ec68361eb11709f
MD5 ecf3bea6aea460f16a6e54d4abe596b1
BLAKE2b-256 d0e47ec7299fe301d63914f43f4ca7e8a906077010c6852c75d1dfc4a620d15f

See more details on using hashes here.

Supported by

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