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

No Streaming Response for Application Load Balancer + Lambda (Fastapi : server sent event -> streaming response) #341

Open
GxWwT opened this issue Nov 27, 2024 · 0 comments

Comments

@GxWwT
Copy link

GxWwT commented Nov 27, 2024

from fastapi.responses import StreamingResponse

if chat_request.stream:
    return StreamingResponse(
        content=model.chat_stream(chat_request), media_type="text/event-stream"
    )

This approach, when redirected to ALB through Mangum, loses the streaming response. Instead, all chunks are printed out all at once.

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

1 participant