From ab153c3e8dab6be093eba3726ada19da176ee8cc Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Fri, 27 Sep 2024 08:17:36 -0700 Subject: [PATCH] handle streaming for azure ai studio error --- litellm/llms/OpenAI/openai.py | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/litellm/llms/OpenAI/openai.py b/litellm/llms/OpenAI/openai.py index fb78ee026..e0ab26b98 100644 --- a/litellm/llms/OpenAI/openai.py +++ b/litellm/llms/OpenAI/openai.py @@ -1069,27 +1069,7 @@ 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 - if ( - isinstance(detail, List) - and len(detail) > 0 - and isinstance(detail[0], dict) - ): - for error_dict in detail: - if ( - error_dict.get("loc") - and isinstance(error_dict.get("loc"), list) - and len(error_dict.get("loc")) == 2 - ): - invalid_params.append(error_dict["loc"][1]) - - new_data = {} - for k, v in data.items(): - if k not in invalid_params: - new_data[k] = v - data = new_data + data = drop_params_from_unprocessable_entity_error(e, data) else: raise e except (