From 86a3d24d75d28ca0777fb568b6f2e63436028b73 Mon Sep 17 00:00:00 2001 From: Krrish Dholakia Date: Thu, 25 Apr 2024 18:27:41 -0700 Subject: [PATCH] fix(utils.py): pass through 'response_format' for mistral --- litellm/utils.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/litellm/utils.py b/litellm/utils.py index 7fd4dc5dc6..8beb7c6d27 100644 --- a/litellm/utils.py +++ b/litellm/utils.py @@ -5265,7 +5265,8 @@ def get_optional_params( optional_params["tools"] = tools if tool_choice is not None: optional_params["tool_choice"] = tool_choice - + if response_format is not None: + optional_params["response_format"] = response_format # check safe_mode, random_seed: https://docs.mistral.ai/api/#operation/createChatCompletion safe_mode = passed_params.pop("safe_mode", None) random_seed = passed_params.pop("random_seed", None) @@ -5277,6 +5278,7 @@ def get_optional_params( optional_params["extra_body"] = ( extra_body # openai client supports `extra_body` param ) + elif custom_llm_provider == "groq": supported_params = get_supported_openai_params( model=model, custom_llm_provider=custom_llm_provider