Skip to content

Commit

Permalink
Pass the message if coming from the __interrupt__ node
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowcap committed Dec 18, 2024
1 parent 2a48437 commit aca5bb4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions api.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def event_stream(query: str, thread_id: Optional[str]=None, query_type: Optional
raise ValueError(f"Invalid query type from frontend: {query_type}")

for namespace, chunk in stream:
# Avoid streaming duplicate output by skipping the
# messages without namespace.
if not namespace:
continue
node_name = list(chunk.keys())[0]
print(f"Namespace -> {namespace}")
print(f"Node name -> {node_name}")
# Avoid streaming duplicate output by skipping the
# messages without namespace.
if not namespace and not node_name == "__interrupt__":
continue

if node_name == "__interrupt__":
print(f"Waiting for human input")
Expand Down

0 comments on commit aca5bb4

Please sign in to comment.