mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-06 08:16:43 +00:00
fix: correct timeout precedence in async_anthropic_messages_handler
Per-request litellm_params.timeout should take priority over the proxy global kwargs["request_timeout"]. Fixes the precedence flagged in code review.
This commit is contained in:
parent
44d3d53f95
commit
29e96f5823
1 changed files with 5 additions and 4 deletions
|
|
@ -1955,11 +1955,12 @@ class BaseLLMHTTPHandler:
|
|||
)
|
||||
|
||||
# Resolve the request timeout so a silent upstream is not waited on
|
||||
# indefinitely. Priority: per-request kwargs["request_timeout"] >
|
||||
# litellm_params.timeout > litellm.request_timeout > client default.
|
||||
# indefinitely. Priority: litellm_params.timeout (per-request explicit)
|
||||
# > kwargs["request_timeout"] (proxy global) > litellm.request_timeout
|
||||
# (library global) > client default.
|
||||
_request_timeout: Optional[Union[float, httpx.Timeout]] = (
|
||||
kwargs.get("request_timeout")
|
||||
or litellm_params.get("timeout")
|
||||
litellm_params.get("timeout")
|
||||
or kwargs.get("request_timeout")
|
||||
or litellm.request_timeout
|
||||
or None
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue