You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
The method VectorizableTextSearchAsync is returning to document chunks, but the plugin said it is empty.
To Reproduce
ITextEmbeddingGenerationService textEmbeddingGenerationService = new OpenAITextEmbeddingGenerationService("text-embedding-small", openAiClient);
IVectorStore vectorStore = new SqlServerVectorStore(connectionString)
.UseTextEmbeddingGenerationService(textEmbeddingGenerationService);
var globalVectorStoreRecordCollection = vectorStore.GetCollection<int, DocumentRecord>("Global");
await globalVectorStoreRecordCollection.CreateCollectionIfNotExistsAsync();
var chatVectorStoreRecordCollection = vectorStore.GetCollection<int, DocumentRecord>($"Chat{chatId}");
await chatVectorStoreRecordCollection.CreateCollectionIfNotExistsAsync();
var globalSearch = new VectorStoreTextSearch(globalVectorStoreRecordCollection, textEmbeddingGenerationService);
var chatSearch = new VectorStoreTextSearch(chatVectorStoreRecordCollection, textEmbeddingGenerationService);
var builder = Kernel.CreateBuilder();
builder.AddAzureOpenAIChatCompletion(MODEL, azureOpenAIClient: openAiClient);
builder.Services.AddLogging(services => services.AddConsole().SetMinimumLevel(LogLevel.Trace));
var kernel = builder.Build();
// Add the plugin to the kernel
kernel.Plugins.Add(globalSearch.CreateWithGetTextSearchResults(nameof(globalSearch)));
kernel.Plugins.Add(chatSearch.CreateWithGetTextSearchResults(nameof(chatSearch)));
// Retrieve the chat completion service
var chatCompletionService = kernel.Services.GetRequiredService();
Expected behavior
The kernel should receive the two found document chunks.
thomashauser
changed the title
.Net: Bug:
Bug: Plugin created by VectorStoreTextSearch.CreateWithGetTextSearchResults is not returning the results from the IVectorStore
Nov 19, 2024
Hi @thomashauser
we have this sample VectorStore_TextSearch.cs which shows this working with our in-memory store. Can you reproduce the error by changing this sample?
Did you create your own SqlServerVectorStore implementation?
Describe the bug
The method VectorizableTextSearchAsync is returning to document chunks, but the plugin said it is empty.
To Reproduce
ITextEmbeddingGenerationService textEmbeddingGenerationService = new OpenAITextEmbeddingGenerationService("text-embedding-small", openAiClient);
IVectorStore vectorStore = new SqlServerVectorStore(connectionString)
.UseTextEmbeddingGenerationService(textEmbeddingGenerationService);
var globalVectorStoreRecordCollection = vectorStore.GetCollection<int, DocumentRecord>("Global");
await globalVectorStoreRecordCollection.CreateCollectionIfNotExistsAsync();
var chatVectorStoreRecordCollection = vectorStore.GetCollection<int, DocumentRecord>($"Chat{chatId}");
await chatVectorStoreRecordCollection.CreateCollectionIfNotExistsAsync();
var globalSearch = new VectorStoreTextSearch(globalVectorStoreRecordCollection, textEmbeddingGenerationService);
var chatSearch = new VectorStoreTextSearch(chatVectorStoreRecordCollection, textEmbeddingGenerationService);
var builder = Kernel.CreateBuilder();
builder.AddAzureOpenAIChatCompletion(MODEL, azureOpenAIClient: openAiClient);
builder.Services.AddLogging(services => services.AddConsole().SetMinimumLevel(LogLevel.Trace));
var kernel = builder.Build();
// Add the plugin to the kernel
kernel.Plugins.Add(globalSearch.CreateWithGetTextSearchResults(nameof(globalSearch)));
kernel.Plugins.Add(chatSearch.CreateWithGetTextSearchResults(nameof(chatSearch)));
// Retrieve the chat completion service
var chatCompletionService = kernel.Services.GetRequiredService();
Expected behavior
The kernel should receive the two found document chunks.
Screenshots
Platform
Azure.AI.DocumentIntelligence: 1.0.0-beta.3
Microsoft.Extensions.Configuration.Json: 9.0.0
Microsoft.Extensions.Configuration.UserSecrets: 9.0.0
Microsoft.Extensions.DependencyInjection: 9.0.0
Microsoft.Extensions.Logging.Console: 9.0.0
Microsoft.Extensions.VectorData.Abstractions: 9.0.0-preview.1.24523.1
Microsoft.SemanticKernel: 1.29.0
Microsoft.SemanticKernel.Connectors.SqlServer: 1.29.0-alpha
Microsoft.SemanticKernel.Plugins.Core: 1.29.0-alpha
Microsoft.SemanticKernel.Plugins.Document: 1.29.0-alpha
Microsoft.SemanticKernel.Plugins.Memory: 1.29.0-alpha
Microsoft.Data.SqlClient: 5.2.2
Microsoft.SemanticKernel.Abstractions: 1.29.0
Microsoft.SemanticKernel.Connectors.AzureOpenAI: 1.29.0
Microsoft.SemanticKernel.Connectors.OpenAI: 1.29.0
System.Linq.Async: 6.0.1
The text was updated successfully, but these errors were encountered: