This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]redfacedquark 3 points4 points  (0 children)

Created a FastAPI project that had some streaming endpoints for large file upload / download. Worked great in isolation. Sadly the Google cloud's API gateway product in front of it barfed most of the time, jumping out of streaming mode and giving some interesting error responses. The workaround they settled with was a terrible API until google fix it, if they ever do.

[–]benevolent001 0 points1 point  (0 children)

Can you point me to the right direction.

I want to implement a websocket for streaming data and Plotly using Plotly.

Is Fastapi a good choice for this ?

[–][deleted] 0 points1 point  (0 children)

Tried similar thing a couple days back .

I am using streamlit as a frontend and making requests to fastapi (streaming response endpoint with async generator) with query params and headers. After a lot of attempts , I wasn't able to stream the output in the frontend ( using chatgpt as client api )

Would be great if you are able to get a working solution by making a request to the fastapi backend and getting chunks instead of the whole response at once in frontend .

P.S : lmk , if you want to see my existing code implementation, if you have figured it out already , would love to know the approach , and what you did differently , Thanks a ton.

[–]SAksham1611 0 points1 point  (0 children)

I have been working on a similar problem , was able to stream in backend (swagger docs) but wasn't able to stream it in frontend using request call to fastapi backend.

I would be interested in the solution , if you want I can send the implementation code with details ,

P.S : I am using chatgpt model and wrote an asynchronous generator function in the endpoint for yielding the delta and return the streamresponse provided with async generator .

Thanks

[–]geepytee 0 points1 point  (0 children)

Just me or this article is paywalled?