Skip to content

Commit 0db3caa

Browse files
authored
Explicitly reference System.Memory.Data in OpenAI/AzureAIInference projects (#5576)
To ensure a recent version is used.
1 parent e0c951d commit 0db3caa

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

src/Libraries/Microsoft.Extensions.AI.AzureAIInference/Microsoft.Extensions.AI.AzureAIInference.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
<ItemGroup>
2929
<PackageReference Include="Azure.AI.Inference" />
3030
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
31+
<PackageReference Include="System.Memory.Data" />
3132
<PackageReference Include="System.Text.Json" />
3233
</ItemGroup>
3334

src/Libraries/Microsoft.Extensions.AI.OpenAI/Microsoft.Extensions.AI.OpenAI.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
<ItemGroup>
2727
<PackageReference Include="OpenAI" />
28+
<PackageReference Include="System.Memory.Data" />
2829
<PackageReference Include="System.Text.Json" />
2930
</ItemGroup>
3031

src/Libraries/Microsoft.Extensions.AI.OpenAI/OpenAIChatClient.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,7 @@ public async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAs
267267

268268
existing.CallId ??= toolCallUpdate.ToolCallId;
269269
existing.Name ??= toolCallUpdate.FunctionName;
270-
if (toolCallUpdate.FunctionArgumentsUpdate is { } update &&
271-
!update.ToMemory().IsEmpty) // workaround for https://github.com/dotnet/runtime/issues/68262 in 6.0.0 package
270+
if (toolCallUpdate.FunctionArgumentsUpdate is { } update && !update.ToMemory().IsEmpty)
272271
{
273272
_ = (existing.Arguments ??= new()).Append(update.ToString());
274273
}

0 commit comments

Comments
 (0)