nonebot-plugin-dotcharacter 2.0.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- build/lib/nonebot_plugin_dotcharacter/__init__.py +676 -0
- build/lib/nonebot_plugin_dotcharacter/character_loader.py +241 -0
- build/lib/nonebot_plugin_dotcharacter/config.py +161 -0
- build/lib/nonebot_plugin_dotcharacter/conversation.py +107 -0
- build/lib/nonebot_plugin_dotcharacter/llm_client.py +91 -0
- nonebot_plugin_dotcharacter/__init__.py +676 -0
- nonebot_plugin_dotcharacter/character_loader.py +241 -0
- nonebot_plugin_dotcharacter/config.py +161 -0
- nonebot_plugin_dotcharacter/conversation.py +107 -0
- nonebot_plugin_dotcharacter/llm_client.py +91 -0
- nonebot_plugin_dotcharacter-2.0.0.dist-info/METADATA +150 -0
- nonebot_plugin_dotcharacter-2.0.0.dist-info/RECORD +15 -0
- nonebot_plugin_dotcharacter-2.0.0.dist-info/WHEEL +5 -0
- nonebot_plugin_dotcharacter-2.0.0.dist-info/entry_points.txt +2 -0
- nonebot_plugin_dotcharacter-2.0.0.dist-info/top_level.txt +3 -0
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nonebot-plugin-dotcharacter
|
|
3
|
+
Version: 2.0.0
|
|
4
|
+
Summary: NoneBot 插件:加载 dot-skill / colleague-skill 蒸馏角色,通过 QQ Bot 进行 AI 角色扮演对话
|
|
5
|
+
Author: tghrt
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: nonebot,nonebot2,plugin,dot-skill,colleague-skill,roleplay,character,ai-chat
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Topic :: Communications :: Chat
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
Requires-Dist: nonebot2>=2.3.0
|
|
19
|
+
Requires-Dist: nonebot-adapter-onebot>=0.3.0
|
|
20
|
+
Requires-Dist: httpx>=0.24.0
|
|
21
|
+
Requires-Dist: pyyaml>=6.0
|
|
22
|
+
Requires-Dist: nonebot-plugin-localstore>=0.4.0
|
|
23
|
+
|
|
24
|
+
# nonebot-plugin-dotcharacter
|
|
25
|
+
|
|
26
|
+
> 🎭 加载 dot-skill / colleague-skill 蒸馏的角色,通过 QQ Bot 进行 AI 角色扮演对话
|
|
27
|
+
|
|
28
|
+
## 原理
|
|
29
|
+
|
|
30
|
+
与 Claude Code 使用 dot-skill 角色对话完全一致:
|
|
31
|
+
|
|
32
|
+
1. dot-skill / colleague-skill 从原材料(聊天记录、文档等)蒸馏出角色的 **SKILL.md**
|
|
33
|
+
2. SKILL.md 包含 PART A(工作能力)和 PART B(人物性格)
|
|
34
|
+
3. 对话时,系统提示词 = PART B 优先定态度 + PART A 供知识
|
|
35
|
+
4. LLM 按照系统提示词生成符合角色风格的回复
|
|
36
|
+
|
|
37
|
+
本插件做的事情:读取 SKILL.md → 构造系统提示词 → 管理多用户对话历史 → 调用 LLM API → 返回角色回复。
|
|
38
|
+
|
|
39
|
+
## 安装
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pip install nonebot-plugin-dotcharacter
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
或使用 NB-CLI:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
nb plugin install nonebot-plugin-dotcharacter
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## 配置
|
|
52
|
+
|
|
53
|
+
在 NoneBot 的 `.env` 文件中添加:
|
|
54
|
+
|
|
55
|
+
```env
|
|
56
|
+
# LLM(支持所有 OpenAI 兼容接口)
|
|
57
|
+
DOTCHARACTER_PROVIDER=deepseek # openai/deepseek/kimi/qwen/zhipu/siliconflow/groq/ollama/custom
|
|
58
|
+
DOTCHARACTER_API_KEY=sk-your-api-key
|
|
59
|
+
DOTCHARACTER_MODEL=deepseek-chat
|
|
60
|
+
|
|
61
|
+
# 角色目录(逗号分隔多个路径)
|
|
62
|
+
# 不设置则自动查找 Claude Code / Hermes / OpenClaw / colleague-skill 默认位置
|
|
63
|
+
DOTCHARACTER_SKILLS_PATH=C:/path/to/characters/skills
|
|
64
|
+
|
|
65
|
+
# 可选
|
|
66
|
+
DOTCHARACTER_MAX_HISTORY=20 # 对话历史条数
|
|
67
|
+
DOTCHARACTER_TEMPERATURE=0.8
|
|
68
|
+
DOTCHARACTER_MAX_TOKENS=1024
|
|
69
|
+
DOTCHARACTER_TIMEOUT=60
|
|
70
|
+
|
|
71
|
+
# 权限(可选)
|
|
72
|
+
DOTCHARACTER_ADMIN_QQ=123456789 # 管理员 QQ 号,逗号分隔
|
|
73
|
+
DOTCHARACTER_ALLOWED_GROUPS=987654321 # 允许的群号,逗号分隔。留空则全部允许
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## 使用方法
|
|
77
|
+
|
|
78
|
+
### 管理员命令
|
|
79
|
+
|
|
80
|
+
| 命令 | 说明 |
|
|
81
|
+
|------|------|
|
|
82
|
+
| `!角色列表` | 列出所有可用角色 |
|
|
83
|
+
| `!角色切换 <名称>` | 切换到指定角色 |
|
|
84
|
+
| `!角色退出` | 退出当前对话 |
|
|
85
|
+
| `!重置对话` | 清空对话历史 |
|
|
86
|
+
| `!角色信息 [名称]` | 查看角色详情 |
|
|
87
|
+
| `!角色路径` | 查看当前扫描的目录 |
|
|
88
|
+
| `!角色刷新` | 重新扫描角色目录 |
|
|
89
|
+
| `!角色导入 add <路径>` | 添加角色目录 |
|
|
90
|
+
| `!模型切换` | 查看当前 LLM 配置 |
|
|
91
|
+
| `!模型切换 provider <名称>` | 切换 LLM Provider |
|
|
92
|
+
| `!模型切换 model <名称>` | 切换模型 |
|
|
93
|
+
|
|
94
|
+
### 角色对话
|
|
95
|
+
|
|
96
|
+
切换到角色后,**直接发送消息**即可对话。
|
|
97
|
+
群聊中需要 **@机器人** 触发对话。
|
|
98
|
+
|
|
99
|
+
## 角色目录结构
|
|
100
|
+
|
|
101
|
+
插件自动扫描以下目录:
|
|
102
|
+
- `DOTCHARACTER_SKILLS_PATH` 指定的路径(逗号分隔)
|
|
103
|
+
- `~/.claude/skills/dot-skill/skills/`
|
|
104
|
+
- `~/.hermes/skills/dot-skill/skills/`
|
|
105
|
+
- `~/colleague-skill/skills/`
|
|
106
|
+
- 以及其他常见位置
|
|
107
|
+
|
|
108
|
+
期望目录结构(dot-skill / colleague-skill 输出):
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
skills/
|
|
112
|
+
├── colleague/<slug>/SKILL.md + meta.json + persona.md
|
|
113
|
+
├── relationship/<slug>/SKILL.md + meta.json + persona.md
|
|
114
|
+
└── celebrity/<slug>/SKILL.md + meta.json + persona.md
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
把蒸馏好的角色文件放到任意目录,用 `!角色导入 add` 或配置 `.env` 即可加载。
|
|
118
|
+
|
|
119
|
+
## 支持的 LLM
|
|
120
|
+
|
|
121
|
+
| Provider | 说明 |
|
|
122
|
+
|----------|------|
|
|
123
|
+
| `deepseek` | DeepSeek(默认推荐) |
|
|
124
|
+
| `openai` | OpenAI |
|
|
125
|
+
| `kimi` | Moonshot Kimi |
|
|
126
|
+
| `qwen` | 阿里通义千问 |
|
|
127
|
+
| `zhipu` | 智谱 GLM |
|
|
128
|
+
| `siliconflow` | SiliconFlow |
|
|
129
|
+
| `groq` | Groq |
|
|
130
|
+
| `ollama` | 本地 Ollama |
|
|
131
|
+
| `custom` | 自定义 OpenAI 兼容接口 |
|
|
132
|
+
|
|
133
|
+
## 权限模型
|
|
134
|
+
|
|
135
|
+
- 命令(`!角色*` 等):仅管理员可用(`DOTCHARACTER_ADMIN_QQ`)
|
|
136
|
+
- 角色扮演对话:所有用户可用
|
|
137
|
+
- 群聊 @机器人 才触发对话(命令不需要 @)
|
|
138
|
+
|
|
139
|
+
## 依赖
|
|
140
|
+
|
|
141
|
+
- Python >= 3.9
|
|
142
|
+
- nonebot2 >= 2.3.0
|
|
143
|
+
- nonebot-adapter-onebot >= 0.3.0
|
|
144
|
+
- httpx >= 0.24.0
|
|
145
|
+
- pyyaml >= 6.0
|
|
146
|
+
- nonebot-plugin-localstore >= 0.4.0
|
|
147
|
+
|
|
148
|
+
## License
|
|
149
|
+
|
|
150
|
+
MIT
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
build/lib/nonebot_plugin_dotcharacter/__init__.py,sha256=NHoXwX23oZHJDB7xEvAbKweE1QqrmuNtqIbZfjPcYgc,24154
|
|
2
|
+
build/lib/nonebot_plugin_dotcharacter/character_loader.py,sha256=U9WKl2agPZFbbdAwTE-2N1fGTeHGCM9tAtkY4MK_Iu4,7986
|
|
3
|
+
build/lib/nonebot_plugin_dotcharacter/config.py,sha256=y1VQSR5CB0GLSevI1J6wl07vFMLr1TsKldRsv186Yac,5712
|
|
4
|
+
build/lib/nonebot_plugin_dotcharacter/conversation.py,sha256=ELRIk6aZgTCMrpMk4iCLJVCicP-b4W011CGg_yYpoAo,3890
|
|
5
|
+
build/lib/nonebot_plugin_dotcharacter/llm_client.py,sha256=VxEIuhIYd0ZwAqw9jlNkqNa0nE1_hjvnyLMln2QrH4Y,2740
|
|
6
|
+
nonebot_plugin_dotcharacter/__init__.py,sha256=NHoXwX23oZHJDB7xEvAbKweE1QqrmuNtqIbZfjPcYgc,24154
|
|
7
|
+
nonebot_plugin_dotcharacter/character_loader.py,sha256=U9WKl2agPZFbbdAwTE-2N1fGTeHGCM9tAtkY4MK_Iu4,7986
|
|
8
|
+
nonebot_plugin_dotcharacter/config.py,sha256=y1VQSR5CB0GLSevI1J6wl07vFMLr1TsKldRsv186Yac,5712
|
|
9
|
+
nonebot_plugin_dotcharacter/conversation.py,sha256=ELRIk6aZgTCMrpMk4iCLJVCicP-b4W011CGg_yYpoAo,3890
|
|
10
|
+
nonebot_plugin_dotcharacter/llm_client.py,sha256=VxEIuhIYd0ZwAqw9jlNkqNa0nE1_hjvnyLMln2QrH4Y,2740
|
|
11
|
+
nonebot_plugin_dotcharacter-2.0.0.dist-info/METADATA,sha256=Jf6OstLpgg7G88FowHSy7Nc8_cdT-IHErnqx7GQqpHE,4792
|
|
12
|
+
nonebot_plugin_dotcharacter-2.0.0.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
13
|
+
nonebot_plugin_dotcharacter-2.0.0.dist-info/entry_points.txt,sha256=6QboMURhrIEch4QDHoCHhcOIYIdupgJIMj1yb1rSrpo,53
|
|
14
|
+
nonebot_plugin_dotcharacter-2.0.0.dist-info/top_level.txt,sha256=7ugedirAVSaVpOcC-Au-qCn7uUMyuRzHD92GqHivkUo,39
|
|
15
|
+
nonebot_plugin_dotcharacter-2.0.0.dist-info/RECORD,,
|