diff --git a/maubot_llmplus/local_paltform.py b/maubot_llmplus/local_paltform.py index dbfbe97..264c26c 100644 --- a/maubot_llmplus/local_paltform.py +++ b/maubot_llmplus/local_paltform.py @@ -1,5 +1,6 @@ import json +from aiohttp import ClientSession from mautrix.types import MessageEvent from mautrix.util.config import BaseProxyConfig @@ -11,8 +12,8 @@ from maubot_llmplus.platforms import Platform, ChatCompletion class Ollama(Platform): chat_api: str - def __init__(self, config: BaseProxyConfig) -> None: - super().__init__(config) + def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None: + super().__init__(config, http) self.chat_api = '/api/chat' async def create_chat_completion(self, evt: MessageEvent) -> ChatCompletion: diff --git a/maubot_llmplus/thrid_platform.py b/maubot_llmplus/thrid_platform.py index 33d58d4..5b7c39e 100644 --- a/maubot_llmplus/thrid_platform.py +++ b/maubot_llmplus/thrid_platform.py @@ -1,3 +1,4 @@ +from aiohttp import ClientSession from mautrix.types import MessageEvent from mautrix.util.config import BaseProxyConfig @@ -6,8 +7,8 @@ from maubot_llmplus.platforms import Platform, ChatCompletion class OpenAi(Platform): - def __init__(self, config: BaseProxyConfig) -> None: - super().__init__(config) + def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None: + super().__init__(config, http) async def create_chat_completion(self, evt: MessageEvent) -> ChatCompletion: # 获取系统提示词 @@ -21,8 +22,8 @@ class OpenAi(Platform): class Anthropic(Platform): - def __init__(self, config: BaseProxyConfig) -> None: - super().__init__(config) + def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None: + super().__init__(config, http) async def create_chat_completion(self, evt: MessageEvent) -> ChatCompletion: # 获取系统提示词