|
33 | 33 | "Opus 4.8": "claude-opus-4-8", |
34 | 34 | "Fable 5.1": "claude-fable-5-1", |
35 | 35 | "Fable 5": "claude-fable-5", |
| 36 | + "Sonnet 5.5": "claude-sonnet-5-5", |
36 | 37 | "Sonnet 5": "claude-sonnet-5", |
37 | 38 | "Opus 4.7": "claude-opus-4-7", |
38 | 39 | "Opus 4.6": "claude-opus-4-6", |
|
44 | 45 | _THINKING_UNSUPPORTED = {"Haiku 4.5"} |
45 | 46 | # Models that use the newer "adaptive" thinking mode (Opus 4.7+ require it; older models keep the explicit budget API). |
46 | 47 | # Anthropic decides the actual budget when adaptive is used, based on the `output_config.effort` hint. |
47 | | -_ADAPTIVE_THINKING_MODELS = {"Opus 4.8", "Sonnet 5", "Opus 4.7", "Opus 4.6", "Sonnet 4.6"} |
| 48 | +_ADAPTIVE_THINKING_MODELS = {"Opus 4.8", "Sonnet 5.5", "Sonnet 5", "Opus 4.7", "Opus 4.6", "Sonnet 4.6"} |
48 | 49 | _ALWAYS_THINKING_MODELS = {"Opus 5.5", "Opus 5", "Fable 5.1", "Fable 5"} |
49 | | -_XHIGH_EFFORT_MODELS = {"Opus 5.5", "Opus 5", "Opus 4.8", "Fable 5.1", "Fable 5", "Sonnet 5", "Opus 4.7"} |
| 50 | +_XHIGH_EFFORT_MODELS = {"Opus 5.5", "Opus 5", "Opus 4.8", "Fable 5.1", "Fable 5", "Sonnet 5.5", "Sonnet 5", "Opus 4.7"} |
50 | 51 | _MAX_EFFORT_MODELS = _XHIGH_EFFORT_MODELS | {"Opus 4.6", "Sonnet 4.6"} |
51 | | -_EXPLICIT_THINKING_OFF_MODELS = {"Sonnet 5"} |
52 | | -_NO_TEMPERATURE_MODELS = {"Opus 5.5", "Opus 5", "Opus 4.8", "Fable 5.1", "Fable 5", "Sonnet 5"} |
| 52 | +_EXPLICIT_THINKING_OFF_MODELS = {"Sonnet 5.5": "between_tools", "Sonnet 5": "disabled"} |
| 53 | +_NO_TEMPERATURE_MODELS = {"Opus 5.5", "Opus 5", "Opus 4.8", "Fable 5.1", "Fable 5", "Sonnet 5.5", "Sonnet 5"} |
| 54 | +_LOW_MAX_TOKENS_MODELS = {"Opus 5.5", "Sonnet 5.5"} |
53 | 55 |
|
54 | 56 | # Budget mode (Sonnet 4.5): effort -> reasoning budget in tokens. Must be < max_tokens. |
55 | 57 | # Sized so even the "high" budget fits comfortably under the default max_tokens=32768. |
@@ -77,7 +79,7 @@ def _claude_model_inputs(model_label: str): |
77 | 79 | IO.Int.Input( |
78 | 80 | "max_tokens", |
79 | 81 | default=32768, |
80 | | - min=4096, |
| 82 | + min=1024 if model_label in _LOW_MAX_TOKENS_MODELS else 4096, |
81 | 83 | max=64000, |
82 | 84 | tooltip="Maximum number of tokens to generate (includes reasoning tokens when enabled).", |
83 | 85 | advanced=True, |
@@ -297,7 +299,7 @@ async def execute( |
297 | 299 | budget = min(budget, max(1024, max_tokens - 1024)) |
298 | 300 | thinking_cfg = AnthropicThinkingConfig(type="enabled", budget_tokens=budget) |
299 | 301 | elif model_label in _EXPLICIT_THINKING_OFF_MODELS: |
300 | | - thinking_cfg = AnthropicThinkingConfig(type="disabled") |
| 302 | + thinking_cfg = AnthropicThinkingConfig(type=_EXPLICIT_THINKING_OFF_MODELS[model_label]) |
301 | 303 |
|
302 | 304 | image_tensors: list[Input.Image] = [t for t in (images or {}).values() if t is not None] |
303 | 305 | if sum(get_number_of_images(t) for t in image_tensors) > CLAUDE_MAX_IMAGES: |
|
0 commit comments