add: 添加ollama调用AI chat逻辑

This commit is contained in:
taylor
2024-10-13 16:56:21 +08:00
parent f837163ca1
commit bab547198f
2 changed files with 5 additions and 7 deletions

View File

@@ -29,15 +29,13 @@ class Config(BaseProxyConfig):
class AiBotPlugin(Plugin):
# name of the bot
name: str
async def start(self) -> None:
await super().start()
# 加载并更新配置
self.config.load_and_update()
# 决定当前机器人的名称
self.name = self.config['name'] or \
super.name = self.config['name'] or \
await self.client.get_displayname(self.client.mxid) or \
self.client.parse_user_id(self.client.mxid)[0]