Skip to content

Commit 4dbf241

Browse files
authored
.Net: Some random minor cleanup (microsoft#4161)
- Found and fixed stray occurrences of "SK" => "Kernel" (e.g. "ISKFunction" in comments or traced messages. - Cleaned up a little tracing code inside KernelFunctionFromMethod. - Consistently handle case of CreateLogger returning null. While it's not supposed to, a custom logger could, and we should handle that gracefully. - Disable CA1508 (avoid dead conditional code). There are too many false positives.
1 parent 563e180 commit 4dbf241

File tree

46 files changed

+138
-106
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+138
-106
lines changed

.editorconfig

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ dotnet_diagnostic.CA1032.severity = none # We're using RCS1194 which seems to co
158158
dotnet_diagnostic.CA1034.severity = none # Do not nest type. Alternatively, change its accessibility so that it is not externally visible
159159
dotnet_diagnostic.CA1062.severity = none # Disable null check, C# already does it for us
160160
dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters
161+
dotnet_diagnostic.CA1508.severity = none # Avoid dead conditional code. Too many false positives.
161162
dotnet_diagnostic.CA1510.severity = none
162163
dotnet_diagnostic.CA1805.severity = none # Member is explicitly initialized to its default value
163164
dotnet_diagnostic.CA1822.severity = none # Member does not access instance data and can be marked as static

dotnet/samples/KernelSyntaxExamples/Example16_CustomLLM.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ public static class Example16_CustomLLM
2828
{
2929
public static async Task RunAsync()
3030
{
31-
await CustomTextGenerationWithSKFunctionAsync();
31+
await CustomTextGenerationWithKernelFunctionAsync();
3232
await CustomTextGenerationAsync();
3333
await CustomTextGenerationStreamAsync();
3434
}
3535

36-
private static async Task CustomTextGenerationWithSKFunctionAsync()
36+
private static async Task CustomTextGenerationWithKernelFunctionAsync()
3737
{
38-
Console.WriteLine("\n======== Custom LLM - Text Completion - SKFunction ========");
38+
Console.WriteLine("\n======== Custom LLM - Text Completion - KernelFunction ========");
3939

4040
IKernelBuilder builder = Kernel.CreateBuilder();
4141
// Add your text generation service as a singleton instance

dotnet/src/Connectors/Connectors.Memory.Chroma/ChromaClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public ChromaClient(string endpoint, ILoggerFactory? loggerFactory = null)
3333

3434
this._httpClient = HttpClientProvider.GetHttpClient();
3535
this._endpoint = endpoint;
36-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(ChromaClient)) : NullLogger.Instance;
36+
this._logger = loggerFactory?.CreateLogger(typeof(ChromaClient)) ?? NullLogger.Instance;
3737
}
3838

3939
/// <summary>
@@ -52,7 +52,7 @@ public ChromaClient(HttpClient httpClient, string? endpoint = null, ILoggerFacto
5252

5353
this._httpClient = httpClient;
5454
this._endpoint = endpoint;
55-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(ChromaClient)) : NullLogger.Instance;
55+
this._logger = loggerFactory?.CreateLogger(typeof(ChromaClient)) ?? NullLogger.Instance;
5656
}
5757

5858
/// <inheritdoc />

dotnet/src/Connectors/Connectors.Memory.Chroma/ChromaMemoryStore.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ChromaMemoryStore(HttpClient httpClient, string? endpoint = null, ILogger
5151
public ChromaMemoryStore(IChromaClient client, ILoggerFactory? loggerFactory = null)
5252
{
5353
this._chromaClient = client;
54-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(ChromaMemoryStore)) : NullLogger.Instance;
54+
this._logger = loggerFactory?.CreateLogger(typeof(ChromaMemoryStore)) ?? NullLogger.Instance;
5555
}
5656

5757
/// <inheritdoc />

dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeClient.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public PineconeClient(string pineconeEnvironment, string apiKey, ILoggerFactory?
3333
this._pineconeEnvironment = pineconeEnvironment;
3434
this._authHeader = new KeyValuePair<string, string>("Api-Key", apiKey);
3535
this._jsonSerializerOptions = PineconeUtils.DefaultSerializerOptions;
36-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(PineconeClient)) : NullLogger.Instance;
36+
this._logger = loggerFactory?.CreateLogger(typeof(PineconeClient)) ?? NullLogger.Instance;
3737
this._httpClient = HttpClientProvider.GetHttpClient(httpClient);
3838
this._indexHostMapping = new ConcurrentDictionary<string, string>();
3939
}

dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeMemoryStore.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public PineconeMemoryStore(
3535
ILoggerFactory? loggerFactory = null)
3636
{
3737
this._pineconeClient = pineconeClient;
38-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(PineconeMemoryStore)) : NullLogger.Instance;
38+
this._logger = loggerFactory?.CreateLogger(typeof(PineconeMemoryStore)) ?? NullLogger.Instance;
3939
}
4040

4141
/// <summary>
@@ -50,7 +50,7 @@ public PineconeMemoryStore(
5050
ILoggerFactory? loggerFactory = null)
5151
{
5252
this._pineconeClient = new PineconeClient(pineconeEnvironment, apiKey, loggerFactory);
53-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(PineconeMemoryStore)) : NullLogger.Instance;
53+
this._logger = loggerFactory?.CreateLogger(typeof(PineconeMemoryStore)) ?? NullLogger.Instance;
5454
}
5555

5656
/// <inheritdoc/>

dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantMemoryStore.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public class QdrantMemoryStore : IMemoryStore
3636
public QdrantMemoryStore(string endpoint, int vectorSize, ILoggerFactory? loggerFactory = null)
3737
{
3838
this._qdrantClient = new QdrantVectorDbClient(endpoint, vectorSize, loggerFactory);
39-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(QdrantMemoryStore)) : NullLogger.Instance;
39+
this._logger = loggerFactory?.CreateLogger(typeof(QdrantMemoryStore)) ?? NullLogger.Instance;
4040
}
4141

4242
/// <summary>
@@ -49,7 +49,7 @@ public QdrantMemoryStore(string endpoint, int vectorSize, ILoggerFactory? logger
4949
public QdrantMemoryStore(HttpClient httpClient, int vectorSize, string? endpoint = null, ILoggerFactory? loggerFactory = null)
5050
{
5151
this._qdrantClient = new QdrantVectorDbClient(httpClient, vectorSize, endpoint, loggerFactory);
52-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(QdrantMemoryStore)) : NullLogger.Instance;
52+
this._logger = loggerFactory?.CreateLogger(typeof(QdrantMemoryStore)) ?? NullLogger.Instance;
5353
}
5454

5555
/// <summary>
@@ -60,7 +60,7 @@ public QdrantMemoryStore(HttpClient httpClient, int vectorSize, string? endpoint
6060
public QdrantMemoryStore(IQdrantVectorDbClient client, ILoggerFactory? loggerFactory = null)
6161
{
6262
this._qdrantClient = client;
63-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(QdrantMemoryStore)) : NullLogger.Instance;
63+
this._logger = loggerFactory?.CreateLogger(typeof(QdrantMemoryStore)) ?? NullLogger.Instance;
6464
}
6565

6666
/// <inheritdoc/>

dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorDbClient.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public QdrantVectorDbClient(
3737
this._vectorSize = vectorSize;
3838
this._httpClient = HttpClientProvider.GetHttpClient();
3939
this._httpClient.BaseAddress = SanitizeEndpoint(endpoint);
40-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(QdrantVectorDbClient)) : NullLogger.Instance;
40+
this._logger = loggerFactory?.CreateLogger(typeof(QdrantVectorDbClient)) ?? NullLogger.Instance;
4141
}
4242

4343
/// <summary>
@@ -61,7 +61,7 @@ public QdrantVectorDbClient(
6161
this._httpClient = httpClient;
6262
this._vectorSize = vectorSize;
6363
this._endpointOverride = string.IsNullOrEmpty(endpoint) ? null : SanitizeEndpoint(endpoint!);
64-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(QdrantVectorDbClient)) : NullLogger.Instance;
64+
this._logger = loggerFactory?.CreateLogger(typeof(QdrantVectorDbClient)) ?? NullLogger.Instance;
6565
}
6666

6767
/// <inheritdoc/>

dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateMemoryStore.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public WeaviateMemoryStore(
7474
this._endpoint = new Uri(endpoint);
7575
this._apiKey = apiKey;
7676
this._apiVersion = apiVersion;
77-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(WeaviateMemoryStore)) : NullLogger.Instance;
77+
this._logger = loggerFactory?.CreateLogger(typeof(WeaviateMemoryStore)) ?? NullLogger.Instance;
7878
this._httpClient = HttpClientProvider.GetHttpClient();
7979
}
8080

@@ -103,7 +103,7 @@ public WeaviateMemoryStore(
103103
this._apiKey = apiKey;
104104
this._apiVersion = apiVersion;
105105
this._endpoint = string.IsNullOrEmpty(endpoint) ? null : new Uri(endpoint);
106-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(WeaviateMemoryStore)) : NullLogger.Instance;
106+
this._logger = loggerFactory?.CreateLogger(typeof(WeaviateMemoryStore)) ?? NullLogger.Instance;
107107
this._httpClient = httpClient;
108108
}
109109

dotnet/src/Connectors/Connectors.OpenAI/ChatCompletionWithData/AzureOpenAIChatCompletionWithDataService.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public AzureOpenAIChatCompletionWithDataService(
4545
this._config = config;
4646

4747
this._httpClient = HttpClientProvider.GetHttpClient(httpClient);
48-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(this.GetType()) : NullLogger.Instance;
48+
this._logger = loggerFactory?.CreateLogger(this.GetType()) ?? NullLogger.Instance;
4949
this._attributes.Add(AIServiceExtensions.ModelIdKey, config.CompletionModelId);
5050
}
5151

dotnet/src/Connectors/Connectors.OpenAI/TextToImage/AzureOpenAITextToImageService.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Threading;
1010
using System.Threading.Tasks;
1111
using Microsoft.Extensions.Logging;
12+
using Microsoft.Extensions.Logging.Abstractions;
1213
using Microsoft.SemanticKernel.Http;
1314
using Microsoft.SemanticKernel.Services;
1415
using Microsoft.SemanticKernel.TextToImage;
@@ -84,7 +85,7 @@ public AzureOpenAITextToImageService(
8485
maxRetryCount ??= 5;
8586
apiVersion ??= "2023-06-01-preview";
8687

87-
this._core = new(httpClient, loggerFactory?.CreateLogger(typeof(AzureOpenAITextToImageService)));
88+
this._core = new(httpClient, loggerFactory?.CreateLogger(typeof(AzureOpenAITextToImageService)) ?? NullLogger.Instance);
8889

8990
this._endpoint = !string.IsNullOrEmpty(endpoint) ? endpoint! : httpClient!.BaseAddress!.AbsoluteUri;
9091
this._apiKey = apiKey;

dotnet/src/Experimental/Orchestration.Flow/Execution/FlowExecutor.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ internal FlowExecutor(IKernelBuilder kernelBuilder, IFlowStatusProvider statusPr
9999
this._kernelBuilder = kernelBuilder;
100100
this._systemKernel = kernelBuilder.Build();
101101

102-
this._logger = this._systemKernel.LoggerFactory.CreateLogger(typeof(FlowExecutor));
102+
this._logger = this._systemKernel.LoggerFactory.CreateLogger(typeof(FlowExecutor)) ?? NullLogger.Instance;
103103
this._config = config ?? new FlowOrchestratorConfig();
104104

105105
this._flowStatusProvider = statusProvider;

dotnet/src/Extensions/PromptTemplates.Handlebars/Helpers/KernelHelpers/KernelSystemHelpers.cs

+7-7
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ private static void RegisterSystemHelpers(
4343
{
4444
// TODO [@teresaqhoang]: Issue #3947 Isolate Handlebars Kernel System helpers in their own class
4545
// Should also consider standardizing the naming conventions for these helpers, i.e., 'Message' instead of 'message'
46-
handlebarsInstance.RegisterHelper("message", (writer, options, context, arguments) =>
46+
handlebarsInstance.RegisterHelper("message", static (writer, options, context, arguments) =>
4747
{
4848
var parameters = (IDictionary<string, object>)arguments[0];
4949

@@ -90,7 +90,7 @@ private static void RegisterSystemHelpers(
9090
return variables[arguments[0].ToString()];
9191
});
9292

93-
handlebarsInstance.RegisterHelper("json", (in HelperOptions options, in Context context, in Arguments arguments) =>
93+
handlebarsInstance.RegisterHelper("json", static (in HelperOptions options, in Context context, in Arguments arguments) =>
9494
{
9595
if (arguments.Length == 0 || arguments[0] is null)
9696
{
@@ -101,17 +101,17 @@ private static void RegisterSystemHelpers(
101101
return objectToSerialize.GetType() == typeof(string) ? objectToSerialize : JsonSerializer.Serialize(objectToSerialize);
102102
});
103103

104-
handlebarsInstance.RegisterHelper("concat", (in HelperOptions options, in Context context, in Arguments arguments) =>
104+
handlebarsInstance.RegisterHelper("concat", static (in HelperOptions options, in Context context, in Arguments arguments) =>
105105
{
106106
return string.Concat(arguments);
107107
});
108108

109-
handlebarsInstance.RegisterHelper("raw", (writer, options, context, arguments) =>
109+
handlebarsInstance.RegisterHelper("raw", static (writer, options, context, arguments) =>
110110
{
111111
options.Template(writer, null);
112112
});
113113

114-
handlebarsInstance.RegisterHelper("array", (in HelperOptions options, in Context context, in Arguments arguments) =>
114+
handlebarsInstance.RegisterHelper("array", static (in HelperOptions options, in Context context, in Arguments arguments) =>
115115
{
116116
return arguments.ToArray();
117117
});
@@ -126,12 +126,12 @@ private static void RegisterSystemHelpers(
126126
return Enumerable.Range(start, count);
127127
});
128128

129-
handlebarsInstance.RegisterHelper("or", (in HelperOptions options, in Context context, in Arguments arguments) =>
129+
handlebarsInstance.RegisterHelper("or", static (in HelperOptions options, in Context context, in Arguments arguments) =>
130130
{
131131
return arguments.Any(arg => arg != null && arg is not false);
132132
});
133133

134-
handlebarsInstance.RegisterHelper("equals", (in HelperOptions options, in Context context, in Arguments arguments) =>
134+
handlebarsInstance.RegisterHelper("equals", static (in HelperOptions options, in Context context, in Arguments arguments) =>
135135
{
136136
if (arguments.Length < 2)
137137
{

dotnet/src/Functions/Functions.Grpc/Extensions/GrpcKernelExtensions.cs

+14-5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Threading.Tasks;
1111
using Microsoft.Extensions.DependencyInjection;
1212
using Microsoft.Extensions.Logging;
13+
using Microsoft.Extensions.Logging.Abstractions;
1314
using Microsoft.SemanticKernel.Http;
1415
using Microsoft.SemanticKernel.Plugins.Grpc.Model;
1516
using Microsoft.SemanticKernel.Plugins.Grpc.Protobuf;
@@ -99,7 +100,11 @@ public static KernelPlugin CreatePluginFromGrpcDirectory(
99100
throw new FileNotFoundException($"No .proto document for the specified path - {filePath} is found.");
100101
}
101102

102-
kernel.LoggerFactory.CreateLogger(typeof(GrpcKernelExtensions)).LogTrace("Registering gRPC functions from {0} .proto document", filePath);
103+
if (kernel.LoggerFactory.CreateLogger(typeof(GrpcKernelExtensions)) is ILogger logger &&
104+
logger.IsEnabled(LogLevel.Trace))
105+
{
106+
logger.LogTrace("Registering gRPC functions from {0} .proto document", filePath);
107+
}
103108

104109
using var stream = File.OpenRead(filePath);
105110

@@ -123,7 +128,11 @@ public static KernelPlugin CreatePluginFromGrpcFile(
123128
throw new FileNotFoundException($"No .proto document for the specified path - {filePath} is found.");
124129
}
125130

126-
kernel.LoggerFactory.CreateLogger(typeof(GrpcKernelExtensions)).LogTrace("Registering gRPC functions from {0} .proto document", filePath);
131+
if (kernel.LoggerFactory.CreateLogger(typeof(GrpcKernelExtensions)) is ILogger logger &&
132+
logger.IsEnabled(LogLevel.Trace))
133+
{
134+
logger.LogTrace("Registering gRPC functions from {0} .proto document", filePath);
135+
}
127136

128137
using var stream = File.OpenRead(filePath);
129138

@@ -158,7 +167,7 @@ public static KernelPlugin CreatePluginFromGrpc(
158167

159168
var runner = new GrpcOperationRunner(client);
160169

161-
ILogger logger = loggerFactory.CreateLogger(typeof(GrpcKernelExtensions));
170+
ILogger logger = loggerFactory.CreateLogger(typeof(GrpcKernelExtensions)) ?? NullLogger.Instance;
162171
foreach (var operation in operations)
163172
{
164173
try
@@ -199,9 +208,9 @@ async Task<JsonObject> ExecuteAsync(KernelArguments arguments, CancellationToken
199208
{
200209
return await runner.RunAsync(operation, arguments, cancellationToken).ConfigureAwait(false);
201210
}
202-
catch (Exception ex) when (!ex.IsCriticalException())
211+
catch (Exception ex) when (!ex.IsCriticalException() && loggerFactory.CreateLogger(typeof(GrpcKernelExtensions)) is ILogger logger && logger.IsEnabled(LogLevel.Warning))
203212
{
204-
loggerFactory.CreateLogger(typeof(GrpcKernelExtensions)).LogWarning(ex, "Something went wrong while rendering the gRPC function. Function: {0}. Error: {1}", operation.Name, ex.Message);
213+
logger.LogWarning(ex, "Something went wrong while rendering the gRPC function. Function: {0}. Error: {1}", operation.Name, ex.Message);
205214
throw;
206215
}
207216
}

dotnet/src/Functions/Functions.OpenApi/Extensions/OpenApiKernelExtensions.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public static async Task<KernelPlugin> CreatePluginFromOpenApiAsync(
111111

112112
var openApiSpec = await DocumentLoader.LoadDocumentFromFilePathAsync(
113113
filePath,
114-
kernel.LoggerFactory.CreateLogger(typeof(OpenApiKernelExtensions)),
114+
kernel.LoggerFactory.CreateLogger(typeof(OpenApiKernelExtensions)) ?? NullLogger.Instance,
115115
cancellationToken).ConfigureAwait(false);
116116

117117
return await CreateOpenApiPluginAsync(
@@ -148,7 +148,7 @@ public static async Task<KernelPlugin> CreatePluginFromOpenApiAsync(
148148

149149
var openApiSpec = await DocumentLoader.LoadDocumentFromUriAsync(
150150
uri,
151-
kernel.LoggerFactory.CreateLogger(typeof(OpenApiKernelExtensions)),
151+
kernel.LoggerFactory.CreateLogger(typeof(OpenApiKernelExtensions)) ?? NullLogger.Instance,
152152
httpClient,
153153
executionParameters?.AuthCallback,
154154
executionParameters?.UserAgent,
@@ -229,7 +229,7 @@ private static async Task<KernelPlugin> CreateOpenApiPluginAsync(
229229
executionParameters?.EnablePayloadNamespacing ?? false);
230230

231231
var functions = new List<KernelFunction>();
232-
ILogger logger = loggerFactory.CreateLogger(typeof(OpenApiKernelExtensions));
232+
ILogger logger = loggerFactory.CreateLogger(typeof(OpenApiKernelExtensions)) ?? NullLogger.Instance;
233233
foreach (var operation in operations)
234234
{
235235
try
@@ -271,7 +271,7 @@ private static KernelFunction CreateRestApiFunction(
271271
executionParameters?.EnablePayloadNamespacing ?? false
272272
);
273273

274-
var logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(OpenApiKernelExtensions)) : NullLogger.Instance;
274+
var logger = loggerFactory?.CreateLogger(typeof(OpenApiKernelExtensions)) ?? NullLogger.Instance;
275275

276276
async Task<RestApiOperationResponse> ExecuteAsync(KernelArguments variables, CancellationToken cancellationToken)
277277
{

dotnet/src/Functions/Functions.OpenApi/OpenAI/KernelOpenAIPluginExtensions.cs

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
using System.Threading.Tasks;
1111
using Microsoft.Extensions.DependencyInjection;
1212
using Microsoft.Extensions.Logging;
13+
using Microsoft.Extensions.Logging.Abstractions;
1314
using Microsoft.SemanticKernel.Http;
1415

1516
namespace Microsoft.SemanticKernel.Plugins.OpenApi;
@@ -111,7 +112,7 @@ public static async Task<KernelPlugin> CreatePluginFromOpenAIAsync(
111112

112113
var openAIManifest = await DocumentLoader.LoadDocumentFromFilePathAsync(
113114
filePath,
114-
kernel.LoggerFactory.CreateLogger(typeof(OpenAIPluginKernelExtensions)),
115+
kernel.LoggerFactory.CreateLogger(typeof(OpenAIPluginKernelExtensions)) ?? NullLogger.Instance,
115116
cancellationToken).ConfigureAwait(false);
116117

117118
return await CreateAsync(
@@ -147,7 +148,7 @@ public static async Task<KernelPlugin> CreatePluginFromOpenAIAsync(
147148

148149
var openAIManifest = await DocumentLoader.LoadDocumentFromUriAsync(
149150
uri,
150-
kernel.LoggerFactory.CreateLogger(typeof(OpenAIPluginKernelExtensions)),
151+
kernel.LoggerFactory.CreateLogger(typeof(OpenAIPluginKernelExtensions)) ?? NullLogger.Instance,
151152
httpClient,
152153
null, // auth is not needed when loading the manifest
153154
executionParameters?.UserAgent,

dotnet/src/Functions/Functions.OpenApi/OpenApi/OpenApiDocumentParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ internal sealed class OpenApiDocumentParser : IOpenApiDocumentParser
3131
/// <param name="loggerFactory">The <see cref="ILoggerFactory"/> to use for logging. If null, no logging will be performed.</param>
3232
public OpenApiDocumentParser(ILoggerFactory? loggerFactory = null)
3333
{
34-
this._logger = loggerFactory is not null ? loggerFactory.CreateLogger(typeof(OpenApiDocumentParser)) : NullLogger.Instance;
34+
this._logger = loggerFactory?.CreateLogger(typeof(OpenApiDocumentParser)) ?? NullLogger.Instance;
3535
}
3636

3737
/// <inheritdoc/>

dotnet/src/InternalUtilities/planning/Extensions/ReadOnlyFunctionCollectionPlannerExtensions.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Microsoft.SemanticKernel.Planning;
1919
/// </summary>
2020
internal static class ReadOnlyPluginCollectionPlannerExtensions
2121
{
22-
internal const string PlannerMemoryCollectionName = "Planning.SKFunctionsManual";
22+
internal const string PlannerMemoryCollectionName = "Planning.KernelFunctionsManual";
2323

2424
/// <summary>
2525
/// Returns a function callback that can be used to retrieve a function from the function provider.

0 commit comments

Comments
 (0)