diff --git a/maubot_llmplus/thrid_platform.py b/maubot_llmplus/thrid_platform.py index 2c93cc6..3edd9db 100644 --- a/maubot_llmplus/thrid_platform.py +++ b/maubot_llmplus/thrid_platform.py @@ -120,9 +120,13 @@ class Anthropic(Platform): class XAi(Platform): + max_tokens: int + temperature: int def __init__(self, config: BaseProxyConfig, http: ClientSession) -> None: super().__init__(config, http) + self.temperature = self.config['temperature'] + self.max_tokens = self.config['max_tokens'] async def create_chat_completion(self, plugin: AbsExtraConfigPlugin, evt: MessageEvent) -> ChatCompletion: full_context = [] @@ -139,6 +143,9 @@ class XAi(Platform): "stream": False } + if 'max_tokens' in self.config and self.max_tokens: + data["max_tokens"] = self.max_tokens + if 'temperature' in self.config and self.temperature: request_body["temperature"] = self.temperature