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
Describe the bug
The current implementation of the Bedrock connector is using response.Stream.AsEnumerable() in BedrockChatCompletionClient.cs#L193, which is keeping the current .NET thread busy while it reads the response stream. This could cause thread exhaustion issues.
github-actionsbot
changed the title
Bug: .NET Bedrock streaming completion is keeping the request thread busy
.Net: Bug: .NET Bedrock streaming completion is keeping the request thread busy
Nov 4, 2024
I realize that, ideally, the AWS .NET SDK would provide a solution out of the box. So I've also created aws/aws-sdk-net#3542 and will suggest a solution there first.
Describe the bug
The current implementation of the Bedrock connector is using
response.Stream.AsEnumerable()
in BedrockChatCompletionClient.cs#L193, which is keeping the current .NET thread busy while it reads the response stream. This could cause thread exhaustion issues.To Reproduce
Steps to reproduce the behavior:
semantic-kernel/dotnet/src/Connectors/Connectors.Amazon/Bedrock/Core/Clients/BedrockChatCompletionClient.cs
Line 193 in f88cf5f
Expected behavior
Replace
.AsEnumerable()
with something that would read the response stream in an async manner.Screenshots
N/A
Platform
Additional context
The text was updated successfully, but these errors were encountered: