mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
fix(openai.py): fix position of invalid_params param
This commit is contained in:
parent
1553f7fa48
commit
dd2ea72cb4
3 changed files with 5 additions and 8 deletions
|
@ -964,9 +964,9 @@ class OpenAIChatCompletion(BaseLLM):
|
|||
except openai.UnprocessableEntityError as e:
|
||||
## check if body contains unprocessable params - related issue https://github.com/BerriAI/litellm/issues/4800
|
||||
if litellm.drop_params is True or drop_params is True:
|
||||
invalid_params: List[str] = []
|
||||
if e.body is not None and isinstance(e.body, dict) and e.body.get("detail"): # type: ignore
|
||||
detail = e.body.get("detail") # type: ignore
|
||||
invalid_params: List[str] = []
|
||||
if (
|
||||
isinstance(detail, List)
|
||||
and len(detail) > 0
|
||||
|
@ -1096,9 +1096,9 @@ class OpenAIChatCompletion(BaseLLM):
|
|||
except openai.UnprocessableEntityError as e:
|
||||
## check if body contains unprocessable params - related issue https://github.com/BerriAI/litellm/issues/4800
|
||||
if litellm.drop_params is True or drop_params is True:
|
||||
invalid_params: List[str] = []
|
||||
if e.body is not None and isinstance(e.body, dict) and e.body.get("detail"): # type: ignore
|
||||
detail = e.body.get("detail") # type: ignore
|
||||
invalid_params: List[str] = []
|
||||
if (
|
||||
isinstance(detail, List)
|
||||
and len(detail) > 0
|
||||
|
@ -1227,9 +1227,9 @@ class OpenAIChatCompletion(BaseLLM):
|
|||
except openai.UnprocessableEntityError as e:
|
||||
## check if body contains unprocessable params - related issue https://github.com/BerriAI/litellm/issues/4800
|
||||
if litellm.drop_params is True or drop_params is True:
|
||||
invalid_params: List[str] = []
|
||||
if e.body is not None and isinstance(e.body, dict) and e.body.get("detail"): # type: ignore
|
||||
detail = e.body.get("detail") # type: ignore
|
||||
invalid_params: List[str] = []
|
||||
if (
|
||||
isinstance(detail, List)
|
||||
and len(detail) > 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue