Skip to main content

基于NoneBot的智能对话插件,支持多群组管理和人格定制

Project description

NoneBotPluginLogo

NoneBotPluginText

nonebot-plugin-huaer-bot

✨基于硅基/DeepSeek API的智能对话插件✨

nonebot python license license license pypi deepseek

💿 安装

使用 nb-cli 安装 在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
nb plugin install nonebot-plugin-huaer-bot
使用包管理器安装 在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
pip
pip install nonebot-plugin-huaer-bot
pdm
pdm add nonebot-plugin-huaer-bot
poetry
poetry add nonebot-plugin-huaer-bot
conda
conda install nonebot-plugin-huaer-bot

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

plugins = ["nonebot-plugin-huaer-bot"]

📜 功能特性

  • 具有人格定制功能,可以自由设定人格
  • 具有高度灵活的群管理功能,易于多群使用、功能拓展
  • 内置md渲染器(nonebot-plugin-htmlrender);可方便的查看代码,公式等文本
  • 基于siliconflow丰富的API,可以轻而易举的导入其它大语言模型
  • 添加白名单功能,能够十分方便的管理用户,且便于自定义响应规则

🧐 快速上手/配置

  • 在项目文件所在位置下,找到 'config.toml' 文件,可在其中根据注释修改配置,添加自己的API key。也可以在nb2项目中的 .env 文件中添加 HUAER_CONFIG_PATH 变量指定配置文件生成位置(绝对路径,运行后自动生成)。
  • 启动后通过 “/群聊白名单” 添加您的Q群,之后通过 “/对话” 与HuaEr聊天!

🎉 详细使用

指令表

指令+参数 说明 权限(U : user,S : superuser)
对话命令 对话功能的具体实现 S
1. 撤回 撤回上一段对话记录,可在配置文件中设置限额,管理员(superuser)不受限制 U/S
2. 模型列表 列出所有可选模型 S
3. 禁用思考 部分模型具备思考功能,此命令可设定是否显示思考内容 S
4. 显示思考 参见上文 S
5. 对话 [对话内容] 核心功能,可设置调用限制,参见配置文件 U/S
6. MD markdown显示上一段回复,无历史记录或记忆体容量为0则无效 U/S
7. 模型设置 [对应模型编号] 通过查看2.模型列表内容选定模型 S
人格命令 与bot行为相关的设定
8. 记忆清除 清空记忆体 S
9. 人格列表 此群已经存储的人格(私有人格)或公共人格将被列出 S
10. 人格设置 [人格描述] 设定一个人格吧! S
11. 人格读取 [人格名称] [公共/私有] 通过查看9.模型列表内容选定人格(参数位置不敏感) S
12. 人格储存 [人格名称] [公共/私有] 为模型取名后存储至指定文件夹(参数位置不敏感) S
白名单命令 内置两种响应规则,参见配置文件
13. 群聊白名单 [群号] [增加/删除] 操作群聊白名单(参数位置不敏感) S
14. 用户白名单 [QQ号] [增加/删除] 操作用户白名单(参数位置不敏感) S
组管理器命令 对于每个群都会生成的管理容器
15. 保存配置 将此群的配置保存到自身配置文件中 S
16. 加载配置 加载此群自身的配置文件 S
17. 重置配置 恢复默认配置 S
文档命令 信息文本 S
18. readme 用户文档 U/S
19. 功能列表 列出指令表(精简版) S
管理员命令 见备注一
20. 退出群聊 取消对选中组群的控制 S
21. 选择群聊 [群号|public|private] 选择要控制的群聊,其中public代表默认配置,private代表全体私聊,群号即为对应群聊 S

备注

  1. 当管理员使用指令时,默认作用于当前所在的组群;但设置 控制群聊 后,无论在什么位置,指令都会作用于被控制的群聊(目前多管理员同时设置控制群聊可能会有一定冲突)
  2. 刚加入白名单的群(所有的私聊被认为是一个群)会自动生成独立的默认配置文件(在项目文件夹/data/groups/群号),并且在每次启动时读取;可直接修改这些文件来变更规则
  3. 私聊功能出于性能考虑,功能有所限制;具体的,无记忆功能,且只能使用最近一次保存的人格,可通过修改 项目文件夹/data/groups/private 下的json文件更改
  4. 建议私聊前先添加机器人好友,不然无法获取用户昵称

🔭 records

  • 25.5.10 v2.1.1 默认配置debug完毕
  • 25.7.5 v2.1.2 正式发布

🙏 感谢

  • D圣的开源和S圣的平台搭建
  • nonebot-plugin-htmlrender超好用的插件
  • 各位用户朋友们

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_huaer_bot-2.1.11.tar.gz (19.8 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_huaer_bot-2.1.11-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file nonebot_plugin_huaer_bot-2.1.11.tar.gz.

File metadata

  • Download URL: nonebot_plugin_huaer_bot-2.1.11.tar.gz
  • Upload date:
  • Size: 19.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.9.23 Linux/6.11.0-1018-azure

File hashes

Hashes for nonebot_plugin_huaer_bot-2.1.11.tar.gz
Algorithm Hash digest
SHA256 dcecc6607fff1939742618cadd1af1ca76c743a3354c1fb61b9f21791f19022a
MD5 e5ec866c0eafc4c6216252f76e295714
BLAKE2b-256 3e460664fdf1b1b50068cb4bc5516da512cabf4a8a507e187617e7d824ebcbf0

See more details on using hashes here.

File details

Details for the file nonebot_plugin_huaer_bot-2.1.11-py3-none-any.whl.

File metadata

File hashes

Hashes for nonebot_plugin_huaer_bot-2.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 ef107da9ab29151a19160179c19da8e67d396405c72a834e5ceb87b676abc47d
MD5 bb14910a81284bff2ce4a3a7a773ef9a
BLAKE2b-256 f8a422b06c027508bab8814071888e053e30e2b8ed666065b8a9d5d1feaa3919

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