From 764b91a5f7eb1dc499493d12cb8e378932695efa Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Tue, 16 Dec 2025 12:21:14 +0800 Subject: [PATCH] chore: ruff check --- astrbot/core/provider/manager.py | 1 - astrbot/core/utils/migra_helper.py | 2 +- astrbot/dashboard/routes/config.py | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/astrbot/core/provider/manager.py b/astrbot/core/provider/manager.py index e4f2a9e24..57ecf22fd 100644 --- a/astrbot/core/provider/manager.py +++ b/astrbot/core/provider/manager.py @@ -255,7 +255,6 @@ class ProviderManager: asyncio.create_task(self.llm_tools.init_mcp_clients(), name="init_mcp_clients") async def load_provider(self, provider_config: dict): - # 如果 provider_source_id 存在且不为空,则从 provider_sources 中找到对应的配置并合并 provider_source_id = provider_config.get("provider_source_id", "") if provider_source_id: diff --git a/astrbot/core/utils/migra_helper.py b/astrbot/core/utils/migra_helper.py index 42046eab8..b8ff677e1 100644 --- a/astrbot/core/utils/migra_helper.py +++ b/astrbot/core/utils/migra_helper.py @@ -67,7 +67,7 @@ def _migra_provider_to_source_structure(conf: AstrBotConfig) -> None: if provider_type != "chat_completion": # For old types without provider_type, check type field old_type = provider.get("type", "") - if not ("chat_completion" in old_type): + if "chat_completion" not in old_type: continue migrated = True diff --git a/astrbot/dashboard/routes/config.py b/astrbot/dashboard/routes/config.py index 23f28337e..cd80cb961 100644 --- a/astrbot/dashboard/routes/config.py +++ b/astrbot/dashboard/routes/config.py @@ -20,8 +20,8 @@ from astrbot.core.core_lifecycle import AstrBotCoreLifecycle from astrbot.core.platform.register import platform_cls_map, platform_registry from astrbot.core.provider import Provider from astrbot.core.provider.register import provider_registry -from astrbot.core.utils.llm_metadata import LLM_METADATAS, update_llm_metadata from astrbot.core.star.star import star_registry +from astrbot.core.utils.llm_metadata import LLM_METADATAS from astrbot.core.utils.webhook_utils import ensure_platform_webhook_config from .route import Response, Route, RouteContext