File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -259,8 +259,16 @@ export async function generateWithAPI(
259259 ) ;
260260 }
261261
262+ const modelSetting = config . get < Model > ( "model" , "haiku" ) ;
263+ const modelMap : Record < Model , string > = {
264+ haiku : "claude-haiku-4-5-20251001" ,
265+ sonnet : "claude-sonnet-4-6" ,
266+ opus : "claude-opus-4-6" ,
267+ } ;
268+ const apiModel = modelMap [ modelSetting ] ?? modelMap . haiku ;
269+
262270 if ( progressCallback ) {
263- progressCallback ( " Connecting to Anthropic API..." ) ;
271+ progressCallback ( ` Connecting to Anthropic API ( ${ modelSetting } ) ...` ) ;
264272 }
265273
266274 try {
@@ -269,7 +277,7 @@ export async function generateWithAPI(
269277 const anthropic = new Anthropic ( { apiKey } ) ;
270278
271279 const message = await anthropic . messages . create ( {
272- model : "claude-sonnet-4-5-20250929" ,
280+ model : apiModel ,
273281 max_tokens : 1000 ,
274282 temperature : 0.3 ,
275283 messages : [ { role : "user" , content : prompt } ] ,
You can’t perform that action at this time.
0 commit comments