forked from phoenix/litellm-mirror
fix(main.py): don't set timeout as an optional api param
This commit is contained in:
parent
aee38d9329
commit
77be3e3114
4 changed files with 9 additions and 30 deletions
|
@ -382,6 +382,7 @@ class OpenAIChatCompletion(BaseLLM):
|
||||||
"complete_input_dict": data,
|
"complete_input_dict": data,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
response = await openai_aclient.chat.completions.create(**data)
|
response = await openai_aclient.chat.completions.create(**data)
|
||||||
stringified_response = response.model_dump_json()
|
stringified_response = response.model_dump_json()
|
||||||
logging_obj.post_call(
|
logging_obj.post_call(
|
||||||
|
|
|
@ -574,7 +574,6 @@ def completion(
|
||||||
max_retries=max_retries,
|
max_retries=max_retries,
|
||||||
logprobs=logprobs,
|
logprobs=logprobs,
|
||||||
top_logprobs=top_logprobs,
|
top_logprobs=top_logprobs,
|
||||||
timeout=timeout,
|
|
||||||
**non_default_params,
|
**non_default_params,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ def test_get_cloudflare_response_streaming():
|
||||||
asyncio.run(test_async_call())
|
asyncio.run(test_async_call())
|
||||||
|
|
||||||
|
|
||||||
test_get_cloudflare_response_streaming()
|
# test_get_cloudflare_response_streaming()
|
||||||
|
|
||||||
|
|
||||||
def test_get_response_streaming():
|
def test_get_response_streaming():
|
||||||
|
|
|
@ -2910,7 +2910,6 @@ def get_optional_params(
|
||||||
max_retries=None,
|
max_retries=None,
|
||||||
logprobs=None,
|
logprobs=None,
|
||||||
top_logprobs=None,
|
top_logprobs=None,
|
||||||
timeout=None,
|
|
||||||
**kwargs,
|
**kwargs,
|
||||||
):
|
):
|
||||||
# retrieve all parameters passed to the function
|
# retrieve all parameters passed to the function
|
||||||
|
@ -2940,7 +2939,6 @@ def get_optional_params(
|
||||||
"max_retries": None,
|
"max_retries": None,
|
||||||
"logprobs": None,
|
"logprobs": None,
|
||||||
"top_logprobs": None,
|
"top_logprobs": None,
|
||||||
"timeout": 600,
|
|
||||||
}
|
}
|
||||||
# filter out those parameters that were passed with non-default values
|
# filter out those parameters that were passed with non-default values
|
||||||
non_default_params = {
|
non_default_params = {
|
||||||
|
@ -3734,7 +3732,6 @@ def get_optional_params(
|
||||||
"max_retries",
|
"max_retries",
|
||||||
"logprobs",
|
"logprobs",
|
||||||
"top_logprobs",
|
"top_logprobs",
|
||||||
"timeout",
|
|
||||||
]
|
]
|
||||||
_check_valid_arg(supported_params=supported_params)
|
_check_valid_arg(supported_params=supported_params)
|
||||||
if functions is not None:
|
if functions is not None:
|
||||||
|
@ -3775,8 +3772,6 @@ def get_optional_params(
|
||||||
optional_params["logprobs"] = logprobs
|
optional_params["logprobs"] = logprobs
|
||||||
if top_logprobs is not None:
|
if top_logprobs is not None:
|
||||||
optional_params["top_logprobs"] = top_logprobs
|
optional_params["top_logprobs"] = top_logprobs
|
||||||
if timeout is not None:
|
|
||||||
optional_params["timeout"] = timeout
|
|
||||||
# if user passed in non-default kwargs for specific providers/models, pass them along
|
# if user passed in non-default kwargs for specific providers/models, pass them along
|
||||||
for k in passed_params.keys():
|
for k in passed_params.keys():
|
||||||
if k not in default_params.keys():
|
if k not in default_params.keys():
|
||||||
|
@ -6539,12 +6534,14 @@ class CustomStreamWrapper:
|
||||||
self.special_tokens = ["<|assistant|>", "<|system|>", "<|user|>", "<s>", "</s>"]
|
self.special_tokens = ["<|assistant|>", "<|system|>", "<|user|>", "<s>", "</s>"]
|
||||||
self.holding_chunk = ""
|
self.holding_chunk = ""
|
||||||
self.complete_response = ""
|
self.complete_response = ""
|
||||||
self._hidden_params = {
|
_model_info = (
|
||||||
"model_id": (
|
self.logging_obj.model_call_details.get("litellm_params", {}).get(
|
||||||
self.logging_obj.model_call_details.get("litellm_params", {})
|
"model_info", {}
|
||||||
.get("model_info", {})
|
|
||||||
.get("id", None)
|
|
||||||
)
|
)
|
||||||
|
or {}
|
||||||
|
)
|
||||||
|
self._hidden_params = {
|
||||||
|
"model_id": (_model_info.get("id", None))
|
||||||
} # returned as x-litellm-model-id response header in proxy
|
} # returned as x-litellm-model-id response header in proxy
|
||||||
|
|
||||||
def __iter__(self):
|
def __iter__(self):
|
||||||
|
@ -7437,14 +7434,6 @@ class CustomStreamWrapper:
|
||||||
target=self.logging_obj.success_handler, args=(response,)
|
target=self.logging_obj.success_handler, args=(response,)
|
||||||
).start() # log response
|
).start() # log response
|
||||||
# RETURN RESULT
|
# RETURN RESULT
|
||||||
if hasattr(response, "_hidden_params"):
|
|
||||||
response._hidden_params["model_id"] = (
|
|
||||||
self.logging_obj.model_call_details.get(
|
|
||||||
"litellm_params", {}
|
|
||||||
)
|
|
||||||
.get("model_info", {})
|
|
||||||
.get("id", None)
|
|
||||||
)
|
|
||||||
return response
|
return response
|
||||||
except StopIteration:
|
except StopIteration:
|
||||||
raise # Re-raise StopIteration
|
raise # Re-raise StopIteration
|
||||||
|
@ -7495,16 +7484,6 @@ class CustomStreamWrapper:
|
||||||
processed_chunk,
|
processed_chunk,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
# RETURN RESULT
|
|
||||||
if hasattr(processed_chunk, "_hidden_params"):
|
|
||||||
model_id = (
|
|
||||||
self.logging_obj.model_call_details.get(
|
|
||||||
"litellm_params", {}
|
|
||||||
)
|
|
||||||
.get("model_info", {})
|
|
||||||
.get("id", None)
|
|
||||||
)
|
|
||||||
processed_chunk._hidden_params["model_id"] = model_id
|
|
||||||
return processed_chunk
|
return processed_chunk
|
||||||
raise StopAsyncIteration
|
raise StopAsyncIteration
|
||||||
else: # temporary patch for non-aiohttp async calls
|
else: # temporary patch for non-aiohttp async calls
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue