mirror of
https://github.com/LiteyukiStudio/nonebot-plugin-marshoai.git
synced 2026-01-24 22:01:49 +00:00
Compare commits
3 Commits
v1.2.1
...
pre-commit
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ad4772283f | ||
|
|
cf670db935 | ||
| 04e380f673 |
@@ -8,20 +8,20 @@ repos:
|
|||||||
language: python
|
language: python
|
||||||
files: \.py$
|
files: \.py$
|
||||||
|
|
||||||
- repo: https://github.com/psf/black
|
- repo: https://github.com/psf/black-pre-commit-mirror
|
||||||
rev: 25.1.0
|
rev: 26.1.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: black
|
- id: black
|
||||||
args: [--config=./pyproject.toml]
|
args: [--config=./pyproject.toml]
|
||||||
|
|
||||||
- repo: https://github.com/PyCQA/isort
|
- repo: https://github.com/PyCQA/isort
|
||||||
rev: 6.0.1
|
rev: 7.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: isort
|
- id: isort
|
||||||
args: ["--profile", "black"]
|
args: ["--profile", "black"]
|
||||||
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
- repo: https://github.com/pre-commit/mirrors-mypy
|
||||||
rev: v1.17.1
|
rev: v1.19.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: mypy
|
- id: mypy
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
_✨ 使用 OpenAI 标准格式 API 的聊天机器人插件 ✨_
|
_✨ 使用 OpenAI 标准格式 API 的聊天机器人插件 ✨_
|
||||||
|
|
||||||
[](https://qm.qq.com/q/a13iwP5kAw)
|
|
||||||
[](https://registry.nonebot.dev/plugin/nonebot-plugin-marshoai:nonebot_plugin_marshoai)
|
[](https://registry.nonebot.dev/plugin/nonebot-plugin-marshoai:nonebot_plugin_marshoai)
|
||||||
<a href="https://registry.nonebot.dev/plugin/nonebot-plugin-marshoai:nonebot_plugin_marshoai">
|
<a href="https://registry.nonebot.dev/plugin/nonebot-plugin-marshoai:nonebot_plugin_marshoai">
|
||||||
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fnbbdg.lgc2333.top%2Fplugin-adapters%2Fnonebot-plugin-marshoai&style=flat-square" alt="Supported Adapters">
|
<img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fnbbdg.lgc2333.top%2Fplugin-adapters%2Fnonebot-plugin-marshoai&style=flat-square" alt="Supported Adapters">
|
||||||
|
|||||||
@@ -265,7 +265,7 @@ class MarshoHandler:
|
|||||||
Text(await process_completion_to_details(response)),
|
Text(await process_completion_to_details(response)),
|
||||||
command="detail",
|
command="detail",
|
||||||
expired_at=timedelta(minutes=5),
|
expired_at=timedelta(minutes=5),
|
||||||
) # type:ignore
|
) # type: ignore
|
||||||
)
|
)
|
||||||
# send_message.append(
|
# send_message.append(
|
||||||
# Argot(
|
# Argot(
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class MarshoTools:
|
|||||||
package = importlib.util.module_from_spec(spec)
|
package = importlib.util.module_from_spec(spec)
|
||||||
self.imported_packages[package_name] = package
|
self.imported_packages[package_name] = package
|
||||||
sys.modules[package_name] = package
|
sys.modules[package_name] = package
|
||||||
spec.loader.exec_module(package) # type:ignore
|
spec.loader.exec_module(package) # type: ignore
|
||||||
|
|
||||||
logger.success(f"成功加载工具包 {package_name}")
|
logger.success(f"成功加载工具包 {package_name}")
|
||||||
except json.JSONDecodeError as e:
|
except json.JSONDecodeError as e:
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
|
Copyright (C) 2020-2024 LiteyukiStudio. All Rights Reserved
|
||||||
本模块为工具加载模块
|
本模块为工具加载模块
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import traceback
|
import traceback
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
|
|||||||
@@ -24,9 +24,9 @@ async def process_chat_stream(
|
|||||||
delta = chunk.choices[0].delta
|
delta = chunk.choices[0].delta
|
||||||
if (
|
if (
|
||||||
hasattr(delta, "reasoning_content")
|
hasattr(delta, "reasoning_content")
|
||||||
and delta.reasoning_content is not None # type:ignore
|
and delta.reasoning_content is not None # type: ignore
|
||||||
):
|
):
|
||||||
reasoning_contents += delta.reasoning_content # type:ignore
|
reasoning_contents += delta.reasoning_content # type: ignore
|
||||||
else:
|
else:
|
||||||
if not is_answering:
|
if not is_answering:
|
||||||
logger.info(
|
logger.info(
|
||||||
|
|||||||
Reference in New Issue
Block a user