From f6dc16f17bbc945fc2390dd1afe01965f41b7001 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 8 Mar 2025 20:55:25 +0800 Subject: [PATCH] style: format codes --- .../pipeline/process_stage/method/llm_request.py | 12 +++++++----- astrbot/core/platform/astr_message_event.py | 4 +++- astrbot/core/star/star_manager.py | 4 +++- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/astrbot/core/pipeline/process_stage/method/llm_request.py b/astrbot/core/pipeline/process_stage/method/llm_request.py index 5acff1b55..22d67d322 100644 --- a/astrbot/core/pipeline/process_stage/method/llm_request.py +++ b/astrbot/core/pipeline/process_stage/method/llm_request.py @@ -138,11 +138,13 @@ class LLMRequestSubStage(Stage): # 保存到历史记录 await self._save_to_history(event, req, llm_response) - asyncio.create_task(Metric.upload( - llm_tick=1, - model_name=provider.get_model(), - provider_type=provider.meta().type, - )) + asyncio.create_task( + Metric.upload( + llm_tick=1, + model_name=provider.get_model(), + provider_type=provider.meta().type, + ) + ) if llm_response.role == "assistant": # text completion diff --git a/astrbot/core/platform/astr_message_event.py b/astrbot/core/platform/astr_message_event.py index 454c60f41..72e4414b6 100644 --- a/astrbot/core/platform/astr_message_event.py +++ b/astrbot/core/platform/astr_message_event.py @@ -197,7 +197,9 @@ class AstrMessageEvent(abc.ABC): """ 发送消息到消息平台。 """ - asyncio.create_task(Metric.upload(msg_event_tick=1, adapter_name=self.platform_meta.name)) + asyncio.create_task( + Metric.upload(msg_event_tick=1, adapter_name=self.platform_meta.name) + ) self._has_send_oper = True async def _pre_send(self): diff --git a/astrbot/core/star/star_manager.py b/astrbot/core/star/star_manager.py index 96ab68bbb..bdf2c2473 100644 --- a/astrbot/core/star/star_manager.py +++ b/astrbot/core/star/star_manager.py @@ -308,7 +308,9 @@ class PluginManager: context=self.context ) else: - metadata.star_cls = metadata.star_cls_type(context=self.context) + metadata.star_cls = metadata.star_cls_type( + context=self.context + ) else: logger.info(f"插件 {metadata.name} 已被禁用。")