MCPcopy Create free account
hub / github.com/simstudioai/sim / supportsAdaptiveThinking

Function supportsAdaptiveThinking

apps/sim/providers/anthropic/core.ts:93–107  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

91 * Opus 4.5 supports effort but NOT adaptive thinking — it uses budget_tokens with type: "enabled".
92 */
93function 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.

Callers 1

buildThinkingConfigFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected