From 039f42516d1f2b43716129faeef76888a4aec642 Mon Sep 17 00:00:00 2001 From: Saylee Date: Mon, 12 Oct 2026 22:44:14 +0530 Subject: [PATCH] style(openai): wrap json_mode finish_reason ternary for ruff format Signed-off-by: Saylee --- litellm/llms/openai/chat/gpt_transformation.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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