diff --git a/maubot_llmplus/aibot.py b/maubot_llmplus/aibot.py index 39b3b56..1737f5c 100644 --- a/maubot_llmplus/aibot.py +++ b/maubot_llmplus/aibot.py @@ -28,7 +28,8 @@ class Config(BaseProxyConfig): helper.copy("system_prompt") helper.copy("platforms") helper.copy("additional_prompt") - super._cur_model = self['platforms'][str(self['use_platform'])]['model'] + + super._cur_model = helper.base['platforms'][helper.base['use_platform']]['model'] class AiBotPlugin(AbsExtraConfigPlugin): diff --git a/maubot_llmplus/platforms.py b/maubot_llmplus/platforms.py index e444378..09d3217 100644 --- a/maubot_llmplus/platforms.py +++ b/maubot_llmplus/platforms.py @@ -8,6 +8,7 @@ from maubot import Plugin from mautrix.types import MessageEvent, EncryptedEvent from mautrix.util.config import BaseProxyConfig +from maubot_llmplus.aibot import Config from maubot_llmplus.plugin import AbsExtraConfigPlugin """ @@ -36,7 +37,7 @@ class Platform: system_prompt: str max_context_messages: int - def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None: + def __init__(self, config: Config, http: ClientSession) -> None: self.http = http self.config = config['platforms'][self.get_type()] self.url = self.config['url']