You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm building a RAG pipeline with Haystack, where I want OpenAIGenerator to generate the reply, and serve the pipeline in a FastAPI endpoint.
The struggle is, Haystack's way of streaming is the OpenAIGenerator component accepts a streaming callback function (via streaming_callback argument when initiate the Generator component). The examples in documentation shows using 'print' function to print the response chunk, which is not what I want (send the response chunk back to client side via FastAPI's StreamingResponse).
The question is, how do I do that?
Hope the question is clear enough.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm building a RAG pipeline with Haystack, where I want OpenAIGenerator to generate the reply, and serve the pipeline in a FastAPI endpoint.
The struggle is, Haystack's way of streaming is the OpenAIGenerator component accepts a streaming callback function (via streaming_callback argument when initiate the Generator component). The examples in documentation shows using 'print' function to print the response chunk, which is not what I want (send the response chunk back to client side via FastAPI's StreamingResponse).
The question is, how do I do that?
Hope the question is clear enough.
Beta Was this translation helpful? Give feedback.
All reactions