anthropic_utils
SAMPLING_PARAMS_DEPRECATED_MIN_VERSIONS = {'opus': (4, 7), 'sonnet': (5, 0)}
module-attribute
_CLAUDE_VERSION_PATTERN = re.compile('claude-([a-z]+)-(\\d+)(?:-(\\d{1,2})(?!\\d))?')
module-attribute
supports_sampling_params(model)
Whether a Claude model accepts the temperature, top_p, and top_k sampling parameters.
Support is derived from the Claude model family and version embedded in model rather than a
hardcoded model id, so every model in an affected family at or above the deprecating version
(for example every Opus release from 4.7 onward, including major-only ids like claude-opus-5)
is covered without a per-model change. A model whose minor version is absent is treated as .0.