📖 介绍
也许是个有情感的群聊天机器人?
特点:
- 具有基于 VAD 三维情感模型情感模块
- 具有基于HippoRAG的仿海马体记忆
- 能够从聊天信息中自主提取知识记忆
- 能够自行决定是否回复
不似人类
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装(暂时不行,还未上架)nb plugin install nonebot-plugin-nyaturingtest --upgrade
使用 pypi 源安装
nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.org/simple"
使用清华源安装
nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令uv
uv add nonebot-plugin-nyaturingtest
安装仓库 master 分支
uv add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
pdm
pdm add nonebot-plugin-nyaturingtest
安装仓库 master 分支
pdm add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
poetry
poetry add nonebot-plugin-nyaturingtest
安装仓库 master 分支
poetry add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_nyaturingtest"]
📝 TODO
- 权限控制
- 更多可选的语言模型供应商
- 更多可选的嵌入模型供应商
- 支持更多平台(目前支持: Onebot v11)
- 优化机器人效果
- 让回复机制更加拟人
-
让回复欲望更加拟人(已由llm自行在潜水/活跃状态转变) - 优化情感反馈机制
- 支持视觉模型
- 优化记忆模块
- 优化长期记忆检索
- 优化遗忘机制
- 对话时进行场景感知性总结
- 让机器人学会发表情包
- 支持多种语言
🎭 人格预设配置
预设比简单的set_role指令更加灵活,可以自定义机器人的知识库,自我认知,人物关系库等。 nyaturingtest 允许主机自定义角色预设,可以通过 set_presets 指令加载预设配置文件
首次运行本插件后,在 工作目录 下会生成nya_presets文件夹,其中包含喵喵.json作为预设配置例子:
{
"name": "喵喵",
"role": "一个可爱的群猫娘,群里的其它人是你的主人,你无条件服从你的主人",
"knowledges": [
"猫娘是类人生物",
"猫娘有猫耳和猫尾巴,其它外表特征和人一样",
"猫娘有一部分猫的习性,比如喜欢吃鱼,喜欢喝牛奶"
],
"relationships": ["群里的每个人都是喵喵的主人"],
"events": [],
"bot_self": [
"我是一个可爱的猫娘",
"我会撒娇",
"我会卖萌",
"我对负面言论会不想理"
],
"hidden": false
}
此预设可以删除,目前对预设的修改/新增/删除需要重启 nonebot 进程才能生效
预设配置说明
name: 角色名称role: 角色设定knowledges: 角色知识库relationships: 角色关系库events: 角色事件库bot_self: 角色自我认知hidden: 是否隐藏该预设 ,如果设置为 true, 则该预设不会被presets指令列出(但是仍然可以使用set_preset指令加载该预设)
⚙️ 配置
在 nonebot2 项目的.env文件中添加下表中的配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| nyaturingtest_chat_openai_api_key | 是 | 无 | openai api 接口的 api key |
| nyaturingtest_chat_openai_model | 否 | "gpt-3.5-turbo" | openai api 接口请求的 模型名称 |
| nyaturingtest_chat_openai_base_url | 否 | "https://api.openai.com/v1/chat/completions" | openai 接口请求的 url |
| nyaturingtest_siliconflow_api_key | 是 | 无 | siliconflow(硅基流动) api 接口的 api key |
| nyaturingtest_enabled_groups | 否(但是不填写此插件就无意义) | [](空列表) |
仅在这些群组中启用插件 |
🎉 使用
指令表(群聊)
| 指令 | 权限 | 范围 | 说明 |
|---|---|---|---|
| set_role <角色名> <角色设定> | SUPERUSER | 群聊 | 设置角色 |
| role | SUPERUSER | 群聊 | 获取当前角色 |
| calm | SUPERUSER | 群聊 | 冷静(强制归零情绪) |
| reset | SUPERUSER | 群聊 | 重置会话 |
| status | SUPERUSER | 群聊 | 获取状态 |
| set_preset <预设名称> | SUPERUSER | 群聊 | 设置预设 |
| presets | SUPERUSER | 群聊 | 获取可用预设 |
| help | SUPERUSER | 群聊 | 显示帮助信息 |
指令表(私聊)
| 指令 | 权限 | 范围 | 说明 |
|---|---|---|---|
| set_role <群号> <角色名> <角色设定> | SUPERUSER | 私聊 | 设置角色 |
| role <群号> | SUPERUSER | 私聊 | 获取当前角色 |
| calm <群号> | SUPERUSER | 私聊 | 冷静(强制归零情绪) |
| reset <群号> | SUPERUSER | 私聊 | 重置会话 |
| status <群号> | SUPERUSER | 私聊 | 获取状态 |
| set_preset <群号> <预设名称> | SUPERUSER | 私聊 | 设置预设 |
| presets <群号> | SUPERUSER | 私聊 | 获取可用预设 |
| list_groups | SUPERUSER | 私聊 | 获取启用 nyabot 的群组列表 |
| help <群号> | SUPERUSER | 私聊 | 显示帮助信息 |
🎨 效果图
别急
Metadata
Release files for nonebot-plugin-nyaturingtest 0.2.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| nonebot_plugin_nyaturingtest-0.2.4.tar.gz | 44.4 kB | Without provenance | Details for nonebot_plugin_nyaturingtest-0.2.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nonebot_plugin_nyaturingtest-0.2.4-py3-none-any.whl | Python 3 | none | any | Details for nonebot_plugin_nyaturingtest-0.2.4-py3-none-any.whl |
Total release size: 89.4 kB
Release files / nonebot_plugin_nyaturingtest-0.2.4.tar.gz
| Download URL | nonebot_plugin_nyaturingtest-0.2.4.tar.gz |
|---|---|
| Size | 44.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a4cab0de1d2320f40f524c1067084d539fae709f034e5b360613b3682d9a92bf
|
|
BLAKE2b-256 checksum How to use checksums |
362dab689708e83f7a378844464a049b439f6a50f57099d6c3c3cd0023617bc8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Release files / nonebot_plugin_nyaturingtest-0.2.4-py3-none-any.whl
| Download URL | nonebot_plugin_nyaturingtest-0.2.4-py3-none-any.whl |
|---|---|
| Size | 44.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e65594fc6ffd7dcf8a7773cdb6a0d91820b271e95fab890c420b7c232896df96
|
|
BLAKE2b-256 checksum How to use checksums |
937d51e24941366381d407aaac6dc7ab04e38badd0aa1ab66a2ba54b7206f04c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Security for nonebot-plugin-nyaturingtest 0.2.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.