Skip to content

Commit

Permalink
Yiled json HIL in stream
Browse files Browse the repository at this point in the history
  • Loading branch information
WonderPG committed Jan 14, 2025
1 parent 151e028 commit 5ac20b8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/neuroagent/stream.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Wrapper around streaming methods to reinitiate connections due to the way fastAPI StreamingResponse works."""

import json
from typing import Any, AsyncIterator

from fastapi import Request
Expand Down Expand Up @@ -51,7 +52,7 @@ async def stream_agent_response(
yield chunk
# Final chunk that contains the whole response
elif chunk.hil_messages:
yield str(
yield json.dumps(
[hil_message.model_dump_json() for hil_message in chunk.hil_messages]
)

Expand Down

0 comments on commit 5ac20b8

Please sign in to comment.