fix: remove think text buffering for real-time reasoning stream (#15891)

Fix: remove think text buffering for real-time reasoning stream
This commit is contained in:
少卿
2026-06-10 16:55:57 +08:00
committed by GitHub
parent 3091d91cf7
commit 8e17a12990

View File

@@ -1464,12 +1464,7 @@ async def _stream_with_think_delta(stream_iter, min_tokens: int = 16):
if not text:
return None
if section == "think":
state.think_buffer += text
if num_tokens_from_string(state.think_buffer) >= min_tokens:
out = state.think_buffer
state.think_buffer = ""
return out
return None
return text
state.answer_buffer += text
if num_tokens_from_string(state.answer_buffer) >= min_tokens:
out = state.answer_buffer