Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the exception __SK_DEFAULT #1264

Closed
Alerinos opened this issue May 29, 2023 · 2 comments
Closed

Change the exception __SK_DEFAULT #1264

Alerinos opened this issue May 29, 2023 · 2 comments
Assignees
Labels
bug Something isn't working kernel Issues or pull requests impacting the core kernel memory connector

Comments

@Alerinos
Copy link

If we add memory WithMemoryStorage to the build then an exception pops up Microsoft.SemanticKernel.KernelException: „Service not found: '__SK_DEFAULT' text embedding service not available”

Unfortunately we do not have documentation, so it is worth adding the information that we are missing in the config AddOpenAITextEmbeddingGenerationService. Alternatively, let's add documentation in the code next to this exception.

My code:

var kernel = new KernelBuilder()
            .WithLogger(CreateConsoleLogger())
            .Configure(config => {
                config.AddOpenAITextCompletionService("text-davinci-003", "xxx");
                })
            .WithMemoryStorage(new QdrantMemoryStore("xxx", 6333, 1536, CreateConsoleLogger()))
            .Build();

To bypass the exception it is sufficient to add a config which is missing from the documentation.

config.AddOpenAITextEmbeddingGenerationService("text-embedding-ada-002", "");

internal string DefaultServiceId => "__SK_DEFAULT";

@evchaki evchaki added memory connector kernel Issues or pull requests impacting the core kernel labels May 30, 2023
@nacharya1 nacharya1 added the bug Something isn't working label Jul 21, 2023
@sneha-afk
Copy link
Contributor

With PR #2013 , AddOpenAITextCompletionService is no longer available, so this issue is not relevant anymore. Now the approach would be:

.WithOpenAITextCompletionService("text-davinci-003", "xxx")
.WithOpenAITextEmbeddingGenerationService("text-embedding-ada-002", "xxx")

Leaving out the text embedding service gives a clearer error message now:

Service not found: Service of type Microsoft.SemanticKernel.AI.Embeddings.ITextEmbeddingGeneration and name <NONE> not registered.

@nacharya1
Copy link
Contributor

Thanks for informing us about this and glad to hear the issue is now resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kernel Issues or pull requests impacting the core kernel memory connector
Projects
Archived in project
Development

No branches or pull requests

5 participants