nonebot-plugin-githubmodels 0.1.9__tar.gz → 0.2.1__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_githubmodels-0.2.1/PKG-INFO +70 -0
- nonebot_plugin_githubmodels-0.2.1/README.md +45 -0
- {nonebot_plugin_githubmodels-0.1.9 → nonebot_plugin_githubmodels-0.2.1}/nonebot_plugin_githubmodels/__init__.py +13 -3
- {nonebot_plugin_githubmodels-0.1.9 → nonebot_plugin_githubmodels-0.2.1}/pyproject.toml +2 -1
- nonebot_plugin_githubmodels-0.1.9/PKG-INFO +0 -22
- {nonebot_plugin_githubmodels-0.1.9 → nonebot_plugin_githubmodels-0.2.1}/LICENSE +0 -0
- {nonebot_plugin_githubmodels-0.1.9 → nonebot_plugin_githubmodels-0.2.1}/nonebot_plugin_githubmodels/config.py +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: nonebot-plugin-githubmodels
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: API 调用 GitHub Models 的大语言模型
|
|
5
|
+
Home-page: https://github.com/lyqgzbl/nonebot-plugin-githubmodels
|
|
6
|
+
License: MIT
|
|
7
|
+
Author: lyqgzbl
|
|
8
|
+
Author-email: admin@lyqgzbl.com
|
|
9
|
+
Requires-Python: >=3.8,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Requires-Dist: nonebot-plugin-alconna (>=0.52.0,<0.53.0)
|
|
19
|
+
Requires-Dist: nonebot-plugin-htmlrender (>=0.3.5,<0.4.0)
|
|
20
|
+
Requires-Dist: nonebot2 (>=2.2.1,<3.0.0)
|
|
21
|
+
Requires-Dist: openai (>=1.44.1,<2.0.0)
|
|
22
|
+
Project-URL: Repository, https://github.com/lyqgzbl/nonebot-plugin-githubmodels
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
<!-- markdownlint-disable MD033 MD036 MD041 -->
|
|
26
|
+
|
|
27
|
+
<div align="center">
|
|
28
|
+
|
|
29
|
+
<a href="https://v2.nonebot.dev/store">
|
|
30
|
+
<img src="https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo">
|
|
31
|
+
</a>
|
|
32
|
+
|
|
33
|
+
<p>
|
|
34
|
+
<img src="https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg" alt="NoneBotPluginText">
|
|
35
|
+
</p>
|
|
36
|
+
|
|
37
|
+
# nonebot-plugin-githubmodels
|
|
38
|
+
|
|
39
|
+
_✨ API调用GitHub models大语言模型 ✨_
|
|
40
|
+
|
|
41
|
+
</div>
|
|
42
|
+
|
|
43
|
+
<p align="center">
|
|
44
|
+
<a href="https://raw.githubusercontent.com/kexue-z/nonebot-plugin-heweather/master/LICENSE">
|
|
45
|
+
<img src="https://img.shields.io/github/license/kexue-z/nonebot-plugin-heweather.svg" alt="license">
|
|
46
|
+
</a>
|
|
47
|
+
<a href="https://pypi.org/project/nonebot-plugin-heweather/">
|
|
48
|
+
<img src="https://img.shields.io/pypi/v/nonebot-plugin-heweather" alt="pypi">
|
|
49
|
+
</a>
|
|
50
|
+
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
# 安装
|
|
54
|
+
|
|
55
|
+
使用nb-cli
|
|
56
|
+
```shell
|
|
57
|
+
nb plugin install nonebot-plugin-githubmodels
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
# 指令
|
|
61
|
+
|
|
62
|
+
“AI xxx” 询问AI
|
|
63
|
+
例如“AI 嗨”
|
|
64
|
+
|
|
65
|
+
”AI 重置“ 重置上下文记忆
|
|
66
|
+
|
|
67
|
+
# 配置
|
|
68
|
+
|
|
69
|
+
## 见 [.env.example](https://github.com/lyqgzbl/nonebot-plugin-githubmodels/blob/main/.env.example)
|
|
70
|
+
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<!-- markdownlint-disable MD033 MD036 MD041 -->
|
|
2
|
+
|
|
3
|
+
<div align="center">
|
|
4
|
+
|
|
5
|
+
<a href="https://v2.nonebot.dev/store">
|
|
6
|
+
<img src="https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo">
|
|
7
|
+
</a>
|
|
8
|
+
|
|
9
|
+
<p>
|
|
10
|
+
<img src="https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg" alt="NoneBotPluginText">
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
# nonebot-plugin-githubmodels
|
|
14
|
+
|
|
15
|
+
_✨ API调用GitHub models大语言模型 ✨_
|
|
16
|
+
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<p align="center">
|
|
20
|
+
<a href="https://raw.githubusercontent.com/kexue-z/nonebot-plugin-heweather/master/LICENSE">
|
|
21
|
+
<img src="https://img.shields.io/github/license/kexue-z/nonebot-plugin-heweather.svg" alt="license">
|
|
22
|
+
</a>
|
|
23
|
+
<a href="https://pypi.org/project/nonebot-plugin-heweather/">
|
|
24
|
+
<img src="https://img.shields.io/pypi/v/nonebot-plugin-heweather" alt="pypi">
|
|
25
|
+
</a>
|
|
26
|
+
<img src="https://img.shields.io/badge/python-3.8+-blue.svg" alt="python">
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
# 安装
|
|
30
|
+
|
|
31
|
+
使用nb-cli
|
|
32
|
+
```shell
|
|
33
|
+
nb plugin install nonebot-plugin-githubmodels
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
# 指令
|
|
37
|
+
|
|
38
|
+
“AI xxx” 询问AI
|
|
39
|
+
例如“AI 嗨”
|
|
40
|
+
|
|
41
|
+
”AI 重置“ 重置上下文记忆
|
|
42
|
+
|
|
43
|
+
# 配置
|
|
44
|
+
|
|
45
|
+
## 见 [.env.example](https://github.com/lyqgzbl/nonebot-plugin-githubmodels/blob/main/.env.example)
|
|
@@ -26,19 +26,27 @@ ai = on_alconna(
|
|
|
26
26
|
Alconna(
|
|
27
27
|
"AI",
|
|
28
28
|
Args["user_input?", str],
|
|
29
|
-
Option("
|
|
29
|
+
Option("-r|--reset"),
|
|
30
|
+
Option("-i|--image"),
|
|
30
31
|
),
|
|
31
32
|
use_cmd_start=True,
|
|
32
33
|
block=True,
|
|
33
34
|
aliases={"ai"},
|
|
34
35
|
)
|
|
35
36
|
|
|
36
|
-
@ai.assign("
|
|
37
|
+
@ai.assign("reset")
|
|
37
38
|
async def ai_reset():
|
|
38
39
|
global shared_context
|
|
39
40
|
shared_context = []
|
|
40
41
|
await ai.finish("上下文已重置")
|
|
41
42
|
|
|
43
|
+
@ai.assign("image")
|
|
44
|
+
async def ai_image(user_input: Match[str]):
|
|
45
|
+
if user_input.available:
|
|
46
|
+
global REPLY_IMAGE
|
|
47
|
+
REPLY_IMAGE = True
|
|
48
|
+
ai.set_path_arg("user_input", user_input.result)
|
|
49
|
+
|
|
42
50
|
@ai.handle()
|
|
43
51
|
async def handle_function(user_input: Match[str]):
|
|
44
52
|
if user_input.available:
|
|
@@ -46,6 +54,8 @@ async def handle_function(user_input: Match[str]):
|
|
|
46
54
|
|
|
47
55
|
@ai.got_path("user_input", prompt="请输入有效问题")
|
|
48
56
|
async def got_location(user_input: str):
|
|
57
|
+
if not user_input.strip():
|
|
58
|
+
await ai.reject("你真的输入了有效问题吗?请输入有效问题")
|
|
49
59
|
global shared_context
|
|
50
60
|
shared_context.append({"role": "user", "content": user_input})
|
|
51
61
|
if len(shared_context) > MAX_CONTEXT_LENGTH:
|
|
@@ -82,4 +92,4 @@ __plugin_meta__ = PluginMetadata(
|
|
|
82
92
|
type="application",
|
|
83
93
|
homepage="https://github.com/lyqgzbl/nonebot-plugin-githubmodels",
|
|
84
94
|
supported_adapters=None,
|
|
85
|
-
)
|
|
95
|
+
)
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "nonebot-plugin-githubmodels"
|
|
3
|
-
version = "0.1
|
|
3
|
+
version = "0.2.1"
|
|
4
4
|
description = "API 调用 GitHub Models 的大语言模型"
|
|
5
|
+
readme = "README.md"
|
|
5
6
|
authors = ["lyqgzbl <admin@lyqgzbl.com>"]
|
|
6
7
|
license = "MIT"
|
|
7
8
|
homepage = "https://github.com/lyqgzbl/nonebot-plugin-githubmodels"
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: nonebot-plugin-githubmodels
|
|
3
|
-
Version: 0.1.9
|
|
4
|
-
Summary: API 调用 GitHub Models 的大语言模型
|
|
5
|
-
Home-page: https://github.com/lyqgzbl/nonebot-plugin-githubmodels
|
|
6
|
-
License: MIT
|
|
7
|
-
Author: lyqgzbl
|
|
8
|
-
Author-email: admin@lyqgzbl.com
|
|
9
|
-
Requires-Python: >=3.8,<4.0
|
|
10
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
11
|
-
Classifier: Programming Language :: Python :: 3
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
-
Requires-Dist: nonebot-plugin-alconna (>=0.52.0,<0.53.0)
|
|
19
|
-
Requires-Dist: nonebot-plugin-htmlrender (>=0.3.5,<0.4.0)
|
|
20
|
-
Requires-Dist: nonebot2 (>=2.2.1,<3.0.0)
|
|
21
|
-
Requires-Dist: openai (>=1.44.1,<2.0.0)
|
|
22
|
-
Project-URL: Repository, https://github.com/lyqgzbl/nonebot-plugin-githubmodels
|
|
File without changes
|
|
File without changes
|