From 82a47c881f08e786a647b5016661552313da1564 Mon Sep 17 00:00:00 2001 From: taylor Date: Sun, 13 Oct 2024 17:32:06 +0800 Subject: [PATCH] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0ollama=E8=B0=83?= =?UTF-8?q?=E7=94=A8AI=20chat=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- maubot_llmplus/local_paltform.py | 2 ++ maubot_llmplus/platforms.py | 1 + 2 files changed, 3 insertions(+) diff --git a/maubot_llmplus/local_paltform.py b/maubot_llmplus/local_paltform.py index aa13b6b..9d24d49 100644 --- a/maubot_llmplus/local_paltform.py +++ b/maubot_llmplus/local_paltform.py @@ -27,7 +27,9 @@ class Ollama(Platform): headers = {} if self.api_key is not None: headers['Authorization'] = self.api_key + plugin.log.debug(f"{json.dumps(req_body)}") async with self.http.post(endpoint, headers=headers, data=json.dumps(req_body)) as response: + plugin.log.debug(f"响应内容:{response.status}, {response.json()}") if response.status != 200: return ChatCompletion( message={}, diff --git a/maubot_llmplus/platforms.py b/maubot_llmplus/platforms.py index 0c2ea5b..7777092 100644 --- a/maubot_llmplus/platforms.py +++ b/maubot_llmplus/platforms.py @@ -131,6 +131,7 @@ async def generate_context_messages(plugin: Plugin, platform: Platform, evt: Mes else: event_context = await plugin.client.get_event_context(room_id=evt.room_id, event_id=evt.event_id, limit=platform.max_context_messages * 2) + plugin.log.debug(f"event_context: {event_context}") previous_messages = iter(event_context.events_before) for evt in previous_messages: