Skip to content

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

Open
@nmhjklnm

Description

@nmhjklnm

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.

Activity

logan-markewich

logan-markewich commented on Nov 14, 2024

@logan-markewich
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

logan-markewich commented on Nov 14, 2024

@logan-markewich
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

logan-markewich commented on Nov 14, 2024

@logan-markewich
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    • Status

      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

      Participants

      @masci@logan-markewich@nmhjklnm

      Issue actions

        Seeking Workflow Modification for Real-Time Asynchronous Output in Llama Deploy Example · Issue #366 · run-llama/llama_deploy