feat: add effort dropdown for claude 4.5 opus (backend) (#6351)

* feat: add effort support (backend)

* fix test_agent_state_schema_unchanged

---------

Co-authored-by: Ari Webb <ari@letta.com>
This commit is contained in:
Ari Webb
2025-11-24 17:21:56 -08:00
committed by Caren Thomas
parent 1d86baba2f
commit ce2ca8660b
3 changed files with 8 additions and 0 deletions

View File

@@ -441,6 +441,9 @@ class LLMConfig(BaseModel):
config.put_inner_thoughts_in_kwargs = False
if config.enable_reasoner and config.max_reasoning_tokens == 0:
config.max_reasoning_tokens = 1024
# Set default effort level for Claude Opus 4.5
if config.model.startswith("claude-opus-4-5") and config.effort is None:
config.effort = "medium"
return config
# Google Gemini 2.5 Pro and Gemini 3: not possible to disable
@@ -495,6 +498,9 @@ class LLMConfig(BaseModel):
config.put_inner_thoughts_in_kwargs = False
if config.max_reasoning_tokens == 0:
config.max_reasoning_tokens = 1024
# Set default effort level for Claude Opus 4.5
if config.model.startswith("claude-opus-4-5") and config.effort is None:
config.effort = "medium"
elif cls.is_google_vertex_reasoning_model(config) or cls.is_google_ai_reasoning_model(config):
# Handle as non-reasoner until we support summary
config.put_inner_thoughts_in_kwargs = True

View File

@@ -112,6 +112,7 @@ class Model(LLMConfig, ModelBase):
enable_reasoner=llm_config.enable_reasoner,
reasoning_effort=llm_config.reasoning_effort,
max_reasoning_tokens=llm_config.max_reasoning_tokens,
effort=llm_config.effort,
frequency_penalty=llm_config.frequency_penalty,
compatibility_type=llm_config.compatibility_type,
verbosity=llm_config.verbosity,

View File

@@ -1541,6 +1541,7 @@ async def test_agent_state_schema_unchanged(server: SyncServer):
"max_tokens",
"enable_reasoner",
"reasoning_effort",
"effort",
"max_reasoning_tokens",
"frequency_penalty",
"compatibility_type",