Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.Net: Add Async Support for ConverseStreamResponse to Avoid Thread Bl…
…ocking (#10159) ### Motivation and Context This change replaces the use of `response.Stream.AsEnumerable()` with `await foreach` for async streaming in the Amazon Bedrock SDK. The previous method blocked the calling thread, leading to potential thread exhaustion in high-concurrency scenarios. This update aligns with best practices for asynchronous operations in .NET. ### Description - Replaced blocking foreach with `await foreach` for streaming `ConverseStreamResponse` chunks asynchronously. - Upgraded Amazon Bedrock runtime and core SDKs to support this functionality. ### Contribution Checklist - [Y] The code builds clean without any errors or warnings - [Y] The PR follows the [SK Contribution Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md) and the [pre-submission formatting script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts) raises no violations - [Y] All unit tests pass, and I have added new tests where possible - [Y] I didn't break anyone 😄 Fixes #9519 --------- Co-authored-by: Adit Sheth <[email protected]>
- Loading branch information