add: 添加ollama调用AI chat逻辑

This commit is contained in:
taylor
2024-10-13 16:04:08 +08:00
parent 140a010907
commit a3038d0472
7 changed files with 7 additions and 7 deletions

View File

@@ -0,0 +1,34 @@
from mautrix.types import MessageEvent
from mautrix.util.config import BaseProxyConfig
from maubot_llmplus.platforms import Platform, ChatCompletion
class OpenAi(Platform):
def __init__(self, config: BaseProxyConfig) -> None:
super().__init__(config)
async def create_chat_completion(self, evt: MessageEvent) -> ChatCompletion:
# 获取系统提示词
# 获取额外的其他角色的提示词: role: user role: system
pass
def get_type(self) -> str:
return "openai"
class Anthropic(Platform):
def __init__(self, config: BaseProxyConfig) -> None:
super().__init__(config)
async def create_chat_completion(self, evt: MessageEvent) -> ChatCompletion:
# 获取系统提示词
# 获取额外的其他角色的提示词: role: user role: system
pass
def get_type(self) -> str:
return "anthropic"