File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -124,18 +124,21 @@ export class PearAiHandler extends BaseProvider implements SingleCompletionHandl
124124 } else if ( this . pearAiModelsResponse ) {
125125 modelInfo = this . pearAiModelsResponse . models [ this . options . apiModelId || "pearai-model" ]
126126 }
127- return {
128- id : this . options . apiModelId ,
129- info : {
130- contextWindow : modelInfo . contextWindow || 4096 , // provide default or actual value
131- supportsPromptCache : modelInfo . supportsPromptCaching || false , // provide default or actual value
132- ...modelInfo ,
133- } ,
127+ if ( modelInfo ) {
128+ return {
129+ id : this . options . apiModelId ,
130+ info : {
131+ contextWindow : modelInfo . contextWindow || 4096 , // provide default or actual value
132+ supportsPromptCache : modelInfo . supportsPromptCaching || false , // provide default or actual value
133+ ...modelInfo ,
134+ } ,
135+ }
134136 }
135- } else {
136- const baseModel = this . handler . getModel ( )
137- return baseModel
138137 }
138+
139+ // Fallback to using what's available on client side
140+ const baseModel = this . handler . getModel ( )
141+ return baseModel
139142 }
140143
141144 async * createMessage ( systemPrompt : string , messages : any [ ] ) : AsyncGenerator < any > {
You can’t perform that action at this time.
0 commit comments