diff --git a/litellm/llms/openai/chat/gpt_transformation.py b/litellm/llms/openai/chat/gpt_transformation.py index 19b681f7415..83a20128baa 100644 --- a/litellm/llms/openai/chat/gpt_transformation.py +++ b/litellm/llms/openai/chat/gpt_transformation.py @@ -793,7 +793,11 @@ class OpenAIGPTConfig(BaseLLMModelInfo, BaseConfig): json_mode_content_str: str | None = str(new_tool_calls[0]["function"].get("arguments", "")) or None if json_mode_content_str is not None: translated_message = Message(content=json_mode_content_str) - finish_reason = "stop" if choice["finish_reason"] in ("tool_calls", "function_call") else choice["finish_reason"] + finish_reason = ( + "stop" + if choice["finish_reason"] in ("tool_calls", "function_call") + else choice["finish_reason"] + ) if translated_message is None: ## get the reasoning content