fail: Microsoft.KernelMemory.Pipeline.BaseOrchestrator[0]
Pipeline start failed
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetEmbeddingsAsync(IList1 data, Kernel kernel, Nullable1 dimensions, CancellationToken cancellationToken)
at Microsoft.SemanticKernel.AI.Embeddings.TextEmbeddingGenerationExtensions.GenerateEmbeddingAsync(ITextEmbeddingGenerationService generator, String text, CancellationToken cancellationToken)
at Microsoft.KernelMemory.Handlers.GenerateEmbeddingsHandler.InvokeAsync(DataPipeline pipeline, CancellationToken cancellationToken)
at Microsoft.KernelMemory.Pipeline.InProcessPipelineOrchestrator.RunPipelineAsync(DataPipeline pipeline, CancellationToken cancellationToken)
at Microsoft.KernelMemory.Pipeline.BaseOrchestrator.ImportDocumentAsync(String index, DocumentUploadRequest uploadRequest, CancellationToken cancellationToken)
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetEmbeddingsAsync(IList1 data, Kernel kernel, Nullable1 dimensions, CancellationToken cancellationToken)
at Microsoft.SemanticKernel.AI.Embeddings.TextEmbeddingGenerationExtensions.GenerateEmbeddingAsync(ITextEmbeddingGenerationService generator, String text, CancellationToken cancellationToken)
at Microsoft.KernelMemory.Handlers.GenerateEmbeddingsHandler.InvokeAsync(DataPipeline pipeline, CancellationToken cancellationToken)
at Microsoft.KernelMemory.Pipeline.InProcessPipelineOrchestrator.RunPipelineAsync(DataPipeline pipeline, CancellationToken cancellationToken)
at Microsoft.KernelMemory.Pipeline.BaseOrchestrator.ImportDocumentAsync(String index, DocumentUploadRequest uploadRequest, CancellationToken cancellationToken)
at Program.ImportKm(MemoryServerless memory) in /Program.cs:line 36
at Program.Main(String[] args) in /Program.cs:line 30
at Program.(String[] args)
目前測試執行沒辦法直接使用Ollama 的向量資料庫,請問要如何調整,謝謝。
//程式碼 using Microsoft.KernelMemory;
class Program { static async Task Main(string[] args) { var ollamaEmbeddingConfig = new OpenAIConfig { Endpoint = "http://localhost:11434/api", EmbeddingModel = "mxbai-embed-large", APIKey = "0" };
}
錯誤訊息
fail: Microsoft.KernelMemory.Pipeline.BaseOrchestrator[0] Pipeline start failed System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetEmbeddingsAsync(IList(String[] args)
1 data, Kernel kernel, Nullable
1 dimensions, CancellationToken cancellationToken) at Microsoft.SemanticKernel.AI.Embeddings.TextEmbeddingGenerationExtensions.GenerateEmbeddingAsync(ITextEmbeddingGenerationService generator, String text, CancellationToken cancellationToken) at Microsoft.KernelMemory.Handlers.GenerateEmbeddingsHandler.InvokeAsync(DataPipeline pipeline, CancellationToken cancellationToken) at Microsoft.KernelMemory.Pipeline.InProcessPipelineOrchestrator.RunPipelineAsync(DataPipeline pipeline, CancellationToken cancellationToken) at Microsoft.KernelMemory.Pipeline.BaseOrchestrator.ImportDocumentAsync(String index, DocumentUploadRequest uploadRequest, CancellationToken cancellationToken) Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object. at Microsoft.SemanticKernel.Connectors.OpenAI.ClientCore.GetEmbeddingsAsync(IList1 data, Kernel kernel, Nullable
1 dimensions, CancellationToken cancellationToken) at Microsoft.SemanticKernel.AI.Embeddings.TextEmbeddingGenerationExtensions.GenerateEmbeddingAsync(ITextEmbeddingGenerationService generator, String text, CancellationToken cancellationToken) at Microsoft.KernelMemory.Handlers.GenerateEmbeddingsHandler.InvokeAsync(DataPipeline pipeline, CancellationToken cancellationToken) at Microsoft.KernelMemory.Pipeline.InProcessPipelineOrchestrator.RunPipelineAsync(DataPipeline pipeline, CancellationToken cancellationToken) at Microsoft.KernelMemory.Pipeline.BaseOrchestrator.ImportDocumentAsync(String index, DocumentUploadRequest uploadRequest, CancellationToken cancellationToken) at Program.ImportKm(MemoryServerless memory) in /Program.cs:line 36 at Program.Main(String[] args) in /Program.cs:line 30 at Program.另外目前書中也是以OpenAI為主,請問是否要額外寫CustomEmbeddingGenerator?