From 8a74845513c3cc0207b1af278ed4daabf0da87fc Mon Sep 17 00:00:00 2001 From: Zhibo Zhang Date: Sun, 1 Nov 2026 15:27:50 +0800 Subject: [PATCH] fix(responses): retain phase for structured output fold Signed-off-by: Zhibo Zhang <24061721@hdu.edu.cn> --- .../litellm_responses_transformation/transformation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/litellm/completion_extras/litellm_responses_transformation/transformation.py b/litellm/completion_extras/litellm_responses_transformation/transformation.py index 6001e6c2074..2781b060169 100644 --- a/litellm/completion_extras/litellm_responses_transformation/transformation.py +++ b/litellm/completion_extras/litellm_responses_transformation/transformation.py @@ -523,7 +523,7 @@ def _fold_choices_into_one( # A single Chat Completions message can carry one scalar phase. Preserve it # only when every folded Responses message has the same declared phase. message_phases: Final = tuple( - (message.provider_specific_fields or {}).get("phase") for message in messages + (message.provider_specific_fields or {}).get("phase") for message in content_messages ) shared_phase: Final = ( message_phases[0]