Skip to content

Commit 40b808c

Browse files
committed
feat: support opus 4.5
1 parent d691b79 commit 40b808c

File tree

3 files changed

+37
-13
lines changed

3 files changed

+37
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"wcs": "./runner/bin/cli.js"
5252
},
5353
"dependencies": {
54-
"@ai-sdk/anthropic": "^2.0.45",
54+
"@ai-sdk/anthropic": "^2.0.50",
5555
"@ai-sdk/google": "^2.0.39",
5656
"@ai-sdk/openai": "^2.0.71",
5757
"@ai-sdk/provider": "^2.0.0",

pnpm-lock.yaml

Lines changed: 23 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runner/codegen/ai-sdk/anthropic.ts

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ export const ANTHROPIC_MODELS = [
77
'claude-opus-4.1-no-thinking',
88
'claude-opus-4.1-with-thinking-16k',
99
'claude-opus-4.1-with-thinking-32k',
10+
'claude-opus-4.5-no-thinking',
11+
'claude-opus-4.5-with-thinking-16k',
12+
'claude-opus-4.5-with-thinking-32k',
1013
'claude-sonnet-4.5-no-thinking',
1114
'claude-sonnet-4.5-with-thinking-16k',
1215
'claude-sonnet-4.5-with-thinking-32k',
@@ -21,6 +24,9 @@ export async function getAiSdkModelOptionsForAnthropic(
2124
case 'claude-opus-4.1-no-thinking':
2225
case 'claude-opus-4.1-with-thinking-16k':
2326
case 'claude-opus-4.1-with-thinking-32k':
27+
case 'claude-opus-4.5-no-thinking':
28+
case 'claude-opus-4.5-with-thinking-16k':
29+
case 'claude-opus-4.5-with-thinking-32k':
2430
case 'claude-sonnet-4.5-no-thinking':
2531
case 'claude-sonnet-4.5-with-thinking-16k':
2632
case 'claude-sonnet-4.5-with-thinking-32k': {
@@ -30,8 +36,13 @@ export async function getAiSdkModelOptionsForAnthropic(
3036
: modelName.endsWith('-32k')
3137
? 32_000
3238
: 16_000;
33-
const isOpus4_1Model = modelName.includes('opus-4.1');
34-
const model = anthropic(isOpus4_1Model ? 'claude-opus-4-1' : 'claude-sonnet-4-5');
39+
let apiModelName: Parameters<typeof anthropic>[0] = 'claude-sonnet-4-5';
40+
if (modelName.includes('opus-4.1')) {
41+
apiModelName = 'claude-opus-4-1';
42+
} else if (modelName.includes('opus-4.5')) {
43+
apiModelName = 'claude-opus-4.5';
44+
}
45+
const model = anthropic(apiModelName);
3546
return {
3647
model: thinkingEnabled
3748
? wrapLanguageModel({

0 commit comments

Comments
 (0)