mirror of
https://github.com/HKUDS/nanobot.git
synced 2026-06-25 12:13:58 +00:00
fix: stop leaking reasoning_content to stream output
The streaming path in OpenAICompatProvider.chat_stream() was passing reasoning_content deltas through on_content_delta(), causing model internal reasoning to be displayed to the user alongside the actual response content. reasoning_content is already collected separately in _parse_chunks() and stored in LLMResponse.reasoning_content for session history. It should never be forwarded to the user-facing stream.
This commit is contained in:
parent
2cecaf0d5d
commit
5479a44691
@ -671,9 +671,6 @@ class OpenAICompatProvider(LLMProvider):
|
|||||||
break
|
break
|
||||||
chunks.append(chunk)
|
chunks.append(chunk)
|
||||||
if on_content_delta and chunk.choices:
|
if on_content_delta and chunk.choices:
|
||||||
text = getattr(chunk.choices[0].delta, "reasoning_content", None)
|
|
||||||
if text:
|
|
||||||
await on_content_delta(text)
|
|
||||||
text = getattr(chunk.choices[0].delta, "content", None)
|
text = getattr(chunk.choices[0].delta, "content", None)
|
||||||
if text:
|
if text:
|
||||||
await on_content_delta(text)
|
await on_content_delta(text)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user