File tree Expand file tree Collapse file tree 1 file changed +10
-8
lines changed
Expand file tree Collapse file tree 1 file changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,19 @@ export class XAIHandler extends BaseProvider implements SingleCompletionHandler
2222 }
2323
2424 override getModel ( ) {
25- const modelId = this . options . apiModelId
25+ // Determine which model ID to use (specified or default)
26+ const id =
27+ this . options . apiModelId && this . options . apiModelId in xaiModels
28+ ? ( this . options . apiModelId as XAIModelId )
29+ : xaiDefaultModelId
2630
27- if ( modelId && modelId in xaiModels ) {
28- const id = modelId as XAIModelId
29- return { id, info : xaiModels [ id ] }
30- }
31+ // Check if reasoning effort applies to this model
32+ const supportsReasoning = REASONING_MODELS . has ( id )
3133
3234 return {
33- id : xaiDefaultModelId ,
34- info : xaiModels [ xaiDefaultModelId ] ,
35- reasoningEffort : REASONING_MODELS . has ( xaiDefaultModelId ) ? this . options . reasoningEffort : undefined ,
35+ id,
36+ info : xaiModels [ id ] ,
37+ reasoningEffort : supportsReasoning ? this . options . reasoningEffort : undefined ,
3638 }
3739 }
3840
You can’t perform that action at this time.
0 commit comments