[RL][TITO] Preserve whitespace in reasoning parser outputs (#24251)

This commit is contained in:
Yuzhen Zhou
2026-05-20 19:45:09 +00:00
committed by GitHub
parent 801d7e3eed
commit dac78768f0
4 changed files with 70 additions and 7 deletions
@@ -216,7 +216,7 @@ class DeepSeekV32Detector(BaseFormatDetector):
:return: ParseResult indicating success or failure, consumed text, leftover text, and parsed calls.
"""
idx = text.find(self.bot_token)
normal_text = text[:idx].strip() if idx != -1 else text
normal_text = text[:idx].removesuffix("\n\n") if idx != -1 else text
if self.bot_token not in text:
return StreamingParseResult(normal_text=normal_text, calls=[])