From 091e88fe81689970ead2e64317d35e4b13c64d0f Mon Sep 17 00:00:00 2001 From: Asankilp Date: Sun, 23 Feb 2025 00:23:18 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=B0=E5=BD=95=E7=82=B9=EF=BC=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_marshoai/handler.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/nonebot_plugin_marshoai/handler.py b/nonebot_plugin_marshoai/handler.py index b13512a6..654f7cad 100644 --- a/nonebot_plugin_marshoai/handler.py +++ b/nonebot_plugin_marshoai/handler.py @@ -107,3 +107,24 @@ class MarshoHandler: tools=tools, ) return response + + async def handle_common_chat( + self, + user_message: Union[str, list], + model_name: str, + tools: list, + with_context: bool = True, + stream: bool = False, + ) -> ChatCompletion: + """ + 处理一般聊天 + """ + if stream: + raise NotImplementedError + response = await self.handle_single_chat( + user_message=user_message, + model_name=model_name, + tools=tools, + with_context=with_context, + ) + return response