From 0d3e6f4131d08b9b7d72b287d82cbff0ab185d06 Mon Sep 17 00:00:00 2001 From: Devis Lucato Date: Fri, 27 Sep 2024 13:43:00 -0700 Subject: [PATCH] Make SK text and embedding generator wrappers public (#808) Currently it's possible to inject Semantic Kernel classes into KM only using - IKernelMemoryBuilder.WithSemanticKernelTextGenerationService - IKernelMemoryBuilder.WithSemanticKernelTextEmbeddingGenerationService - IServiceCollection.AddSingleton(instance) - IServiceCollection.AddSingleton(instance) However, it's not possible to create an instance of Semantic Kernel classes directly without writing a custom wrapper class first. Since the project already includes such wrapper, as internal classes, this PR changes them to public classes, to reduce the amount of code to write. Classes: - SemanticKernelTextGenerator - SemanticKernelTextEmbeddingGenerator --- .../Core/SemanticKernel/SemanticKernelTextEmbeddingGenerator.cs | 2 +- service/Core/SemanticKernel/SemanticKernelTextGenerator.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/service/Core/SemanticKernel/SemanticKernelTextEmbeddingGenerator.cs b/service/Core/SemanticKernel/SemanticKernelTextEmbeddingGenerator.cs index 533f0e7d7..ea2ad4c46 100644 --- a/service/Core/SemanticKernel/SemanticKernelTextEmbeddingGenerator.cs +++ b/service/Core/SemanticKernel/SemanticKernelTextEmbeddingGenerator.cs @@ -12,7 +12,7 @@ namespace Microsoft.KernelMemory.SemanticKernel; -internal sealed class SemanticKernelTextEmbeddingGenerator : ITextEmbeddingGenerator +public sealed class SemanticKernelTextEmbeddingGenerator : ITextEmbeddingGenerator { private readonly ITextEmbeddingGenerationService _service; private readonly ITextTokenizer _tokenizer; diff --git a/service/Core/SemanticKernel/SemanticKernelTextGenerator.cs b/service/Core/SemanticKernel/SemanticKernelTextGenerator.cs index 3d1d48982..1054ed5d2 100644 --- a/service/Core/SemanticKernel/SemanticKernelTextGenerator.cs +++ b/service/Core/SemanticKernel/SemanticKernelTextGenerator.cs @@ -13,7 +13,7 @@ namespace Microsoft.KernelMemory.SemanticKernel; -internal sealed class SemanticKernelTextGenerator : ITextGenerator +public sealed class SemanticKernelTextGenerator : ITextGenerator { private readonly ITextGenerationService _service; private readonly ITextTokenizer _tokenizer;