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

run_with_streaming_response and automatically streaming buffered responses #967

Open
keichan34 opened this issue Mar 12, 2025 · 3 comments

Comments

@keichan34
Copy link

I know that right now, buffered responses will return an empty response when running with run_with_streaming_response (#805). Would it be possible (would PRs be accepted?) for some code that would intercept buffered responses and transform them to a dummy stream?

I'm currently doing this in my app because I'm sharing some error handling code between the buffered and streaming APIs, but I think it would make sense for something like this to live in the runtime. What do you think?

@bnusunny
Copy link
Contributor

I'm not quite understand your use case. Do you mind to share a sample code?

@keichan34
Copy link
Author

It's basically exactly what's in #805. I've broken up my APIs in to two Lambda functions -- one for buffered and one for streaming, and I want to reuse buffered handlers between the streaming and buffered APIs.

@bnusunny
Copy link
Contributor

bnusunny commented Mar 15, 2025

Got it! It will be useful to able to use response streaming mode to process both buffered and streaming functions. PR is welcome.

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