Skip to content
Snippets Groups Projects
Unverified Commit 01823687 authored by Huu Le's avatar Huu Le Committed by GitHub
Browse files

Fix: UI streaming issue (#391)

parent ff46bd61
No related branches found
No related tags found
No related merge requests found
---
"create-llama": patch
---
Fix the streaming issue to prevent the UI from hanging.
...@@ -238,7 +238,9 @@ class BlogPostWorkflow(Workflow): ...@@ -238,7 +238,9 @@ class BlogPostWorkflow(Workflow):
publisher: FunctionCallingAgent, publisher: FunctionCallingAgent,
) -> StopEvent: ) -> StopEvent:
try: try:
result: AgentRunResult = await self.run_agent(ctx, publisher, ev.input) result: AgentRunResult = await self.run_agent(
ctx, publisher, ev.input, streaming=ctx.data["streaming"]
)
return StopEvent(result=result) return StopEvent(result=result)
except Exception as e: except Exception as e:
ctx.write_event_to_stream( ctx.write_event_to_stream(
......
...@@ -148,7 +148,9 @@ class FinancialReportWorkflow(Workflow): ...@@ -148,7 +148,9 @@ class FinancialReportWorkflow(Workflow):
self, ctx: Context, ev: ReportEvent, reporter: FunctionCallingAgent self, ctx: Context, ev: ReportEvent, reporter: FunctionCallingAgent
) -> StopEvent: ) -> StopEvent:
try: try:
result: AgentRunResult = await self.run_agent(ctx, reporter, ev.input) result: AgentRunResult = await self.run_agent(
ctx, reporter, ev.input, streaming=ctx.data["streaming"]
)
return StopEvent(result=result) return StopEvent(result=result)
except Exception as e: except Exception as e:
ctx.write_event_to_stream( ctx.write_event_to_stream(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment