-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Closed
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codememory connector
Description
Describe the bug
During Azure cognitive search search connection and search in the collection the vector embedding name cannot be configured.
In Azure Cognitive Search the Embeddings Name is "contentVector" while in Semantic Kernel the embedding vector name is set to
public const string EmbeddingField = "Embedding";
from
namespace Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch;
AzureCognitiveSearchMemoryStore line 167 GetNearestMatches
SearchQueryVector vectorQuery = new()
{
KNearestNeighborsCount = limit,
Fields = { AzureCognitiveSearchMemoryRecord.EmbeddingField },
Value = MemoryMarshal.TryGetArray(embedding, out var array) && array.Count == embedding.Length ? array.Array! : embedding.ToArray(),
};
My code
builder.WithMemoryStorage(new AzureCognitiveSearchMemoryStore("secret",
"secret"));
_kernel = builder.Build();
....
var memories = _kernel.Memory.SearchAsync(collections[1], question, 5);
await foreach (var mem in memories)
{
answers.Add(mem.Metadata.Text);
}
which on all returns an error
Azure.RequestFailedException: Unknown field 'Embedding' in vector field list.
Status: 400 (Bad Request)
ErrorCode: InvalidRequestParameter
Content:
{"error":{"code":"InvalidRequestParameter","message":"Unknown field 'Embedding' in vector field list.","details":[{"code":"UnknownField","message":"Unknown field 'Embedding' in vector field list."}]}}
Expected behavior
I expect to be able to set the vector field list name in the configuration of the memory store so that the search goes as expected
Screenshots
Platform
- OS: Windows
- IDE: Visual Studio
- Language: C#
- Source:
<PackageReference Include="Microsoft.SemanticKernel.Abstractions" Version="0.24.230918.1-preview" />
<PackageReference Include="Microsoft.SemanticKernel.Connectors.Memory.AzureCognitiveSearch" Version="0.24.230918.1-preview" />
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
.NETIssue or Pull requests regarding .NET codeIssue or Pull requests regarding .NET codememory connector
Type
Projects
Status
Sprint: Done