From 1534e99094396203d72f4efde5be17944816b9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=A5=E6=B2=B3=E6=99=B4?= Date: Tue, 10 Jun 2025 15:42:48 +0900 Subject: [PATCH] =?UTF-8?q?qa:=20=E5=A2=9E=E5=8A=A0=E6=98=BE=E5=BC=8F=20re?= =?UTF-8?q?turn=20=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/chat/actions/plugin_api/database_api.py | 3 ++- src/chat/focus_chat/expressors/default_expressor.py | 1 + src/chat/focus_chat/heartFC_sender.py | 4 ++-- src/chat/focus_chat/replyer/default_replyer.py | 1 + src/chat/utils/timer_calculator.py | 2 ++ 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/chat/actions/plugin_api/database_api.py b/src/chat/actions/plugin_api/database_api.py index d8a45aefa..3342a3d6c 100644 --- a/src/chat/actions/plugin_api/database_api.py +++ b/src/chat/actions/plugin_api/database_api.py @@ -195,7 +195,8 @@ class DatabaseAPI: return None if single_result else [] elif query_type in ["create", "update", "delete", "count"]: return None - + raise "unknown query type" + async def db_raw_query( self, sql: str, diff --git a/src/chat/focus_chat/expressors/default_expressor.py b/src/chat/focus_chat/expressors/default_expressor.py index 01a60721b..adb595f17 100644 --- a/src/chat/focus_chat/expressors/default_expressor.py +++ b/src/chat/focus_chat/expressors/default_expressor.py @@ -109,6 +109,7 @@ class DefaultExpressor: # logger.debug(f"创建思考消息thinking_message:{thinking_message}") await self.heart_fc_sender.register_thinking(thinking_message) + return None async def deal_reply( self, diff --git a/src/chat/focus_chat/heartFC_sender.py b/src/chat/focus_chat/heartFC_sender.py index 49d33cc99..528d5802d 100644 --- a/src/chat/focus_chat/heartFC_sender.py +++ b/src/chat/focus_chat/heartFC_sender.py @@ -88,10 +88,10 @@ class HeartFCSender: """ if not message.chat_stream: logger.error("消息缺少 chat_stream,无法发送") - return + raise "消息缺少 chat_stream,无法发送" if not message.message_info or not message.message_info.message_id: logger.error("消息缺少 message_info 或 message_id,无法发送") - return + raise "消息缺少 message_info 或 message_id,无法发送" chat_id = message.chat_stream.stream_id message_id = message.message_info.message_id diff --git a/src/chat/focus_chat/replyer/default_replyer.py b/src/chat/focus_chat/replyer/default_replyer.py index 78727968a..a9424a910 100644 --- a/src/chat/focus_chat/replyer/default_replyer.py +++ b/src/chat/focus_chat/replyer/default_replyer.py @@ -120,6 +120,7 @@ class DefaultReplyer: # logger.debug(f"创建思考消息thinking_message:{thinking_message}") await self.heart_fc_sender.register_thinking(thinking_message) + return None async def deal_reply( self, diff --git a/src/chat/utils/timer_calculator.py b/src/chat/utils/timer_calculator.py index af8058a59..df2b9f778 100644 --- a/src/chat/utils/timer_calculator.py +++ b/src/chat/utils/timer_calculator.py @@ -111,11 +111,13 @@ class Timer: async def async_wrapper(*args, **kwargs): with self: return await func(*args, **kwargs) + return None @wraps(func) def sync_wrapper(*args, **kwargs): with self: return func(*args, **kwargs) + return None wrapper = async_wrapper if asyncio.iscoroutinefunction(func) else sync_wrapper wrapper.__timer__ = self # 保留计时器引用