style: format messages handler

This commit is contained in:
mikemikimike 2026-09-09 15:02:05 +08:00
parent 5e302355ed
commit 0c5c7aa3da

View file

@ -580,27 +580,29 @@ def anthropic_messages_handler(
)
if anthropic_messages_provider_config is None:
# Route to Responses API for OpenAI / Azure, chat/completions for everything else.
_shared_kwargs: Final = MappingProxyType({
"max_tokens": max_tokens,
"messages": messages,
"model": original_model,
"metadata": metadata,
"stop_sequences": stop_sequences,
"stream": stream,
"system": system,
"temperature": temperature,
"thinking": thinking,
"tool_choice": tool_choice,
"tools": tools,
"top_k": top_k,
"top_p": top_p,
"_is_async": is_async,
"api_key": api_key,
"api_base": api_base,
"client": client,
"custom_llm_provider": custom_llm_provider,
**kwargs,
})
_shared_kwargs: Final = MappingProxyType(
{
"max_tokens": max_tokens,
"messages": messages,
"model": original_model,
"metadata": metadata,
"stop_sequences": stop_sequences,
"stream": stream,
"system": system,
"temperature": temperature,
"thinking": thinking,
"tool_choice": tool_choice,
"tools": tools,
"top_k": top_k,
"top_p": top_p,
"_is_async": is_async,
"api_key": api_key,
"api_base": api_base,
"client": client,
"custom_llm_provider": custom_llm_provider,
**kwargs,
}
)
if _should_route_to_responses_api(
custom_llm_provider=custom_llm_provider,
requested_model=original_model,