Skip to content

Commit

Permalink
Fix issue with missing implicit operator in System.ClientModel (#834)
Browse files Browse the repository at this point in the history
* Fix issue with missing implicit operator in System.ClientModel -
#833
* Upgrade dependencies: Azure, SK, DI, etc.
* Remove explicit reference to System.Text.Json nuget, the package is
used only by other libs
  • Loading branch information
dluc authored Oct 14, 2024
1 parent edcc5cc commit 3e13e37
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 32 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,7 @@ dotnet_diagnostic.CA1034.severity = none # Do not nest type. Alternatively, chan
dotnet_diagnostic.CA1054.severity = none # URI parameters should not be strings
dotnet_diagnostic.CA1062.severity = none # Disable null check, C# already does it for us
dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member
dotnet_diagnostic.CS8002.severity = none # Referenced assembly does not have a strong name.
dotnet_diagnostic.CA1805.severity = none # Member is explicitly initialized to its default value
dotnet_diagnostic.CA1822.severity = none # Member does not access instance data and can be marked as static
dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project>
<PropertyGroup>
<!-- Central version prefix - applies to all nuget packages. -->
<Version>0.78.0</Version>
<Version>0.79.0</Version>

<!-- C# lang version, https://learn.microsoft.com/dotnet/csharp/whats-new -->
<LangVersion>12</LangVersion>
Expand Down
43 changes: 21 additions & 22 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="8.2.1" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.404.3" />
<PackageVersion Include="AWSSDK.S3" Version="3.7.404.5" />
<PackageVersion Include="Azure.AI.FormRecognizer" Version="4.1.0" />
<PackageVersion Include="Azure.Core" Version="1.44.0" />
<PackageVersion Include="Azure.Core" Version="1.44.1" />
<PackageVersion Include="Azure.Extensions.AspNetCore.Configuration.Secrets" Version="1.3.2" />
<PackageVersion Include="Azure.Identity" Version="1.12.1" />
<PackageVersion Include="Azure.Search.Documents" Version="11.6.0" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.22.1" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.20.0" />
<PackageVersion Include="Azure.Storage.Blobs" Version="12.22.2" />
<PackageVersion Include="Azure.Storage.Queues" Version="12.20.1" />
<PackageVersion Include="ClosedXML" Version="0.104.1" />
<PackageVersion Include="Elastic.Clients.Elasticsearch" Version="8.12.1" />
<PackageVersion Include="Discord.Net" Version="3.16.0" />
Expand All @@ -26,23 +26,23 @@
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="8.0.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="5.2.2" />
<PackageVersion Include="Microsoft.Extensions.Configuration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="7.3.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.AzureAppConfiguration" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Hosting.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Http" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageVersion Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageVersion Include="Microsoft.ML.OnnxRuntimeGenAI" Version="0.4.0" />
<PackageVersion Include="Microsoft.ML.Tokenizers" Version="0.22.0-preview.24378.1" />
<PackageVersion Include="Microsoft.KernelMemory.Core" Version="0.78.241007.1" />
<PackageVersion Include="Microsoft.KernelMemory.Service.AspNetCore" Version="0.78.241007.1" />
<PackageVersion Include="MongoDB.Driver.GridFS" Version="2.29.0" />
<PackageVersion Include="Moq" Version="4.20.72" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="OllamaSharp" Version="3.0.10" />
<PackageVersion Include="OllamaSharp" Version="3.0.12" />
<PackageVersion Include="PdfPig" Version="0.1.9" />
<PackageVersion Include="Pgvector" Version="0.3.0" />
<PackageVersion Include="Polly.Core" Version="8.4.2" />
Expand All @@ -51,16 +51,15 @@
<PackageVersion Include="ReadLine" Version="2.0.1" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="6.8.1" />
<PackageVersion Include="System.Linq.Async" Version="6.0.1" />
<PackageVersion Include="System.Memory.Data" Version="8.0.0" />
<PackageVersion Include="System.Memory.Data" Version="8.0.1" />
<PackageVersion Include="System.Numerics.Tensors" Version="8.0.0" />
<PackageVersion Include="System.Text.Json" Version="8.0.4" />
</ItemGroup>
<!-- Semantic Kernel -->
<ItemGroup>
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.21.1" />
<PackageVersion Include="Microsoft.SemanticKernel.Abstractions" Version="1.21.1" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.21.1" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.AzureOpenAI" Version="1.21.1" />
<PackageVersion Include="Microsoft.SemanticKernel" Version="1.22.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Abstractions" Version="1.22.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.OpenAI" Version="1.22.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.AzureOpenAI" Version="1.22.0" />
</ItemGroup>
<!-- Documentation -->
<ItemGroup>
Expand All @@ -81,11 +80,11 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.7">
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.12.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.7">
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.12.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
Expand All @@ -104,7 +103,7 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageVersion>
<PackageVersion Include="Xunit.DependencyInjection" Version="9.4.0" />
<PackageVersion Include="Xunit.DependencyInjection" Version="9.5.0" />
<PackageVersion Include="Xunit.DependencyInjection.Logging" Version="9.0.0" />
</ItemGroup>
</Project>
6 changes: 3 additions & 3 deletions extensions/AzureOpenAI/Internals/AzureOpenAIClientBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Net.Http;
using Azure;
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Extensions.Logging;
Expand All @@ -26,7 +26,7 @@ internal static AzureOpenAIClient Build(
AzureOpenAIClientOptions options = new()
{
RetryPolicy = new ClientSequentialRetryPolicy(maxRetries: Math.Max(0, config.MaxRetries), loggerFactory),
ApplicationId = Telemetry.HttpUserAgent,
UserAgentApplicationId = Telemetry.HttpUserAgent,
};

if (httpClient is not null)
Expand All @@ -48,7 +48,7 @@ internal static AzureOpenAIClient Build(
throw new ConfigurationException($"Azure OpenAI: {config.APIKey} is empty");
}

return new AzureOpenAIClient(new Uri(config.Endpoint), new AzureKeyCredential(config.APIKey), options);
return new AzureOpenAIClient(new Uri(config.Endpoint), new ApiKeyCredential(config.APIKey), options);

default:
throw new ConfigurationException($"Azure OpenAI: authentication type '{config.Auth:G}' is not supported");
Expand Down
2 changes: 1 addition & 1 deletion extensions/Ollama/Ollama/Ollama.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<RollForward>LatestMajor</RollForward>
<AssemblyName>Microsoft.KernelMemory.AI.Ollama</AssemblyName>
<RootNamespace>Microsoft.KernelMemory.AI.Ollama</RootNamespace>
<NoWarn>$(NoWarn);KMEXP00;KMEXP01;CA1724;</NoWarn>
<NoWarn>$(NoWarn);KMEXP00;KMEXP01;CA1724;CS8002;</NoWarn>
</PropertyGroup>

<PropertyGroup>
Expand Down
5 changes: 3 additions & 2 deletions extensions/OpenAI/OpenAI/Internals/OpenAIClientBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.ClientModel;
using System.ClientModel.Primitives;
using System.Net.Http;
using Microsoft.Extensions.Logging;
Expand All @@ -19,7 +20,7 @@ internal static OpenAIClient Build(
OpenAIClientOptions options = new()
{
RetryPolicy = new ClientSequentialRetryPolicy(maxRetries: Math.Max(0, config.MaxRetries), loggerFactory),
ApplicationId = Telemetry.HttpUserAgent,
UserAgentApplicationId = Telemetry.HttpUserAgent,
};

if (httpClient is not null)
Expand All @@ -34,6 +35,6 @@ internal static OpenAIClient Build(
options.AddPolicy(new ChangeEndpointPolicy(config.Endpoint), PipelinePosition.PerTry);
}

return new OpenAIClient(config.APIKey, options);
return new OpenAIClient(new ApiKeyCredential(config.APIKey), options);
}
}
1 change: 0 additions & 1 deletion service/Abstractions/Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" />
<PackageReference Include="System.Memory.Data" />
<PackageReference Include="System.Numerics.Tensors" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion service/Service.AspNetCore/Service.AspNetCore.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RollForward>LatestMajor</RollForward>
<AssemblyName>Microsoft.KernelMemory.Service.AspNetCore</AssemblyName>
<RootNamespace>Microsoft.KernelMemory.Service.AspNetCore</RootNamespace>
<NoWarn>$(NoWarn);CA1031;CA2254;</NoWarn>
<NoWarn>$(NoWarn);CA1031;CA2254;CS8002;</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion service/Service/Service.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>Microsoft.KernelMemory.Service</RootNamespace>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);CA2007;CA1724;CA2254;CA1031;CA1861;CA1303;SKEXP0001;</NoWarn>
<NoWarn>$(NoWarn);CA2007;CA1724;CA2254;CA1031;CA1861;CA1303;SKEXP0001;CS8002;</NoWarn>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 3e13e37

Please sign in to comment.