add: 添加ollama调用AI chat逻辑
This commit is contained in:
@@ -8,8 +8,6 @@ from maubot import Plugin
|
||||
from mautrix.types import MessageEvent, EncryptedEvent
|
||||
from mautrix.util.config import BaseProxyConfig
|
||||
|
||||
import maubot_llmplus.aibot
|
||||
|
||||
"""
|
||||
AI响应对象
|
||||
"""
|
||||
@@ -59,7 +57,7 @@ class Platform:
|
||||
|
||||
|
||||
|
||||
async def get_context(plugin: maubot_llmplus.aibot.AiBotPlugin, evt: MessageEvent) -> deque:
|
||||
async def get_context(plugin: Plugin, evt: MessageEvent) -> deque:
|
||||
# 创建系统提示词上下文
|
||||
system_context = deque()
|
||||
# 生成当前时间
|
||||
@@ -122,7 +120,7 @@ async def get_context(plugin: maubot_llmplus.aibot.AiBotPlugin, evt: MessageEven
|
||||
|
||||
|
||||
|
||||
async def generate_context_messages(plugin: maubot_llmplus.aibot.AiBotPlugin, evt: MessageEvent) -> Generator[MessageEvent, None, None]:
|
||||
async def generate_context_messages(plugin: Plugin, evt: MessageEvent) -> Generator[MessageEvent, None, None]:
|
||||
yield evt
|
||||
if plugin.config['reply_in_thread']:
|
||||
while evt.content.relates_to.in_reply_to:
|
||||
|
||||
Reference in New Issue
Block a user