fix: send Anthropic effort in model_settings and read it for display (#1016)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2026-02-18 12:57:52 -08:00
committed by GitHub
parent 4e1827ebc1
commit bdc23932b5
2 changed files with 59 additions and 14 deletions

View File

@@ -70,6 +70,14 @@ function buildModelSettings(
provider_type: "anthropic",
parallel_tool_calls: true,
};
// Map reasoning_effort to Anthropic's effort field (controls token spending via output_config)
const effort = updateArgs?.reasoning_effort;
if (effort === "low" || effort === "medium" || effort === "high") {
anthropicSettings.effort = effort;
} else if (effort === "xhigh") {
// "max" is valid on the backend but the SDK type hasn't caught up yet
(anthropicSettings as Record<string, unknown>).effort = "max";
}
// Build thinking config if either enable_reasoner or max_reasoning_tokens is specified
if (
updateArgs?.enable_reasoner !== undefined ||
@@ -126,6 +134,13 @@ function buildModelSettings(
provider_type: "bedrock",
parallel_tool_calls: true,
};
// Map reasoning_effort to Anthropic's effort field (Bedrock runs Claude models)
const effort = updateArgs?.reasoning_effort;
if (effort === "low" || effort === "medium" || effort === "high") {
bedrockSettings.effort = effort;
} else if (effort === "xhigh") {
bedrockSettings.effort = "max";
}
// Build thinking config if either enable_reasoner or max_reasoning_tokens is specified
if (
updateArgs?.enable_reasoner !== undefined ||