diff --git a/eng/Versions.props b/eng/Versions.props index 8d06616a817..94614b55af1 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -170,7 +170,7 @@ 2.8.2 9.7.0 - 1.66.0-preview + 1.67.0-preview 0.43.0 diff --git a/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj b/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj index 69f905a8cab..7fed6252b7c 100644 --- a/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj +++ b/src/Libraries/Microsoft.Extensions.DataIngestion/Microsoft.Extensions.DataIngestion.csproj @@ -23,4 +23,9 @@ + + + + + diff --git a/src/Libraries/Microsoft.Extensions.DataIngestion/Writers/VectorStoreWriter.cs b/src/Libraries/Microsoft.Extensions.DataIngestion/Writers/VectorStoreWriter.cs index 6d4d34f5274..f231ac6535b 100644 --- a/src/Libraries/Microsoft.Extensions.DataIngestion/Writers/VectorStoreWriter.cs +++ b/src/Libraries/Microsoft.Extensions.DataIngestion/Writers/VectorStoreWriter.cs @@ -26,7 +26,6 @@ public sealed class VectorStoreWriter : IngestionChunkWriter private readonly VectorStore _vectorStore; private readonly int _dimensionCount; private readonly VectorStoreWriterOptions _options; - private readonly bool _keysAreStrings; private VectorStoreCollection>? _vectorStoreCollection; @@ -43,12 +42,6 @@ public VectorStoreWriter(VectorStore vectorStore, int dimensionCount, VectorStor _vectorStore = Throw.IfNull(vectorStore); _dimensionCount = Throw.IfLessThanOrEqual(dimensionCount, 0); _options = options ?? new VectorStoreWriterOptions(); - - // Not all vector store support string as the key type, examples: - // Qdrant: https://github.com/microsoft/semantic-kernel/blob/28ea2f4df872e8fd03ef0792ebc9e1989b4be0ee/dotnet/src/VectorData/Qdrant/QdrantCollection.cs#L104 - // When https://github.com/microsoft/semantic-kernel/issues/13141 gets released, - // we need to remove this workaround. - _keysAreStrings = vectorStore.GetType().Name != "QdrantVectorStore"; } /// @@ -85,7 +78,7 @@ public override async Task WriteAsync(IAsyncEnumerable> chunks var key = Guid.NewGuid(); Dictionary record = new() { - [KeyName] = _keysAreStrings ? key.ToString() : key, + [KeyName] = key, [ContentName] = chunk.Content, [EmbeddingName] = chunk.Content, [ContextName] = chunk.Context, @@ -129,7 +122,7 @@ private VectorStoreCollectionDefinition GetVectorStoreRecordDefinition(Ingestion { Properties = { - new VectorStoreKeyProperty(KeyName, _keysAreStrings ? typeof(string) : typeof(Guid)), + new VectorStoreKeyProperty(KeyName, typeof(Guid)), // By using T as the type here we allow the vector store // to handle the conversion from T to the actual vector type it supports.