You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The common way to read from Bedrock ConverseStreamResponse is apparently to call response.Stread.AsEnumerable(). This achieves the goal of streaming the response completions as they are received, but at the cost of keeping the calling .NET thread busy. So it can lead to thread exhaustion.
Ideally we need a new variant that does not block the thread, so maybe an async enumerator exposed as response.Stread.AsAsyncEnumerable().
Regression Issue
Select this option if this issue appears to be a regression.
Expected Behavior
I expect to have an easy method that gives an IAsyncEnumerable from ConverseStreamResponse, and which is implemented without blocking the calling thread.
Current Behavior
The current API surface in ConverseStreamResponse encourages the use of response.Stread.AsEnumerable() which blocks the calling thread.
Reproduction Steps
N/A
Possible Solution
This problem was mentioned in #3360 (comment) for a further improvement, with a suggested implementation. I believe the suggested implementation is imperfect, but it can be a basis for a solution.