Merge pull request #2192 from NousResearch/hermes/hermes-3d7c23c9
fix(acp): preserve leading whitespace in streaming chunks
This commit is contained in:
commit
1aa7027be1
1 changed files with 2 additions and 2 deletions
|
|
@ -356,7 +356,7 @@ class CopilotACPClient:
|
||||||
text_parts=text_parts,
|
text_parts=text_parts,
|
||||||
reasoning_parts=reasoning_parts,
|
reasoning_parts=reasoning_parts,
|
||||||
)
|
)
|
||||||
return "".join(text_parts).strip(), "".join(reasoning_parts).strip()
|
return "".join(text_parts), "".join(reasoning_parts)
|
||||||
finally:
|
finally:
|
||||||
self.close()
|
self.close()
|
||||||
|
|
||||||
|
|
@ -380,7 +380,7 @@ class CopilotACPClient:
|
||||||
content = update.get("content") or {}
|
content = update.get("content") or {}
|
||||||
chunk_text = ""
|
chunk_text = ""
|
||||||
if isinstance(content, dict):
|
if isinstance(content, dict):
|
||||||
chunk_text = str(content.get("text") or "").strip()
|
chunk_text = str(content.get("text") or "")
|
||||||
if kind == "agent_message_chunk" and chunk_text and text_parts is not None:
|
if kind == "agent_message_chunk" and chunk_text and text_parts is not None:
|
||||||
text_parts.append(chunk_text)
|
text_parts.append(chunk_text)
|
||||||
elif kind == "agent_thought_chunk" and chunk_text and reasoning_parts is not None:
|
elif kind == "agent_thought_chunk" and chunk_text and reasoning_parts is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue