Skip to content
Discussion options

You must be logged in to vote

This turns out to be an issue in the code. On the client side, you need to send a streaming message request to initiate reading the SSE feed, and on the server side the code needs to be async all the way in order for the event loop to be available to send an update. Corrected code looks like this on the server side:

streaming_result = await async_call_llm_streaming(query) # This method blocked the event loop in my original code

async for event in streaming_result:
    text = event.get("content")

    message = TaskArtifactUpdateEvent(
        context_id=context.context_id,  # type: ignore
        task_id=context.task_id,  # type: ignore
        artifact=new_text_artifact(name="current_re…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@yasharhon
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by yasharhon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants