Skip to content

Commit 191ad2b

Browse files
committed
初始化
1 parent bca7e51 commit 191ad2b

File tree

15 files changed

+2661
-241
lines changed

15 files changed

+2661
-241
lines changed

README.md

Lines changed: 70 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
## ✨ nonebot-plugin-nyaturingtest ✨
66

7+
#### **N**ot**Y**et**A**notherTurningTest
8+
9+
[![GitHub Stars](https://img.shields.io/github/stars/shadow3aaa/nonebot-plugin-nyaturingtest?style=social)](
10+
711
<a href="./LICENSE">
812
<img src="https://img.shields.io/github/license/shadow3aaa/nonebot-plugin-nyaturingtest.svg" alt="license">
913
</a>
@@ -19,31 +23,42 @@
1923
</a>
2024
</div>
2125

22-
> [!IMPORTANT]
23-
> **收藏项目** ~⭐️
24-
25-
<img width="100%" src="https://starify.komoridevs.icu/api/starify?owner=shadow3aaa&repo=nonebot-plugin-nyaturingtest" alt="starify" />
26+
## 📖 介绍
2627

28+
也许是个有情感的群聊天机器人?
2729

28-
## 📖 介绍
30+
### 特点:
2931

30-
这里是插件的详细介绍部分
32+
- 具有基于VAD三维情感模型情感模块
33+
- 具有基于向量搜索的长期记忆和知识
34+
- 能够从聊天信息中自主提取知识记忆
35+
- 能够考虑自身的情感状态和记忆自行选择要不要回复和回复内容,比较拟人
36+
- 能够对每个人类用户进行情感记忆
37+
- ~~不似人类~~
3138

3239
## 💿 安装
3340

41+
> [!IMPORTANT]
42+
> 要使用本插件, 你至少需要
43+
>
44+
> - 一个有效的 openai 规范接口 api key (根据你的 base_url,可以不是 openai 的)
45+
> - 如果你的 openai api key 是从 google cloud 或者 azure, deepseek, 硅基流动,自己架设的 llm 服务等而非在 openai 申请的, 你需要在 `.env` 文件中配置 `nyaturingtest_chat_openai_base_url` 为对应的 api 地址
46+
> - 一个有效的硅基流动 api key 用于嵌入模型请求 (https://siliconflow.com/)
47+
3448
<details open>
3549
<summary>使用 nb-cli 安装</summary>
3650
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
3751

3852
nb plugin install nonebot-plugin-nyaturingtest --upgrade
53+
3954
使用 **pypi** 源安装
4055

4156
nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.org/simple"
57+
4258
使用**清华源**安装
4359

4460
nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
4561

46-
4762
</details>
4863

4964
<details>
@@ -54,26 +69,32 @@
5469
<summary>uv</summary>
5570

5671
uv add nonebot-plugin-nyaturingtest
72+
5773
安装仓库 master 分支
5874

5975
uv add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
76+
6077
</details>
6178

6279
<details>
6380
<summary>pdm</summary>
6481

6582
pdm add nonebot-plugin-nyaturingtest
83+
6684
安装仓库 master 分支
6785

6886
pdm add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
87+
6988
</details>
7089
<details>
7190
<summary>poetry</summary>
7291

7392
poetry add nonebot-plugin-nyaturingtest
93+
7494
安装仓库 master 分支
7595

7696
poetry add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
97+
7798
</details>
7899

79100
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
@@ -82,21 +103,53 @@
82103

83104
</details>
84105

106+
## 📝 TODO
107+
108+
- [ ] 权限控制
109+
- [ ] 更多可选的语言模型供应商
110+
- [ ] 更多可选的嵌入模型供应商
111+
- [ ] 支持更多平台(目前支持: Onebot v11)
112+
- [ ] 优化机器人效果
113+
- [ ] 让回复机制更加拟人
114+
- [ ] 让回复欲望更加拟人
115+
- [ ] 优化情感反馈机制
116+
- [ ] 支持视觉模型
117+
- [ ] 优化记忆模块
118+
- [ ] 优化长期记忆检索
119+
- [ ] 优化遗忘机制
120+
- [ ] 对话时进行场景感知性总结
121+
- [ ] 支持多种语言
122+
85123
## ⚙️ 配置
86124

87-
在 nonebot2 项目的`.env`文件中添加下表中的必填配置
125+
在 nonebot2 项目的`.env`文件中添加下表中的配置
88126

89-
| 配置项 | 必填 | 默认值 | 说明 |
90-
| :-----: | :---: | :----: | :------: |
91-
| 配置项1 ||| 配置说明 |
92-
| 配置项2 ||| 配置说明 |
127+
| 配置项 | 必填 | 默认值 | 说明 |
128+
| :-----------------------------------------: | :--------------------------: | :------------------------------------------: | :--------------------------------------: |
129+
| nyaturingtest_chat_openai_api_key ||| openai api 接口的 api key |
130+
| nyaturingtest_chat_openai_model || "gpt-3.5-turbo" | openai api 接口请求的 模型名称 |
131+
| nyaturingtest_chat_openai_base_url || "https://api.openai.com/v1/chat/completions" | openai 接口请求的 url |
132+
| nyaturingtest_chat_gemini_api_key ||| gemini api 接口的 api key |
133+
| nyaturingtest_embedding_siliconflow_api_key ||| siliconflow(硅基流动) api 接口的 api key |
134+
| nyaturingtest_enabled_groups | 否(但是不填写此插件就无意义) | `[]`\(空列表\) | 仅在这些群组中启用插件 |
93135

94136
## 🎉 使用
137+
95138
### 指令表
96-
| 指令 | 权限 | 需要@ | 范围 | 说明 |
97-
| :---: | :---: | :---: | :---: | :------: |
98-
| 指令1 | 主人 || 私聊 | 指令说明 |
99-
| 指令2 | 群员 || 群聊 | 指令说明 |
139+
140+
| 指令 | 权限 | 范围 | 说明 |
141+
| :--------------------------: | :----: | :--: | :------------------------: |
142+
| set_role <角色名> <角色设定> | 所有人 | 群聊 | 设置角色 |
143+
| role | 所有人 | 群聊 | 获取当前角色 |
144+
| calm | 所有人 | 群聊 | 冷静(强制归零情绪) |
145+
| reset | 所有人 | 群聊 | 重置会话 |
146+
| status | 所有人 | 群聊 | 获取状态 |
147+
| provider | 所有人 | 群聊 | 获取当前提供商 |
148+
| set_provider <提供者> | 所有人 | 群聊 | 设置提供商 (gemini/openai) |
149+
| add_knowledge <知识> | 所有人 | 群聊 | 添加知识 |
150+
| help | 所有人 | 群聊 | 显示帮助信息 |
100151

101152
### 🎨 效果图
102-
如果有效果图的话
153+
154+
别急
155+

pyproject.toml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,30 @@
11
[project]
22
name = "nonebot-plugin-nyaturingtest"
33
version = "0.1.0"
4-
description = "插件描述"
4+
description = "也许是个有情感的聊天机器人"
55
readme = "README.md"
66
authors = [{ name = "shadow3aaa", email = "[email protected]" }]
77
urls = { Repository = "https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest" }
88
requires-python = ">=3.10,<3.13"
99
dependencies = [
1010
"nonebot2>=2.4.2,<3.0.0",
11-
12-
"nonebot-plugin-localstore>=0.7.4,<1.0.0", # 若不需要存储文件应删除
13-
"nonebot-plugin-apscheduler>=0.5.0,<1.0.0", # 若不使用定时任务应删除
14-
"nonebot-plugin-waiter>=0.8.1,<1.0.0", # 若不使用增强版的 got-reject 会话控制应删除
15-
16-
"nonebot-plugin-uninfo>=0.7.3,<1.0.0", # 若不使用多平台用户信息获取插件应删除
17-
"nonebot-plugin-alconna>=0.57.2,<1.0.0", # 若不使用 alconna 跨平台命令解析拓展应删除
18-
# "nonebot-adapter-onebot>=2.4.6,<3.0.0", # 仅 onebot 应取消注释
19-
11+
"nonebot-plugin-localstore>=0.7.4,<1.0.0",
12+
"nonebot-plugin-uninfo>=0.7.3,<1.0.0",
13+
"nonebot-adapter-onebot>=2.4.6,<3.0.0", # 仅 onebot 应取消注释
2014
"httpx>=0.27.0,<1.0.0",
15+
"langchain>=0.3.25",
16+
"requests>=2.32.3",
17+
"faiss-cpu>=1.11.0",
18+
"langchain-community>=0.3.23",
19+
"openai>=1.77.0",
20+
"google-genai>=1.14.0",
21+
"asyncio>=3.4.3",
2122
]
2223

2324
[dependency-groups]
2425
dev = [
2526
"nonebot2[fastapi]>=2.4.2,<3.0.0",
26-
"ruff>=0.11.6,<1.0.0",
27+
"ruff>=0.11.8,<1.0.0",
2728
# "nonemoji>=0.1.4,<1.0.0", # 推荐全局安装 pipx install nonemoji
2829
# "pre-commit>=4.1.0", # 推荐全局安装 pipx install pre-commit
2930
]

0 commit comments

Comments
 (0)