I’m working on a serverless function in my Redwood app to stream the output of ChatGPT to the client. OpenAI is using server-sent events (SSE) to stream from their API, and I would like to do the same from my Redwood server.
It looks like AWS started supporting streaming responses from Lambda functions earlier this year (Introducing AWS Lambda response streaming | AWS Compute Blog) but I am not sure if Redwood already supports this functionality. AWS seems to provide a global “streamifyResponse” helper that isn’t available locally, and I am not hosting my Redwood app on AWS anyway, so I don’t want to venture into AWS-specific ways to do this.
Is anyone using Redwood with streaming HTTP responses? I’m curious if there is already a “Redwood way” to do so.