-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeai connectorAnything related to AI connectorsAnything related to AI connectors
Description
Describe the bug
AddOllamaEmbeddingGenerator method is not registering service properly.
Getting the following error.
Microsoft.SemanticKernel.KernelException: Service of type 'Microsoft.Extensions.AI.IEmbeddingGenerator2[System.String,Microsoft.Extensions.AI.Embedding
1[System.Double]]' not registered.
To Reproduce
Works:
let private ollamaEndpoint = Uri("http://127.0.0.1:11434")
let private kernel =
Kernel.CreateBuilder()
|> _.AddOllamaTextEmbeddingGeneration("nomic-embed-text", ollamaEndpoint)
|> _.Build()
let EmbeddingGenerator =
kernel.GetRequiredService<ITextEmbeddingGenerationService>().AsEmbeddingGenerator()
Errors:
let private ollamaEndpoint = Uri("http://127.0.0.1:11434")
let private kernel =
Kernel.CreateBuilder()
|> _.AddOllamaEmbeddingGenerator("nomic-embed-text", ollamaEndpoint)
|> _.Build()
let EmbeddingGenerator =
kernel.GetRequiredService<IEmbeddingGenerator<string, Embedding<float>>>()
Expected behavior
I would expect it to be registered properly and work in the same way the "AddOllamaTextEmbeddingGeneration" registration method.
Platform
- Language: F#
- Source: Nuget Packages (microsoft.semantickernel.connectors.ollama\1.53.1-alpha, microsoft.extensions.vectordata.abstractions\9.5.0, microsoft.extensions.ai\9.5.0, microsoft.semantickernel\1.53.1)
- AI model: "nomic-embed-text" using Ollama
- IDE: JetBrains Rider
- OS: Windows
Metadata
Metadata
Assignees
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codeai connectorAnything related to AI connectorsAnything related to AI connectors
Type
Projects
Status
Sprint: Done