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

Stream endpoint doesn't work with GZipMiddleware #611

Open
kikohs opened this issue Apr 18, 2024 · 3 comments
Open

Stream endpoint doesn't work with GZipMiddleware #611

kikohs opened this issue Apr 18, 2024 · 3 comments

Comments

@kikohs
Copy link

kikohs commented Apr 18, 2024

I was struggling to understand why a RemoteRunnable.stream was not working from langchain JS in the browser

Disabling GZipMiddleware in FastAPI made it work again.
Not sure if it's a Starlette/Uvicorn issue or LangServe but might be useful to fix/report.

@eyurtsev
Copy link
Collaborator

tiangolo/fastapi#8448

@eyurtsev
Copy link
Collaborator

Does that sound like the same issue?

@kikohs
Copy link
Author

kikohs commented Apr 18, 2024

Not sure about the langserve underlying implementation. Here the streaming response is initiated in the browser correctly (with text/event-stream) from langchainJS, when the OpenAI API finishes, all the streaming events are returned.

Like if we were awaiting for the whole response and delivering at once (return instead of yield)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants