anthropic_utils
FORCED_TOOL_CHOICE_UNSUPPORTED_MIN_VERSIONS = {'opus': (5, 5), 'sonnet': (5, 5), 'fable': (5, 1), 'mythos': (5, 1)}
module-attribute
SAMPLING_PARAMS_DEPRECATED_MIN_VERSIONS = {'opus': (4, 7), 'sonnet': (5, 0), 'fable': (5, 0)}
module-attribute
_CLAUDE_VERSION_PATTERN = re.compile('claude-([a-z]+)-(\\d+)(?:-(\\d{1,2})(?!\\d))?')
module-attribute
_is_at_or_above(model, min_versions)
Source code in griptape/utils/anthropic_utils.py
resolve_structured_output_strategy(model, strategy)
supports_forced_tool_choice(model)
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.