From 44d9172859b4ee7a544afe7ed544a0dd13cd6ff2 Mon Sep 17 00:00:00 2001 From: taylor Date: Sun, 13 Oct 2024 16:40:04 +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/aibot.py | 8 ++++---- maubot_llmplus/local_paltform.py | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index fbe6507..c71a661 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -138,15 +138,15 @@ class AiBotPlugin(Plugin): if use_platform == 'local_ai': type = self.config['platforms']['local_ai']['type'] if type == 'ollama': - return Ollama(self.config) + return Ollama(self.config, self.http) elif type == 'lmstudio': - return LmStudio(self.config) + return LmStudio(self.config, self.http) else: raise ValueError(f"not found platform type: {type}") if use_platform == 'openai': - return OpenAi(self.config) + return OpenAi(self.config, self.http) if use_platform == 'anthropic': - return Anthropic(self.config) + return Anthropic(self.config, self.http) raise ValueError(f"unknown backend type {use_platform}") @classmethod diff --git a/maubot_llmplus/local_paltform.py b/maubot_llmplus/local_paltform.py index 264c26c..8302cd4 100644 --- a/maubot_llmplus/local_paltform.py +++ b/maubot_llmplus/local_paltform.py @@ -45,4 +45,10 @@ class Ollama(Platform): class LmStudio(Platform): - pass + + def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None: + super().__init__(config, http) + pass + + async def create_chat_completion(self, evt: MessageEvent) -> ChatCompletion: + pass