add: 添加ollama调用AI chat逻辑

This commit is contained in:
taylor
2024-10-13 17:07:42 +08:00
parent bab547198f
commit 5821623aae
4 changed files with 19 additions and 16 deletions

View File

@@ -8,8 +8,8 @@ from maubot_llmplus.platforms import Platform, ChatCompletion
class OpenAi(Platform):
def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None:
super().__init__(config, http)
def __init__(self, config: BaseProxyConfig, name: str, http: ClientSession) -> None:
super().__init__(config, name, http)
async def create_chat_completion(self, plugin: Plugin, evt: MessageEvent) -> ChatCompletion:
# 获取系统提示词
@@ -23,8 +23,8 @@ class OpenAi(Platform):
class Anthropic(Platform):
def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None:
super().__init__(config, http)
def __init__(self, config: BaseProxyConfig, name: str, http: ClientSession) -> None:
super().__init__(config, name, http)
async def create_chat_completion(self, plugin: Plugin, evt: MessageEvent) -> ChatCompletion:
# 获取系统提示词