mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-04-30 02:46:23 +02:00
Tweak flushing
This commit is contained in:
parent
f511b8db50
commit
a89005768b
1 changed files with 5 additions and 0 deletions
|
|
@ -161,6 +161,11 @@ def question(
|
||||||
# Output the chunk
|
# Output the chunk
|
||||||
if current_outputter:
|
if current_outputter:
|
||||||
current_outputter.output(content)
|
current_outputter.output(content)
|
||||||
|
# Flush word buffer after each chunk to avoid delay
|
||||||
|
if current_outputter.word_buffer:
|
||||||
|
print(current_outputter.word_buffer, end="", flush=True)
|
||||||
|
current_outputter.column += len(current_outputter.word_buffer)
|
||||||
|
current_outputter.word_buffer = ""
|
||||||
elif chunk_type == "final-answer":
|
elif chunk_type == "final-answer":
|
||||||
print(content, end="", flush=True)
|
print(content, end="", flush=True)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue