mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 04:31:02 +02:00
Fixed streaming tests in integration for agent fw
This commit is contained in:
parent
fd19c55be6
commit
2c8cd8e07f
1 changed files with 14 additions and 3 deletions
|
|
@ -36,9 +36,20 @@ Args: {
|
||||||
}"""
|
}"""
|
||||||
|
|
||||||
if streaming and chunk_callback:
|
if streaming and chunk_callback:
|
||||||
# TEMPORARY: Send as single chunk to verify streaming path works
|
# Send chunks that avoid parser state bug
|
||||||
# TODO: Investigate why line-by-line chunking causes parser to extract empty action name
|
# Parser bug: if "Args:" starts a new chunk while in ACTION state,
|
||||||
await chunk_callback(full_text)
|
# it overwrites action_buffer with empty string (line_buffer[:0])
|
||||||
|
# Solution: Keep "Action:" line and "Args:" together in same chunk
|
||||||
|
chunks = [
|
||||||
|
"Thought: I need to search for information about machine learning.\n",
|
||||||
|
"Action: knowledge_query\nArgs: {\n", # Keep Action and Args together!
|
||||||
|
' "question": "What is machine learning?"\n',
|
||||||
|
"}"
|
||||||
|
]
|
||||||
|
|
||||||
|
for chunk in chunks:
|
||||||
|
await chunk_callback(chunk)
|
||||||
|
|
||||||
return full_text
|
return full_text
|
||||||
else:
|
else:
|
||||||
# Non-streaming response - same text
|
# Non-streaming response - same text
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue