nonebot-plugin-githubmodels 0.2.4__tar.gz → 0.2.6__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-githubmodels
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: API 调用 GitHub Models 的大语言模型
5
5
  Home-page: https://github.com/lyqgzbl/nonebot-plugin-githubmodels
6
6
  License: MIT
@@ -15,7 +15,7 @@ Classifier: Programming Language :: Python :: 3.10
15
15
  Classifier: Programming Language :: Python :: 3.11
16
16
  Classifier: Programming Language :: Python :: 3.12
17
17
  Classifier: Programming Language :: Python :: 3.13
18
- Requires-Dist: nonebot-plugin-alconna (>=0.52.0,<0.53.0)
18
+ Requires-Dist: nonebot-plugin-alconna (>=0.54.0,<0.55.0)
19
19
  Requires-Dist: nonebot-plugin-htmlrender (>=0.3.5,<0.4.0)
20
20
  Requires-Dist: nonebot2 (>=2.2.1,<3.0.0)
21
21
  Requires-Dist: openai (>=1.44.1,<2.0.0)
@@ -6,6 +6,7 @@ from nonebot.plugin import PluginMetadata
6
6
 
7
7
  require("nonebot_plugin_alconna")
8
8
  require("nonebot_plugin_htmlrender")
9
+ from openai import BadRequestError
9
10
  from arclet.alconna import Args, Option, Alconna, MultiVar
10
11
  from nonebot_plugin_alconna import UniMessage, on_alconna, Match
11
12
  from nonebot_plugin_htmlrender import md_to_pic
@@ -91,6 +92,9 @@ async def got_location(user_input: str):
91
92
  await UniMessage.image(raw=pic).send(reply_to=True)
92
93
  else:
93
94
  await UniMessage.text(reply).send(reply_to=True)
95
+ except BadRequestError as e:
96
+ logger.opt(colors=True).error(f"<red>API 请求失败: {e}</red>")
97
+ await ai.send("问题触发了内容过滤策略,请修改问题后重试")
94
98
  finally:
95
99
  REPLY_IMAGE = plugin_config.ai_reply_image
96
100
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nonebot-plugin-githubmodels"
3
- version = "0.2.4"
3
+ version = "0.2.6"
4
4
  description = "API 调用 GitHub Models 的大语言模型"
5
5
  readme = "README.md"
6
6
  authors = ["lyqgzbl <admin@lyqgzbl.com>"]
@@ -13,7 +13,7 @@ python = "^3.8"
13
13
  nonebot2 = "^2.2.1"
14
14
  openai = "^1.44.1"
15
15
  nonebot-plugin-htmlrender = "^0.3.5"
16
- nonebot-plugin-alconna = "^0.52.0"
16
+ nonebot-plugin-alconna = "^0.54.0"
17
17
 
18
18
  [build-system]
19
19
  requires = ["poetry-core>=1.0.0"]