fix(responses): retain phase for structured output fold

Signed-off-by: Zhibo Zhang <24061721@hdu.edu.cn>
This commit is contained in:
Zhibo Zhang 2026-11-01 15:27:50 +08:00
parent 586cf654f9
commit 8a74845513

View file

@ -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]