实现拟人化的群聊回复,支持好感度系统和自主回复决策
Project description
nonebot-plugin-shiro-personification
✨ 实现拟人化的群聊回复,支持好感度系统和自主回复决策 ✨
📖 介绍
这是一个基于 OpenAI API 的 NoneBot2 插件,旨在让机器人在群聊中表现得更像一个真正的成员。它能够根据上下文决定是否回复,并支持基于好感度系统的动态态度调整。
📦 依赖项
在使用本项目之前,请确保已安装以下插件:
- nonebot-adapter-onebot: OneBot V11 适配器
- nonebot-plugin-apscheduler: 任务调度支持
- nonebot-plugin-htmlrender: (可选) Markdown 转图片支持
- nonebot-plugin-sign-in: (可选) 好感度系统关联插件
💿 安装
使用 nb-cli 安装:
nb plugin install nonebot-plugin-shiro-personification
或者使用 pip 安装:
pip install nonebot-plugin-shiro-personification
⚙️ 配置
在 .env 文件中添加以下配置项:
| 配置项 | 类型 | 默认值 | 说明 |
|---|---|---|---|
personification_api_key |
str |
"" |
OpenAI 或兼容服务的 API Key |
personification_api_url |
str |
"https://api.openai.com/v1" |
API 基础路径 |
personification_model |
str |
"gpt-3.5-turbo" |
使用的模型名称 |
personification_whitelist |
list |
[] |
启用插件的群号列表 |
personification_probability |
float |
0.5 |
随机回复概率 (0-1) |
personification_system_prompt |
str |
(见代码) | 默认系统提示词 |
personification_prompt_path |
str |
None |
自定义人格设定文件路径 |
personification_history_len |
int |
50 |
上下文参考长度 |
personification_sticker_path |
str |
"data/stickers" |
表情包文件夹路径 |
personification_poke_probability |
float |
0.3 |
戳一戳响应概率 |
🎉 使用
- 将机器人加入白名单群组。
- 机器人在群聊中会根据配置的概率随机回复消息。
- 当被 @ 时,机器人必定回复。
- 支持戳一戳响应。
- 支持随机发送表情包(需配置表情包路径)。
🌟 好感度系统
本插件支持与签到插件(如 nonebot-plugin-sign-in)关联。如果检测到签到插件,将根据用户的好感度等级调整回复态度。
🖼️ 图片渲染 (可选)
安装 nonebot-plugin-htmlrender 后,插件支持将 Markdown 格式的回复渲染为图片。
📄 开源许可
本项目采用 MIT 许可协议。
💡 鸣谢
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_shiro_personification-0.1.5.tar.gz.
File metadata
- Download URL: nonebot_plugin_shiro_personification-0.1.5.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
621643357a79768f931103b59f019f362d89b786998acacc26f2701e7dc22af6
|
|
| MD5 |
509f89ef12891819de96ed90f872094b
|
|
| BLAKE2b-256 |
5e5e96f33d32ec759271611a1d4295ade3fc07501592ff77c53a0b7e401ab64e
|
Provenance
The following attestation bundles were made for nonebot_plugin_shiro_personification-0.1.5.tar.gz:
Publisher:
publish.yml on luojisama/nonebot-plugin-personification
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_shiro_personification-0.1.5.tar.gz -
Subject digest:
621643357a79768f931103b59f019f362d89b786998acacc26f2701e7dc22af6 - Sigstore transparency entry: 814165702
- Sigstore integration time:
-
Permalink:
luojisama/nonebot-plugin-personification@1996ecd12e0d160c89582e6d5cc7474a6504b039 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/luojisama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1996ecd12e0d160c89582e6d5cc7474a6504b039 -
Trigger Event:
push
-
Statement type:
File details
Details for the file nonebot_plugin_shiro_personification-0.1.5-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_shiro_personification-0.1.5-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a6c6c2240f51042f7520bea55112b6109645afb3fec1b60fb884612aa81793b
|
|
| MD5 |
264a95a0b5d815ff8dfccc438ec1f135
|
|
| BLAKE2b-256 |
51be11f545a33fc146d3a7039ea2094050ee7b756cd1dc743f7a032bb98eec27
|
Provenance
The following attestation bundles were made for nonebot_plugin_shiro_personification-0.1.5-py3-none-any.whl:
Publisher:
publish.yml on luojisama/nonebot-plugin-personification
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nonebot_plugin_shiro_personification-0.1.5-py3-none-any.whl -
Subject digest:
3a6c6c2240f51042f7520bea55112b6109645afb3fec1b60fb884612aa81793b - Sigstore transparency entry: 814165706
- Sigstore integration time:
-
Permalink:
luojisama/nonebot-plugin-personification@1996ecd12e0d160c89582e6d5cc7474a6504b039 -
Branch / Tag:
refs/tags/v0.1.5 - Owner: https://github.com/luojisama
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1996ecd12e0d160c89582e6d5cc7474a6504b039 -
Trigger Event:
push
-
Statement type: