Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeking Workflow Modification for Real-Time Asynchronous Output in Llama Deploy Example #366

Open
nmhjklnm opened this issue Nov 14, 2024 · 4 comments
Labels
question Further information is requested

Comments

@nmhjklnm
Copy link

In the example provided at Llama Deploy Python Fullstack, the final output of the workflow is non-streaming. It only produces results once all generated tokens are complete.

As a result, I had to create my own FastAPI service.

Question:

Is there a more suitable modification to the workflow or llama-deploy that allows for direct and true asynchronous output without having to write my own FastAPI service?

Objective:

My main goal is to deliver the results of the workflow to users as quickly as possible.

@masci masci added this to Framework Nov 14, 2024
@logan-markewich
Copy link
Collaborator

You can definitely stream

If you use ctx.write_event_to_stream in your workflow, you can access these streamed events with the client

@logan-markewich
Copy link
Collaborator

Still working on proper docs, but if you are using the old client

session.get_task_result_stream()

async def get_task_result_stream(

Finding the example for the newer client...

@logan-markewich
Copy link
Collaborator

@logan-markewich
Copy link
Collaborator

Streaming outside of llama-deploy is slightly different

You still use the same ctx.write_event_to_stream method, but how you get the stream is different
https://docs.llamaindex.ai/en/stable/module_guides/workflow/#streaming-events

@masci masci added the question Further information is requested label Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Status: No status
Development

No branches or pull requests

3 participants