File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -32,9 +32,17 @@ export class PearAiHandler {
3232 throw new Error ( "PearAI API key not found. Please login to PearAI." )
3333 }
3434
35+ // Initialize with a default handler synchronously
36+ this . handler = new AnthropicHandler ( {
37+ ...options ,
38+ apiKey : options . pearaiApiKey ,
39+ anthropicBaseUrl : PEARAI_URL ,
40+ apiModelId : "claude-3-5-sonnet-20241022" ,
41+ } )
42+
43+ // Then try to initialize the correct handler asynchronously
3544 this . initializeHandler ( options ) . catch ( ( error ) => {
3645 console . error ( "Failed to initialize PearAI handler:" , error )
37- throw error
3846 } )
3947 }
4048
@@ -94,6 +102,7 @@ export class PearAiHandler {
94102 }
95103
96104 getModel ( ) : { id : string ; info : ModelInfo } {
105+ console . dir ( this . handler )
97106 const baseModel = this . handler . getModel ( )
98107 return {
99108 id : baseModel . id ,
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313 requestyDefaultModelId ,
1414 requestyDefaultModelInfo ,
1515 PEARAI_URL ,
16+ pearAiModels ,
1617} from "../../../src/shared/api"
1718import { vscode } from "../utils/vscode"
1819import { convertTextMateToHljs } from "../utils/textMateToHljs"
@@ -153,6 +154,8 @@ export const ExtensionStateContextProvider: React.FC<{ children: React.ReactNode
153154 apiConfiguration : {
154155 apiProvider : "pearai" ,
155156 pearaiBaseUrl : PEARAI_URL ,
157+ pearaiModelId : "pearai-model" ,
158+ pearaiModelInfo : pearAiModels [ "pearai-model" ] ,
156159 } ,
157160 } )
158161 }
You can’t perform that action at this time.
0 commit comments