@@ -29,8 +29,10 @@ import {anthropicThinkingWithStructuredResponseMiddleware} from './ai-sdk-claude
2929const SUPPORTED_MODELS = [
3030 'claude-opus-4.1-no-thinking' ,
3131 'claude-opus-4.1-with-thinking-16k' ,
32+ 'claude-opus-4.1-with-thinking-32k' ,
3233 'claude-sonnet-4.5-no-thinking' ,
3334 'claude-sonnet-4.5-with-thinking-16k' ,
35+ 'claude-sonnet-4.5-with-thinking-32k' ,
3436 'gemini-2.5-flash-lite' ,
3537 'gemini-2.5-flash' ,
3638 'gemini-2.5-flash-with-dynamic-thinking' ,
@@ -48,6 +50,7 @@ const SUPPORTED_MODELS = [
4850const DEFAULT_MAX_RETRIES = 100000 ;
4951
5052const claude16kThinkingTokenBudget = 16_000 ;
53+ const claude32kThinkingTokenBudget = 32_000 ;
5154export class AiSDKRunner implements LlmRunner {
5255 displayName = 'AI SDK' ;
5356 id = 'ai-sdk' ;
@@ -163,9 +166,16 @@ export class AiSDKRunner implements LlmRunner {
163166 switch ( modelName ) {
164167 case 'claude-opus-4.1-no-thinking' :
165168 case 'claude-opus-4.1-with-thinking-16k' :
169+ case 'claude-opus-4.1-with-thinking-32k' :
166170 case 'claude-sonnet-4.5-no-thinking' :
167- case 'claude-sonnet-4.5-with-thinking-16k' : {
171+ case 'claude-sonnet-4.5-with-thinking-16k' :
172+ case 'claude-sonnet-4.5-with-thinking-32k' : {
168173 const thinkingEnabled = modelName . includes ( '-with-thinking' ) ;
174+ const thinkingBudget = ! thinkingEnabled
175+ ? undefined
176+ : modelName . endsWith ( '-32k' )
177+ ? claude32kThinkingTokenBudget
178+ : claude16kThinkingTokenBudget ;
169179 const isOpus4_1Model = modelName . includes ( 'opus-4.1' ) ;
170180 const model = anthropic ( isOpus4_1Model ? 'claude-opus-4-1' : 'claude-sonnet-4-5' ) ;
171181 return {
@@ -180,7 +190,7 @@ export class AiSDKRunner implements LlmRunner {
180190 sendReasoning : thinkingEnabled ,
181191 thinking : {
182192 type : thinkingEnabled ? 'enabled' : 'disabled' ,
183- budgetTokens : thinkingEnabled ? claude16kThinkingTokenBudget : undefined ,
193+ budgetTokens : thinkingBudget ,
184194 } ,
185195 } satisfies AnthropicProviderOptions ,
186196 } ,
0 commit comments