File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { DEFAULT_HEADERS, REASONING_MODELS } from "./constants"
77import { BaseProvider } from "./base-provider"
88import { SingleCompletionHandler } from ".."
99
10+ const XAI_DEFAULT_TEMPERATURE = 0
11+
1012export class XAIHandler extends BaseProvider implements SingleCompletionHandler {
1113 protected options : ApiHandlerOptions
1214 private client : OpenAI
@@ -45,7 +47,7 @@ export class XAIHandler extends BaseProvider implements SingleCompletionHandler
4547 const stream = await this . client . chat . completions . create ( {
4648 model : modelId ,
4749 max_tokens : modelInfo . maxTokens ,
48- temperature : 0 ,
50+ temperature : this . options . modelTemperature ?? XAI_DEFAULT_TEMPERATURE ,
4951 messages : [ { role : "system" , content : systemPrompt } , ...convertToOpenAiMessages ( messages ) ] ,
5052 stream : true ,
5153 stream_options : { include_usage : true } ,
You can’t perform that action at this time.
0 commit comments