Skip to content

.Net: Bug: .NET Bedrock streaming completion is keeping the request thread busy #9519

@tlecomte

Description

@tlecomte

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:

Expected behavior
Replace .AsEnumerable() with something that would read the response stream in an async manner.

Screenshots
N/A

Platform

  • OS: all
  • IDE: N/A
  • Language: C#
  • Source: NuGet package version 1.26.0

Additional context

Metadata

Metadata

Assignees

Labels

.NETIssue or Pull requests regarding .NET codebugSomething isn't working

Type

No type

Projects

Status

Bug

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions