Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<XUnitRunnerVisualStudioVersion>2.8.2</XUnitRunnerVisualStudioVersion>
<!-- MEVD is still part of the Semantic Kernel repo -->
<MicrosoftExtensionsVectorDataAbstractionsVersion>9.7.0</MicrosoftExtensionsVectorDataAbstractionsVersion>
<MicrosoftSemanticKernelConnectorsVersion>1.66.0-preview</MicrosoftSemanticKernelConnectorsVersion>
<MicrosoftSemanticKernelConnectorsVersion>1.67.0-preview</MicrosoftSemanticKernelConnectorsVersion>
<MarkdigSignedVersion>0.43.0</MarkdigSignedVersion>
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,9 @@
<PackageReference Include="Microsoft.ML.Tokenizers" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
<!-- Workaround https://github.com/microsoft/semantic-kernel/issues/13316 -->
<PackageReference Include="System.Text.Json" VersionOverride="$(SystemTextJsonVersion)" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public sealed class VectorStoreWriter<T> : IngestionChunkWriter<T>
private readonly VectorStore _vectorStore;
private readonly int _dimensionCount;
private readonly VectorStoreWriterOptions _options;
private readonly bool _keysAreStrings;

private VectorStoreCollection<object, Dictionary<string, object?>>? _vectorStoreCollection;

Expand All @@ -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";
}

/// <summary>
Expand Down Expand Up @@ -85,7 +78,7 @@ public override async Task WriteAsync(IAsyncEnumerable<IngestionChunk<T>> chunks
var key = Guid.NewGuid();
Dictionary<string, object?> record = new()
{
[KeyName] = _keysAreStrings ? key.ToString() : key,
[KeyName] = key,
[ContentName] = chunk.Content,
[EmbeddingName] = chunk.Content,
[ContextName] = chunk.Context,
Expand Down Expand Up @@ -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.
Expand Down
Loading