Skip to content

Commit

Permalink
Explicitly reference System.Memory.Data in OpenAI/AzureAIInference pr…
Browse files Browse the repository at this point in the history
…ojects (#5576)

To ensure a recent version is used.
  • Loading branch information
stephentoub authored Oct 26, 2024
1 parent e0c951d commit 0db3caa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
<ItemGroup>
<PackageReference Include="Azure.AI.Inference" />
<PackageReference Include="Microsoft.Bcl.AsyncInterfaces" />
<PackageReference Include="System.Memory.Data" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

<ItemGroup>
<PackageReference Include="OpenAI" />
<PackageReference Include="System.Memory.Data" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,7 @@ public async IAsyncEnumerable<StreamingChatCompletionUpdate> CompleteStreamingAs

existing.CallId ??= toolCallUpdate.ToolCallId;
existing.Name ??= toolCallUpdate.FunctionName;
if (toolCallUpdate.FunctionArgumentsUpdate is { } update &&
!update.ToMemory().IsEmpty) // workaround for https://github.com/dotnet/runtime/issues/68262 in 6.0.0 package
if (toolCallUpdate.FunctionArgumentsUpdate is { } update && !update.ToMemory().IsEmpty)
{
_ = (existing.Arguments ??= new()).Append(update.ToString());
}
Expand Down

0 comments on commit 0db3caa

Please sign in to comment.