fix: add "max" to AnthropicModelSettings effort type (#9754)

* fix: add "max" to AnthropicModelSettings effort type

The effort field on AnthropicModelSettings only accepted
"low" | "medium" | "high", but the LLMConfig.effort field and the
Anthropic API both support "max" for Opus 4.6. This type mismatch
caused Pydantic validation to reject conversation updates that set
effort to "max" (mapped from xhigh in letta-code).

🐾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta Code <noreply@letta.com>

* generate

---------

Co-authored-by: Letta Code <noreply@letta.com>
This commit is contained in:
jnjpng
2026-03-03 16:26:45 -08:00
committed by Caren Thomas
parent 54369a7c12
commit a5bac26556
2 changed files with 5 additions and 5 deletions

View File

@@ -28104,14 +28104,14 @@
"anyOf": [
{
"type": "string",
"enum": ["low", "medium", "high"]
"enum": ["low", "medium", "high", "max"]
},
{
"type": "null"
}
],
"title": "Effort",
"description": "Effort level for Opus 4.5 model (controls token conservation). Not setting this gives similar performance to 'high'."
"description": "Effort level for supported Anthropic models (controls token spending). 'max' is only available on Opus 4.6. Not setting this gives similar performance to 'high'."
},
"strict": {
"type": "boolean",

View File

@@ -282,10 +282,10 @@ class AnthropicModelSettings(ModelSettings):
description="Soft control for how verbose model output should be, used for GPT-5 models.",
)
# Opus 4.5 effort parameter
effort: Optional[Literal["low", "medium", "high"]] = Field(
# Effort parameter for Opus 4.5, Opus 4.6, and Sonnet 4.6
effort: Optional[Literal["low", "medium", "high", "max"]] = Field(
None,
description="Effort level for Opus 4.5 model (controls token conservation). Not setting this gives similar performance to 'high'.",
description="Effort level for supported Anthropic models (controls token spending). 'max' is only available on Opus 4.6. Not setting this gives similar performance to 'high'.",
)
# Anthropic supports strict mode for tool calling - defaults to False