fix(anthropic): satisfy type discipline budget

Signed-off-by: Hasnaat Hussain <hasnaat.hussain.2@gmail.com>
This commit is contained in:
Hasnaat Hussain 2026-08-13 01:57:59 +05:00
parent 1b6ceeae51
commit 54ec3c3e11

View file

@ -435,7 +435,7 @@ def _drop_unsupported_anthropic_messages_params(
supports_reasoning: Final = AnthropicConfig._supports_model_capability(
model, "supports_reasoning", custom_llm_provider or "anthropic"
)
drop_context_management: Final = custom_llm_provider in ["vertex_ai", "bedrock"] and "haiku" in model.lower()
drop_context_management: Final = custom_llm_provider in ("vertex_ai", "bedrock") and "haiku" in model.lower()
return MappingProxyType(
{
k: v
@ -695,7 +695,7 @@ def anthropic_messages_handler(
MappingProxyType(
{
**filtered_anthropic_messages_params,
"thinking": {
"thinking": { # mutable-ok: construct the summarized payload before freezing
**thinking_param,
"display": "summarized",
},
@ -716,7 +716,9 @@ def anthropic_messages_handler(
model=model,
messages=strip_provider_specific_fields_from_anthropic_messages(messages),
anthropic_messages_provider_config=anthropic_messages_provider_config,
anthropic_messages_optional_request_params=dict(final_anthropic_messages_params),
anthropic_messages_optional_request_params=dict( # mutable-ok: downstream handler requires a dict
final_anthropic_messages_params
),
_is_async=is_async,
client=client,
custom_llm_provider=custom_llm_provider,