add: 添加ollama调用AI chat逻辑
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user