mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
(fix) router - errors with reading timeout, stream timeout, max retries
This commit is contained in:
parent
7b88420223
commit
2ecbd92f13
1 changed files with 4 additions and 4 deletions
|
@ -909,19 +909,19 @@ class Router:
|
||||||
|
|
||||||
timeout = litellm_params.pop("timeout", None)
|
timeout = litellm_params.pop("timeout", None)
|
||||||
if isinstance(timeout, str) and timeout.startswith("os.environ/"):
|
if isinstance(timeout, str) and timeout.startswith("os.environ/"):
|
||||||
timeout_env_name = api_version.replace("os.environ/", "")
|
timeout_env_name = timeout.replace("os.environ/", "")
|
||||||
timeout = litellm.get_secret(timeout_env_name)
|
timeout = litellm.get_secret(timeout_env_name)
|
||||||
litellm_params["timeout"] = timeout
|
litellm_params["timeout"] = timeout
|
||||||
|
|
||||||
stream_timeout = litellm_params.pop("stream_timeout", timeout) # if no stream_timeout is set, default to timeout
|
stream_timeout = litellm_params.pop("stream_timeout", timeout) # if no stream_timeout is set, default to timeout
|
||||||
if isinstance(stream_timeout, str) and stream_timeout.startswith("os.environ/"):
|
if isinstance(stream_timeout, str) and stream_timeout.startswith("os.environ/"):
|
||||||
stream_timeout_env_name = api_version.replace("os.environ/", "")
|
stream_timeout_env_name = stream_timeout.replace("os.environ/", "")
|
||||||
stream_timeout = litellm.get_secret(stream_timeout_env_name)
|
stream_timeout = litellm.get_secret(stream_timeout_env_name)
|
||||||
litellm_params["stream_timeout"] = stream_timeout
|
litellm_params["stream_timeout"] = stream_timeout
|
||||||
|
|
||||||
max_retries = litellm_params.pop("max_retries", 2)
|
max_retries = litellm_params.pop("max_retries", 2)
|
||||||
if isinstance(max_retries, str) and max_retries.startswith("os.environ/"):
|
if isinstance(max_retries, str) and max_retries.startswith("os.environ/"):
|
||||||
max_retries_env_name = api_version.replace("os.environ/", "")
|
max_retries_env_name = max_retries.replace("os.environ/", "")
|
||||||
max_retries = litellm.get_secret(max_retries_env_name)
|
max_retries = litellm.get_secret(max_retries_env_name)
|
||||||
litellm_params["max_retries"] = max_retries
|
litellm_params["max_retries"] = max_retries
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue