From 26009a33359d4204a7d84ceefe2f2fffe632de93 Mon Sep 17 00:00:00 2001 From: Snowykami Date: Fri, 13 Dec 2024 18:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20=E6=9B=B4=E6=96=B0=20.pre-commit?= =?UTF-8?q?-config.yaml=EF=BC=8C=E5=90=AF=E7=94=A8=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E7=9A=84=E9=92=A9=E5=AD=90=EF=BC=9B=E4=BC=98=E5=8C=96=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E6=A0=BC=E5=BC=8F=EF=BC=8C=E7=A1=AE=E4=BF=9D=E4=B8=80?= =?UTF-8?q?=E8=87=B4=E6=80=A7=EF=BC=9B=E6=9B=B4=E6=96=B0=20pyproject.toml?= =?UTF-8?q?=EF=BC=8C=E6=B7=BB=E5=8A=A0=E6=96=B0=E4=BD=9C=E8=80=85=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/pre-commit.yml | 2 +- .github/workflows/run-pytest.yml | 2 +- .gitignore | 2 +- .pre-commit-config.yaml | 4 ---- README_DEV.md | 2 +- nonebot_plugin_marshoai/azure.py | 16 ++++++++++------ nonebot_plugin_marshoai/models.py | 1 + nonebot_plugin_marshoai/util.py | 1 + nonebot_plugin_marshoai/util_hunyuan.py | 11 +++++------ 9 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index bf7fa6fe..08fe4867 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -27,4 +27,4 @@ jobs: pre-commit install - name: Run pre-commit - run: pre-commit run --all-files \ No newline at end of file + run: pre-commit run --all-files diff --git a/.github/workflows/run-pytest.yml b/.github/workflows/run-pytest.yml index c06df2d1..f69e813b 100644 --- a/.github/workflows/run-pytest.yml +++ b/.github/workflows/run-pytest.yml @@ -47,4 +47,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: Pytest-test-report-${{ matrix.python-version }} - path: report \ No newline at end of file + path: report diff --git a/.gitignore b/.gitignore index 8b89813b..0590cd9d 100644 --- a/.gitignore +++ b/.gitignore @@ -179,4 +179,4 @@ config/ .vscode/ # macos finder -.DS_Store \ No newline at end of file +.DS_Store diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c7f117c7..48feefd0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,9 +1,5 @@ fail_fast: true repos: - - repo: https://github.com/timothycrosley/isort - rev: 5.13.2 - hooks: - - id: isort - repo: https://github.com/psf/black rev: 24.4.2 diff --git a/README_DEV.md b/README_DEV.md index 39c4eda9..1efd344a 100644 --- a/README_DEV.md +++ b/README_DEV.md @@ -20,4 +20,4 @@ pre-commit install ## 其他提示 -- 请勿在大小写不敏感的文件系统或操作系统中开发,否则可能会导致文件名大小写问题(例如Windows, APFS(不区分大小写)等) \ No newline at end of file +- 请勿在大小写不敏感的文件系统或操作系统中开发,否则可能会导致文件名大小写问题(例如Windows, APFS(不区分大小写)等) diff --git a/nonebot_plugin_marshoai/azure.py b/nonebot_plugin_marshoai/azure.py index b21744c3..957b698a 100644 --- a/nonebot_plugin_marshoai/azure.py +++ b/nonebot_plugin_marshoai/azure.py @@ -5,12 +5,16 @@ from typing import Optional import nonebot_plugin_localstore as store from arclet.alconna import Alconna, AllParam, Args -from azure.ai.inference.models import (AssistantMessage, - ChatCompletionsToolCall, - CompletionsFinishReason, - ImageContentItem, ImageUrl, - TextContentItem, ToolMessage, - UserMessage) +from azure.ai.inference.models import ( + AssistantMessage, + ChatCompletionsToolCall, + CompletionsFinishReason, + ImageContentItem, + ImageUrl, + TextContentItem, + ToolMessage, + UserMessage, +) from azure.core.credentials import AzureKeyCredential from nonebot import get_driver, logger, on_command, on_message from nonebot.adapters import Event, Message diff --git a/nonebot_plugin_marshoai/models.py b/nonebot_plugin_marshoai/models.py index e788e0c8..160b743d 100644 --- a/nonebot_plugin_marshoai/models.py +++ b/nonebot_plugin_marshoai/models.py @@ -2,6 +2,7 @@ import importlib import json import os import sys + # import importlib.util import traceback diff --git a/nonebot_plugin_marshoai/util.py b/nonebot_plugin_marshoai/util.py index 7c7309e2..c1b89778 100644 --- a/nonebot_plugin_marshoai/util.py +++ b/nonebot_plugin_marshoai/util.py @@ -7,6 +7,7 @@ from typing import Any, Optional import httpx import nonebot_plugin_localstore as store + # from zhDateTime import DateTime from azure.ai.inference.aio import ChatCompletionsClient from azure.ai.inference.models import SystemMessage diff --git a/nonebot_plugin_marshoai/util_hunyuan.py b/nonebot_plugin_marshoai/util_hunyuan.py index 43e1b86a..4d1fca39 100644 --- a/nonebot_plugin_marshoai/util_hunyuan.py +++ b/nonebot_plugin_marshoai/util_hunyuan.py @@ -2,12 +2,11 @@ import json import types from tencentcloud.common import credential # type: ignore -from tencentcloud.common.exception.tencent_cloud_sdk_exception import \ - TencentCloudSDKException # type: ignore -from tencentcloud.common.profile.client_profile import \ - ClientProfile # type: ignore -from tencentcloud.common.profile.http_profile import \ - HttpProfile # type: ignore +from tencentcloud.common.exception.tencent_cloud_sdk_exception import ( + TencentCloudSDKException, +) # type: ignore +from tencentcloud.common.profile.client_profile import ClientProfile # type: ignore +from tencentcloud.common.profile.http_profile import HttpProfile # type: ignore from tencentcloud.hunyuan.v20230901 import hunyuan_client # type: ignore from tencentcloud.hunyuan.v20230901 import models # type: ignore