nonebot-plugin-skills 0.1.2__tar.gz
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.
- nonebot_plugin_skills-0.1.2/LICENSE +19 -0
- nonebot_plugin_skills-0.1.2/PKG-INFO +84 -0
- nonebot_plugin_skills-0.1.2/README.md +61 -0
- nonebot_plugin_skills-0.1.2/nonebot_plugin_skills/__init__.py +2308 -0
- nonebot_plugin_skills-0.1.2/nonebot_plugin_skills/config.py +24 -0
- nonebot_plugin_skills-0.1.2/pyproject.toml +19 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Limited Redistribution License for nonebot-plugin-skills
|
|
2
|
+
|
|
3
|
+
Copyright © 2026-now nonebot-plugin-skills
|
|
4
|
+
|
|
5
|
+
1. Usage and Reproduction:
|
|
6
|
+
- Unauthorized use, reproduction, modification, or distribution of this code is prohibited without explicit permission from the main author of the nonebot-plugin-skills repository.
|
|
7
|
+
|
|
8
|
+
2. Redistribution:
|
|
9
|
+
- Redistribution of this code is permitted, provided that the full text of this license is included, and the source and copyright information is clearly stated.
|
|
10
|
+
- Minor modifications and extensions are allowed for redistribution purposes, but the modified code must not be publicly released.
|
|
11
|
+
|
|
12
|
+
3. Non-Commercial Use:
|
|
13
|
+
- This code is not to be used for any commercial purposes.
|
|
14
|
+
|
|
15
|
+
4. Additional Permissions:
|
|
16
|
+
- Any rights not explicitly addressed in this license must be requested from and granted by the main author of the nonebot-plugin-skills repository.
|
|
17
|
+
|
|
18
|
+
5. Disclaimer:
|
|
19
|
+
- This code is provided "as is," without any express or implied warranties, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. In no event shall the author be liable for any damages or other liability arising from, out of, or in connection with the use or distribution of this code.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: nonebot-plugin-skills
|
|
3
|
+
Version: 0.1.2
|
|
4
|
+
Summary: Gemini avatar/image and chat plugin with skills and context cache for NoneBot2
|
|
5
|
+
License-File: LICENSE
|
|
6
|
+
Author: yourname
|
|
7
|
+
Author-email: you@example.com
|
|
8
|
+
Requires-Python: >=3.9
|
|
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: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
16
|
+
Requires-Dist: google-genai (>=1.0.0)
|
|
17
|
+
Requires-Dist: httpx (>=0.24.0)
|
|
18
|
+
Requires-Dist: nonebot-adapter-onebot (>=2.2.0)
|
|
19
|
+
Requires-Dist: nonebot2 (>=2.2.0)
|
|
20
|
+
Requires-Dist: pydantic (>=1.10)
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# nonebot-plugin-skills
|
|
24
|
+
|
|
25
|
+
基于 Google Gemini 的头像/图片处理与聊天插件,内置上下文缓存、群/私聊隔离,并支持从聊天记录中自动获取最近头像/图片。
|
|
26
|
+
|
|
27
|
+
## 功能
|
|
28
|
+
- 处理头像/图片:命令内带图、@某人头像、或使用最近聊天图片
|
|
29
|
+
- 聊天对话:带上下文的自然语言聊天
|
|
30
|
+
- 天气查询:输入城市/地区即可查询当前天气
|
|
31
|
+
- 上下文缓存:按群/私聊隔离,定时过期
|
|
32
|
+
|
|
33
|
+
## 安装
|
|
34
|
+
在 NoneBot2 项目中安装依赖:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install nonebot2 nonebot-adapter-onebot httpx google-genai
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
将插件加入 `pyproject.toml`:
|
|
41
|
+
|
|
42
|
+
```toml
|
|
43
|
+
[tool.nonebot]
|
|
44
|
+
plugins = ["nonebot_plugin_skills"]
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
> 当前仓库包目录已改为 `nonebot_plugin_skills`,可直接作为可导入插件使用。
|
|
48
|
+
|
|
49
|
+
## 配置
|
|
50
|
+
在 `.env` 中配置:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
GOOGLE_API_KEY=你的GoogleAPIKey
|
|
54
|
+
GEMINI_TEXT_MODEL=gemini-2.5-flash
|
|
55
|
+
GEMINI_IMAGE_MODEL=gemini-2.5-flash-image
|
|
56
|
+
HISTORY_TTL_SEC=600
|
|
57
|
+
HISTORY_MAX_MESSAGES=20
|
|
58
|
+
GEMINI_LOG_RESPONSE=false
|
|
59
|
+
IMAGE_TIMEOUT=120
|
|
60
|
+
NLP_ENABLE=true
|
|
61
|
+
BOT_KEYWORDS=["Diana","diana","嘉然"]
|
|
62
|
+
NLP_CONTEXT_HISTORY_MESSAGES=2
|
|
63
|
+
NLP_CONTEXT_FUTURE_MESSAGES=2
|
|
64
|
+
NLP_CONTEXT_FUTURE_WAIT_SEC=1.0
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## 使用
|
|
68
|
+
### 指令
|
|
69
|
+
| 指令 | 说明 |
|
|
70
|
+
| --- | --- |
|
|
71
|
+
| 处理头像 <指令> | 处理头像/最近图片/@用户头像 |
|
|
72
|
+
| 聊天 <内容> | 上下文聊天 |
|
|
73
|
+
| 技能 <内容> | 上下文聊天 |
|
|
74
|
+
| 天气 <城市> | 查询当前天气 |
|
|
75
|
+
|
|
76
|
+
### 示例
|
|
77
|
+
- `Diana帮忙把@向晚头像变成黑白`
|
|
78
|
+
- `处理头像 变成赛博朋克风`
|
|
79
|
+
- `处理头像 @小明 变成油画风`
|
|
80
|
+
- `聊天 你还记得刚才的头像吗?`
|
|
81
|
+
- `天气 上海`
|
|
82
|
+
|
|
83
|
+
> 若图片模型仅返回文本结果,插件会直接把文本回复出来(便于你确认模型是否支持图像输出)。
|
|
84
|
+
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# nonebot-plugin-skills
|
|
2
|
+
|
|
3
|
+
基于 Google Gemini 的头像/图片处理与聊天插件,内置上下文缓存、群/私聊隔离,并支持从聊天记录中自动获取最近头像/图片。
|
|
4
|
+
|
|
5
|
+
## 功能
|
|
6
|
+
- 处理头像/图片:命令内带图、@某人头像、或使用最近聊天图片
|
|
7
|
+
- 聊天对话:带上下文的自然语言聊天
|
|
8
|
+
- 天气查询:输入城市/地区即可查询当前天气
|
|
9
|
+
- 上下文缓存:按群/私聊隔离,定时过期
|
|
10
|
+
|
|
11
|
+
## 安装
|
|
12
|
+
在 NoneBot2 项目中安装依赖:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install nonebot2 nonebot-adapter-onebot httpx google-genai
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
将插件加入 `pyproject.toml`:
|
|
19
|
+
|
|
20
|
+
```toml
|
|
21
|
+
[tool.nonebot]
|
|
22
|
+
plugins = ["nonebot_plugin_skills"]
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
> 当前仓库包目录已改为 `nonebot_plugin_skills`,可直接作为可导入插件使用。
|
|
26
|
+
|
|
27
|
+
## 配置
|
|
28
|
+
在 `.env` 中配置:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
GOOGLE_API_KEY=你的GoogleAPIKey
|
|
32
|
+
GEMINI_TEXT_MODEL=gemini-2.5-flash
|
|
33
|
+
GEMINI_IMAGE_MODEL=gemini-2.5-flash-image
|
|
34
|
+
HISTORY_TTL_SEC=600
|
|
35
|
+
HISTORY_MAX_MESSAGES=20
|
|
36
|
+
GEMINI_LOG_RESPONSE=false
|
|
37
|
+
IMAGE_TIMEOUT=120
|
|
38
|
+
NLP_ENABLE=true
|
|
39
|
+
BOT_KEYWORDS=["Diana","diana","嘉然"]
|
|
40
|
+
NLP_CONTEXT_HISTORY_MESSAGES=2
|
|
41
|
+
NLP_CONTEXT_FUTURE_MESSAGES=2
|
|
42
|
+
NLP_CONTEXT_FUTURE_WAIT_SEC=1.0
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## 使用
|
|
46
|
+
### 指令
|
|
47
|
+
| 指令 | 说明 |
|
|
48
|
+
| --- | --- |
|
|
49
|
+
| 处理头像 <指令> | 处理头像/最近图片/@用户头像 |
|
|
50
|
+
| 聊天 <内容> | 上下文聊天 |
|
|
51
|
+
| 技能 <内容> | 上下文聊天 |
|
|
52
|
+
| 天气 <城市> | 查询当前天气 |
|
|
53
|
+
|
|
54
|
+
### 示例
|
|
55
|
+
- `Diana帮忙把@向晚头像变成黑白`
|
|
56
|
+
- `处理头像 变成赛博朋克风`
|
|
57
|
+
- `处理头像 @小明 变成油画风`
|
|
58
|
+
- `聊天 你还记得刚才的头像吗?`
|
|
59
|
+
- `天气 上海`
|
|
60
|
+
|
|
61
|
+
> 若图片模型仅返回文本结果,插件会直接把文本回复出来(便于你确认模型是否支持图像输出)。
|