[Bugfix] Return None for empty reasoning_content outside K2 Horizon (#42962)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
492dbd0807
commit
1e86143bf0
@@ -2453,7 +2453,12 @@ class OpenAIServingChat(OpenAIServingBase):
|
||||
role="assistant",
|
||||
content=text if text else "",
|
||||
tool_calls=tool_calls,
|
||||
reasoning_content=reasoning_text,
|
||||
# Only K2 templates replay empty reasoning; other parsers report None.
|
||||
reasoning_content=(
|
||||
reasoning_text
|
||||
if reasoning_text or self.reasoning_parser == "k2_horizon"
|
||||
else None
|
||||
),
|
||||
),
|
||||
logprobs=choice_logprobs,
|
||||
finish_reason=finish_reason["type"] if finish_reason else None,
|
||||
|
||||
Reference in New Issue
Block a user