* Checks if a model supports adaptive thinking (thinking.type: "adaptive"). * Fable 5 supports ONLY adaptive thinking (always on; type: "disabled" is rejected). * Sonnet 5 supports ONLY adaptive thinking (manual budget_tokens returns a 400 error). * Opus 4.8 and Opus 4.7 support ONLY adaptive thi
(modelId: string)
| 91 | * Opus 4.5 supports effort but NOT adaptive thinking — it uses budget_tokens with type: "enabled". |
| 92 | */ |
| 93 | function supportsAdaptiveThinking(modelId: string): boolean { |
| 94 | const normalizedModel = modelId.toLowerCase() |
| 95 | return ( |
| 96 | normalizedModel.includes('fable-5') || |
| 97 | normalizedModel.includes('sonnet-5') || |
| 98 | normalizedModel.includes('opus-4-8') || |
| 99 | normalizedModel.includes('opus-4.8') || |
| 100 | normalizedModel.includes('opus-4-7') || |
| 101 | normalizedModel.includes('opus-4.7') || |
| 102 | normalizedModel.includes('opus-4-6') || |
| 103 | normalizedModel.includes('opus-4.6') || |
| 104 | normalizedModel.includes('sonnet-4-6') || |
| 105 | normalizedModel.includes('sonnet-4.6') |
| 106 | ) |
| 107 | } |
| 108 | |
| 109 | /** |
| 110 | * Builds the thinking configuration for the Anthropic API based on model capabilities and level. |
no outgoing calls
no test coverage detected