Skip to content

Commit ddb79da

Browse files
authored
Merge pull request #13 from ThatProgrammerr/ThatProgrammerr-patch-1
fix(cli): update generateWithAPI to use config model
2 parents 2e84950 + 5affa0a commit ddb79da

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎src/cli/execution.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff 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 }],

0 commit comments

Comments
 (0)