From 5e0b93712ce09c3a0e0ee74696ea10719141ec41 Mon Sep 17 00:00:00 2001
From: westey <164392973+westey-m@users.noreply.github.com>
Date: Wed, 24 Jun 2026 14:18:02 +0100
Subject: [PATCH 1/6] Update SK to use MEVD packages and move MEVD projects out
of main solution
---
dotnet/Directory.Packages.props | 11 +++
dotnet/MEVD.slnx | 67 +++++++++++++++++++
dotnet/SK-dotnet.slnx | 47 -------------
dotnet/samples/Concepts/Concepts.csproj | 20 +++---
...gingFace_TextEmbeddingCustomHttpHandler.cs | 7 +-
.../ChatWithAgent.ApiService.csproj | 2 +-
.../MCPServer/MCPServer.csproj | 2 +-
.../Demos/OnnxSimpleRAG/OnnxSimpleRAG.csproj | 2 +-
.../VectorStoreRAG/VectorStoreRAG.csproj | 14 ++--
.../GettingStartedWithTextSearch.csproj | 2 +-
.../GettingStartedWithVectorStores.csproj | 7 +-
.../IntegrationTests/IntegrationTests.csproj | 12 ----
.../SemanticKernel.Abstractions.csproj | 5 +-
.../SemanticKernel.UnitTests.csproj | 2 +-
14 files changed, 106 insertions(+), 94 deletions(-)
create mode 100644 dotnet/MEVD.slnx
diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props
index 871f35361f2e..4dcc213ea1f1 100644
--- a/dotnet/Directory.Packages.props
+++ b/dotnet/Directory.Packages.props
@@ -152,6 +152,7 @@
+
@@ -200,6 +201,16 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/dotnet/MEVD.slnx b/dotnet/MEVD.slnx
new file mode 100644
index 000000000000..10a3ac81db18
--- /dev/null
+++ b/dotnet/MEVD.slnx
@@ -0,0 +1,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/dotnet/SK-dotnet.slnx b/dotnet/SK-dotnet.slnx
index b2ff323d726c..966fbcb713a3 100644
--- a/dotnet/SK-dotnet.slnx
+++ b/dotnet/SK-dotnet.slnx
@@ -121,24 +121,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -292,33 +274,4 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dotnet/samples/Concepts/Concepts.csproj b/dotnet/samples/Concepts/Concepts.csproj
index 2aa832dc868c..ad6b3fe12a59 100644
--- a/dotnet/samples/Concepts/Concepts.csproj
+++ b/dotnet/samples/Concepts/Concepts.csproj
@@ -49,6 +49,15 @@
+
+
+
+
+
+
+
+
+
@@ -71,17 +80,6 @@
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dotnet/samples/Concepts/Memory/HuggingFace_TextEmbeddingCustomHttpHandler.cs b/dotnet/samples/Concepts/Memory/HuggingFace_TextEmbeddingCustomHttpHandler.cs
index db956debca35..7e27f0a25bc3 100644
--- a/dotnet/samples/Concepts/Memory/HuggingFace_TextEmbeddingCustomHttpHandler.cs
+++ b/dotnet/samples/Concepts/Memory/HuggingFace_TextEmbeddingCustomHttpHandler.cs
@@ -3,7 +3,7 @@
using System.Text.Json;
using Microsoft.Extensions.VectorData;
using Microsoft.SemanticKernel.Connectors.HuggingFace;
-using Microsoft.SemanticKernel.Connectors.SqliteVec;
+using Microsoft.SemanticKernel.Connectors.InMemory;
using Microsoft.SemanticKernel.Embeddings;
#pragma warning disable CS8602 // Dereference of a possibly null reference.
@@ -32,12 +32,11 @@ public async Task RunInferenceApiEmbeddingCustomHttpHandlerAsync()
})
);
- var sqliteCollection = new SqliteCollection(
- "Data Source=./../../../Sqlite.sqlite",
+ var inMemoryCollection = new InMemoryCollection(
name: "Test",
new() { EmbeddingGenerator = hf.AsEmbeddingGenerator() });
- await sqliteCollection.UpsertAsync(new Record
+ await inMemoryCollection.UpsertAsync(new Record
{
Id = "1",
Text = "THIS IS A SAMPLE",
diff --git a/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/ChatWithAgent.ApiService.csproj b/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/ChatWithAgent.ApiService.csproj
index e2a7b7725f0f..09abe013258f 100644
--- a/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/ChatWithAgent.ApiService.csproj
+++ b/dotnet/samples/Demos/AgentFrameworkWithAspire/ChatWithAgent.ApiService/ChatWithAgent.ApiService.csproj
@@ -14,13 +14,13 @@
+
-
diff --git a/dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/MCPServer.csproj b/dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/MCPServer.csproj
index 042eb196402f..55b4a187a65e 100644
--- a/dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/MCPServer.csproj
+++ b/dotnet/samples/Demos/ModelContextProtocolClientServer/MCPServer/MCPServer.csproj
@@ -32,11 +32,11 @@
+
-
diff --git a/dotnet/samples/Demos/OnnxSimpleRAG/OnnxSimpleRAG.csproj b/dotnet/samples/Demos/OnnxSimpleRAG/OnnxSimpleRAG.csproj
index 0f5162c8af6a..9507fd81365c 100644
--- a/dotnet/samples/Demos/OnnxSimpleRAG/OnnxSimpleRAG.csproj
+++ b/dotnet/samples/Demos/OnnxSimpleRAG/OnnxSimpleRAG.csproj
@@ -8,7 +8,6 @@
-
@@ -17,6 +16,7 @@
+
diff --git a/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj b/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj
index 23fd288e7b97..fab34e67af9d 100644
--- a/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj
+++ b/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj
@@ -15,17 +15,17 @@
+
+
+
+
+
+
+
-
-
-
-
-
-
-
diff --git a/dotnet/samples/GettingStartedWithTextSearch/GettingStartedWithTextSearch.csproj b/dotnet/samples/GettingStartedWithTextSearch/GettingStartedWithTextSearch.csproj
index a4ebfd31ac80..9eab7a6c81d7 100644
--- a/dotnet/samples/GettingStartedWithTextSearch/GettingStartedWithTextSearch.csproj
+++ b/dotnet/samples/GettingStartedWithTextSearch/GettingStartedWithTextSearch.csproj
@@ -35,6 +35,7 @@
+
@@ -42,7 +43,6 @@
-
diff --git a/dotnet/samples/GettingStartedWithVectorStores/GettingStartedWithVectorStores.csproj b/dotnet/samples/GettingStartedWithVectorStores/GettingStartedWithVectorStores.csproj
index 2b8c52498767..b08f7cf0ce95 100644
--- a/dotnet/samples/GettingStartedWithVectorStores/GettingStartedWithVectorStores.csproj
+++ b/dotnet/samples/GettingStartedWithVectorStores/GettingStartedWithVectorStores.csproj
@@ -32,16 +32,15 @@
+
+
+
-
-
-
-
diff --git a/dotnet/src/IntegrationTests/IntegrationTests.csproj b/dotnet/src/IntegrationTests/IntegrationTests.csproj
index 575a75a0f28a..7ed606ec711d 100644
--- a/dotnet/src/IntegrationTests/IntegrationTests.csproj
+++ b/dotnet/src/IntegrationTests/IntegrationTests.csproj
@@ -72,18 +72,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj b/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj
index 02b5009b6194..d6254b9fd51d 100644
--- a/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj
+++ b/dotnet/src/SemanticKernel.Abstractions/SemanticKernel.Abstractions.csproj
@@ -23,13 +23,10 @@
Semantic Kernel interfaces and abstractions. This package is automatically installed by Semantic Kernel packages if needed.
-
-
-
-
+
diff --git a/dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj b/dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj
index f3e9dff4ab9c..1bc01dd5df06 100644
--- a/dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj
+++ b/dotnet/src/SemanticKernel.UnitTests/SemanticKernel.UnitTests.csproj
@@ -25,11 +25,11 @@
+
-
From 313ac3b1b9688764b107753a4371ee766efcd6d6 Mon Sep 17 00:00:00 2001
From: westey <164392973+westey-m@users.noreply.github.com>
Date: Wed, 24 Jun 2026 14:22:44 +0100
Subject: [PATCH 2/6] Fix vulnerability issue
---
dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj | 2 ++
1 file changed, 2 insertions(+)
diff --git a/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj b/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj
index fab34e67af9d..97b89013fef8 100644
--- a/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj
+++ b/dotnet/samples/Demos/VectorStoreRAG/VectorStoreRAG.csproj
@@ -22,6 +22,8 @@
+
+
From 9fc3f5243ddc2fea6036db4dde9babd257f232c3 Mon Sep 17 00:00:00 2001
From: westey <164392973+westey-m@users.noreply.github.com>
Date: Wed, 24 Jun 2026 14:27:52 +0100
Subject: [PATCH 3/6] Remove MEVD.slnx from build
---
.github/workflows/dotnet-build-and-test.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml
index 8987c2f48e42..5a758f331662 100644
--- a/.github/workflows/dotnet-build-and-test.yml
+++ b/.github/workflows/dotnet-build-and-test.yml
@@ -81,7 +81,7 @@ jobs:
- name: Build dotnet solutions
shell: bash
run: |
- export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | tr '\n' ' ')
+ export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | grep -v "MEVD.slnx" | tr '\n' ' ')
for solution in $SOLUTIONS; do
dotnet build $solution -c ${{ matrix.configuration }} --warnaserror
done
@@ -89,7 +89,7 @@ jobs:
- name: Package install check
shell: bash
run: |
- export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | tr '\n' ' ')
+ export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | grep -v "MEVD.slnx" | tr '\n' ' ')
for solution in $SOLUTIONS; do
dotnet pack $solution -c ${{ matrix.configuration }} --no-build --no-restore --output ./artifacts
done
From bc083e939b4ef997cd873eac4646d696951ad37a Mon Sep 17 00:00:00 2001
From: westey <164392973+westey-m@users.noreply.github.com>
Date: Wed, 24 Jun 2026 14:29:34 +0100
Subject: [PATCH 4/6] Delete the MEVD solution filter, since it is no longer
valid.
---
dotnet/MEVD.slnf | 50 ------------------------------------------------
1 file changed, 50 deletions(-)
delete mode 100644 dotnet/MEVD.slnf
diff --git a/dotnet/MEVD.slnf b/dotnet/MEVD.slnf
deleted file mode 100644
index 2a2273ba7f88..000000000000
--- a/dotnet/MEVD.slnf
+++ /dev/null
@@ -1,50 +0,0 @@
-{
- "solution": {
- "path": "SK-dotnet.slnx",
- "projects":
- [
- "src/VectorData/AzureAISearch/AzureAISearch.csproj",
- "src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj",
- "src/VectorData/CosmosNoSql/CosmosNoSql.csproj",
- "src/VectorData/Chroma/Chroma.csproj",
- "src/VectorData/InMemory/InMemory.csproj",
- "src/VectorData/Milvus/Milvus.csproj",
- "src/VectorData/MongoDB/MongoDB.csproj",
- "src/VectorData/Pinecone/Pinecone.csproj",
- "src/VectorData/PgVector/PgVector.csproj",
- "src/VectorData/Qdrant/Qdrant.csproj",
- "src/VectorData/Redis/Redis.csproj",
- "src/VectorData/SqliteVec/SqliteVec.csproj",
- "src/VectorData/SqlServer/SqlServer.csproj",
- "src/VectorData/Weaviate/Weaviate.csproj",
-
- "src/VectorData/VectorData.Abstractions/VectorData.Abstractions.csproj",
-
- "test/VectorData/AzureAISearch.UnitTests/AzureAISearch.UnitTests.csproj",
- "test/VectorData/AzureAISearch.ConformanceTests/AzureAISearch.ConformanceTests.csproj",
- "test/VectorData/CosmosMongoDB.UnitTests/CosmosMongoDB.UnitTests.csproj",
- "test/VectorData/CosmosMongoDB.ConformanceTests/CosmosMongoDB.ConformanceTests.csproj",
- "test/VectorData/CosmosNoSql.UnitTests/CosmosNoSql.UnitTests.csproj",
- "test/VectorData/CosmosNoSql.ConformanceTests/CosmosNoSql.ConformanceTests.csproj",
- "test/VectorData/InMemory.UnitTests/InMemory.UnitTests.csproj",
- "test/VectorData/InMemory.ConformanceTests/InMemory.ConformanceTests.csproj",
- "test/VectorData/MongoDB.UnitTests/MongoDB.UnitTests.csproj",
- "test/VectorData/MongoDB.ConformanceTests/MongoDB.ConformanceTests.csproj",
- "test/VectorData/Pinecone.UnitTests/Pinecone.UnitTests.csproj",
- "test/VectorData/Pinecone.ConformanceTests/Pinecone.ConformanceTests.csproj",
- "test/VectorData/PgVector.UnitTests/PgVector.UnitTests.csproj",
- "test/VectorData/PgVector.ConformanceTests/PgVector.ConformanceTests.csproj",
- "test/VectorData/Qdrant.UnitTests/Qdrant.UnitTests.csproj",
- "test/VectorData/Qdrant.ConformanceTests/Qdrant.ConformanceTests.csproj",
- "test/VectorData/Redis.UnitTests/Redis.UnitTests.csproj",
- "test/VectorData/Redis.ConformanceTests/Redis.ConformanceTests.csproj",
- "test/VectorData/SqliteVec.UnitTests/SqliteVec.UnitTests.csproj",
- "test/VectorData/SqliteVec.ConformanceTests/SqliteVec.ConformanceTests.csproj",
- "test/VectorData/SqlServer.ConformanceTests/SqlServer.ConformanceTests.csproj",
- "test/VectorData/Weaviate.UnitTests/Weaviate.UnitTests.csproj",
- "test/VectorData/Weaviate.ConformanceTests/Weaviate.ConformanceTests.csproj",
-
- "test/VectorData/VectorData.ConformanceTests/VectorData.ConformanceTests.csproj"
- ]
- }
-}
\ No newline at end of file
From 43494ec18e8e70752c10cd5bcc87c2eead5caf67 Mon Sep 17 00:00:00 2001
From: westey <164392973+westey-m@users.noreply.github.com>
Date: Wed, 24 Jun 2026 16:54:39 +0100
Subject: [PATCH 5/6] Remove MEVD.Abstractions from repo and point
implementations to released package
---
.github/workflows/dotnet-build-and-test.yml | 4 +-
dotnet/MEVD.slnx | 3 +-
.../Memory/MongoDB/MongoModelBuilder.cs | 13 +-
.../AzureAISearch/AzureAISearch.csproj | 5 +-
.../CosmosMongoDB/CosmosMongoDB.csproj | 5 +-
.../VectorData/CosmosNoSql/CosmosNoSql.csproj | 5 +-
.../CosmosNoSql/CosmosNoSqlMapper.cs | 6 +-
.../src/VectorData/InMemory/InMemory.csproj | 5 +-
dotnet/src/VectorData/MongoDB/MongoDB.csproj | 5 +-
.../src/VectorData/PgVector/PgVector.csproj | 5 +-
.../src/VectorData/Pinecone/Pinecone.csproj | 5 +-
dotnet/src/VectorData/Qdrant/Qdrant.csproj | 5 +-
dotnet/src/VectorData/Redis/Redis.csproj | 5 +-
.../src/VectorData/SqlServer/SqlServer.csproj | 5 +-
.../src/VectorData/SqliteVec/SqliteVec.csproj | 5 +-
.../VectorData.Abstractions/.editorconfig | 3 -
.../AnyTagEqualToFilterClause.cs | 33 -
.../FilterClauses/EqualToFilterClause.cs | 33 -
.../FilterClauses/FilterClause.cs | 23 -
.../VectorData.Abstractions/PACKAGE.md | 51 --
.../Properties/AssemblyInfo.cs | 3 -
.../CollectionJsonModelBuilder.cs | 104 ---
.../ProviderServices/CollectionModel.cs | 243 -------
.../CollectionModelBuilder.cs | 609 ------------------
.../CollectionModelBuildingOptions.cs | 34 -
.../ProviderServices/DataPropertyModel.cs | 34 -
.../EmbeddingGenerationDispatcher.cs | 86 ---
.../Filter/FilterPreprocessingOptions.cs | 22 -
.../Filter/FilterTranslatorBase.cs | 403 ------------
.../Filter/QueryParameterExpression.cs | 33 -
.../ProviderServices/IRecordCreator.cs | 8 -
.../ProviderServices/KeyPropertyModel.cs | 31 -
.../ProviderServices/PropertyModel.cs | 162 -----
.../ProviderServices/VectorDataStrings.cs | 79 ---
.../ProviderServices/VectorPropertyModel.cs | 198 ------
.../VectorPropertyModel{TInput}.cs | 70 --
.../VectorData.Abstractions/README.md | 1 +
.../VectorStoreDataAttribute.cs | 41 --
.../VectorStoreKeyAttribute.cs | 46 --
.../VectorStoreVectorAttribute.cs | 68 --
.../RecordDefinition/DistanceFunction.cs | 80 ---
.../RecordDefinition/IndexKind.cs | 60 --
.../VectorStoreCollectionDefinition.cs | 33 -
.../VectorStoreDataProperty.cs | 40 --
.../VectorStoreKeyProperty.cs | 32 -
.../RecordDefinition/VectorStoreProperty.cs | 71 --
.../VectorStoreVectorProperty.cs | 105 ---
.../VectorStoreVectorProperty{TInput}.cs | 36 --
.../FilteredRecordRetrievalOptions.cs | 117 ----
.../RecordOptions/RecordRetrievalOptions.cs | 18 -
.../VectorData.Abstractions/Throw.cs | 14 -
.../VectorData.Abstractions.csproj | 71 --
.../VectorSearch/HybridSearchOptions.cs | 77 ---
.../VectorSearch/IKeywordHybridSearchable.cs | 74 ---
.../VectorSearch/IVectorSearchable.cs | 72 ---
.../KeywordHybridSearchExtensions.cs | 31 -
.../VectorSearch/RecordSearchOptions.cs | 70 --
.../VectorSearch/VectorSearchExtensions.cs | 31 -
.../VectorSearch/VectorSearchResult.cs | 31 -
.../VectorStorage/VectorStore.cs | 98 ---
.../VectorStorage/VectorStoreCollection.cs | 202 ------
.../VectorStoreCollectionMetadata.cs | 25 -
.../VectorStoreCollectionOptions.cs | 40 --
.../VectorStorage/VectorStoreException.cs | 58 --
.../VectorStorage/VectorStoreExtensions.cs | 31 -
.../VectorStorage/VectorStoreMetadata.cs | 20 -
.../VectorData.Abstractions/neticon.png | Bin 7006 -> 0 bytes
.../src/VectorData/Weaviate/Weaviate.csproj | 5 +-
.../VectorData.ConformanceTests.csproj | 5 +-
.../CollectionModelBuilderTests.cs | 525 ---------------
.../PropertyModelTests.cs | 139 ----
.../VectorData.UnitTests.csproj | 43 --
72 files changed, 28 insertions(+), 4725 deletions(-)
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/.editorconfig
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/AnyTagEqualToFilterClause.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/EqualToFilterClause.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/PACKAGE.md
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/Properties/AssemblyInfo.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModel.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuilder.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModelBuildingOptions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/DataPropertyModel.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/EmbeddingGenerationDispatcher.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/Filter/FilterPreprocessingOptions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/Filter/FilterTranslatorBase.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/Filter/QueryParameterExpression.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/IRecordCreator.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/KeyPropertyModel.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/PropertyModel.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/VectorDataStrings.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/VectorPropertyModel.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/VectorPropertyModel{TInput}.cs
create mode 100644 dotnet/src/VectorData/VectorData.Abstractions/README.md
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordAttributes/VectorStoreDataAttribute.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordAttributes/VectorStoreKeyAttribute.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordAttributes/VectorStoreVectorAttribute.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/DistanceFunction.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/IndexKind.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/VectorStoreCollectionDefinition.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/VectorStoreDataProperty.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/VectorStoreKeyProperty.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/VectorStoreProperty.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/VectorStoreVectorProperty.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordDefinition/VectorStoreVectorProperty{TInput}.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordOptions/FilteredRecordRetrievalOptions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/RecordOptions/RecordRetrievalOptions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/Throw.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorData.Abstractions.csproj
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/HybridSearchOptions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/IKeywordHybridSearchable.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/IVectorSearchable.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/KeywordHybridSearchExtensions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/RecordSearchOptions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/VectorSearchExtensions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorSearch/VectorSearchResult.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorStorage/VectorStore.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorStorage/VectorStoreCollection.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorStorage/VectorStoreCollectionMetadata.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorStorage/VectorStoreCollectionOptions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorStorage/VectorStoreException.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorStorage/VectorStoreExtensions.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/VectorStorage/VectorStoreMetadata.cs
delete mode 100644 dotnet/src/VectorData/VectorData.Abstractions/neticon.png
delete mode 100644 dotnet/test/VectorData/VectorData.UnitTests/CollectionModelBuilderTests.cs
delete mode 100644 dotnet/test/VectorData/VectorData.UnitTests/PropertyModelTests.cs
delete mode 100644 dotnet/test/VectorData/VectorData.UnitTests/VectorData.UnitTests.csproj
diff --git a/.github/workflows/dotnet-build-and-test.yml b/.github/workflows/dotnet-build-and-test.yml
index 5a758f331662..8987c2f48e42 100644
--- a/.github/workflows/dotnet-build-and-test.yml
+++ b/.github/workflows/dotnet-build-and-test.yml
@@ -81,7 +81,7 @@ jobs:
- name: Build dotnet solutions
shell: bash
run: |
- export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | grep -v "MEVD.slnx" | tr '\n' ' ')
+ export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | tr '\n' ' ')
for solution in $SOLUTIONS; do
dotnet build $solution -c ${{ matrix.configuration }} --warnaserror
done
@@ -89,7 +89,7 @@ jobs:
- name: Package install check
shell: bash
run: |
- export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | grep -v "MEVD.slnx" | tr '\n' ' ')
+ export SOLUTIONS=$(find ./dotnet/ -type f -name "*.slnx" | tr '\n' ' ')
for solution in $SOLUTIONS; do
dotnet pack $solution -c ${{ matrix.configuration }} --no-build --no-restore --output ./artifacts
done
diff --git a/dotnet/MEVD.slnx b/dotnet/MEVD.slnx
index 10a3ac81db18..9f782e02e062 100644
--- a/dotnet/MEVD.slnx
+++ b/dotnet/MEVD.slnx
@@ -17,6 +17,7 @@
+
@@ -32,7 +33,6 @@
-
@@ -60,7 +60,6 @@
-
diff --git a/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs b/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs
index 25b77f90839b..69f974cffd19 100644
--- a/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs
+++ b/dotnet/src/InternalUtilities/connectors/Memory/MongoDB/MongoModelBuilder.cs
@@ -27,14 +27,17 @@ internal class MongoModelBuilder() : CollectionModelBuilder(s_validationOptions)
UsesExternalSerializer = true,
};
- protected override void ProcessProperty(PropertyInfo? clrProperty, VectorStoreProperty? definitionProperty, Type? type)
+ [RequiresUnreferencedCode("Traverses the CLR type's properties with reflection, so not compatible with trimming")]
+ protected override void ProcessTypeProperties(Type type, VectorStoreCollectionDefinition? definition)
{
- base.ProcessProperty(clrProperty, definitionProperty, type);
+ base.ProcessTypeProperties(type, definition);
- if (clrProperty?.GetCustomAttribute() is { } bsonElementAttribute
- && this.PropertyMap.TryGetValue(clrProperty.Name, out var property))
+ foreach (var property in this.Properties)
{
- property.StorageName = bsonElementAttribute.ElementName;
+ if (property.PropertyInfo?.GetCustomAttribute() is { } bsonElementAttribute)
+ {
+ property.StorageName = bsonElementAttribute.ElementName;
+ }
}
}
diff --git a/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj b/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj
index d43078f48cee..54258372dc2a 100644
--- a/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj
+++ b/dotnet/src/VectorData/AzureAISearch/AzureAISearch.csproj
@@ -26,6 +26,7 @@
+
@@ -37,8 +38,4 @@
-
-
-
-
diff --git a/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj b/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj
index 0d6bca948aaf..23f8e0cba2db 100644
--- a/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj
+++ b/dotnet/src/VectorData/CosmosMongoDB/CosmosMongoDB.csproj
@@ -42,10 +42,7 @@
-
-
-
-
+
diff --git a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj
index 2849a25f118e..05a0574e03c4 100644
--- a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj
+++ b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSql.csproj
@@ -32,13 +32,10 @@
+
-
-
-
-
diff --git a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlMapper.cs b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlMapper.cs
index 6f0ffdaea91b..8a8644b80198 100644
--- a/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlMapper.cs
+++ b/dotnet/src/VectorData/CosmosNoSql/CosmosNoSqlMapper.cs
@@ -41,8 +41,8 @@ public JsonObject MapFromDataToStorageModel(TRecord dataModel, int recordIndex,
// The key property in Azure CosmosDB NoSQL is always named 'id'.
// But the external JSON serializer used just above isn't aware of that, and will produce a JSON object with another name, taking into
- // account e.g. naming policies. SerializedKeyName gets populated in the model builder - containing that name - once VectorStoreModelBuildingOptions.ReservedKeyPropertyName is set
- RenameJsonProperty(jsonObject, this._keyProperty.SerializedKeyName!, CosmosNoSqlConstants.ReservedKeyPropertyName);
+ // account e.g. naming policies. TemporaryStorageName gets populated in the model builder - containing that name - once VectorStoreModelBuildingOptions.ReservedKeyPropertyName is set
+ RenameJsonProperty(jsonObject, this._keyProperty.TemporaryStorageName!, CosmosNoSqlConstants.ReservedKeyPropertyName);
// Go over the vector properties; inject any generated embeddings to overwrite the JSON serialized above.
// Also, for Embedding properties we also need to overwrite with a simple array (since Embedding gets serialized as a complex object).
@@ -116,7 +116,7 @@ public JsonObject MapFromDataToStorageModel(TRecord dataModel, int recordIndex,
public TRecord MapFromStorageToDataModel(JsonObject storageModel, bool includeVectors)
{
// See above comment.
- RenameJsonProperty(storageModel, CosmosNoSqlConstants.ReservedKeyPropertyName, this._keyProperty.SerializedKeyName!);
+ RenameJsonProperty(storageModel, CosmosNoSqlConstants.ReservedKeyPropertyName, this._keyProperty.TemporaryStorageName!);
foreach (var vectorProperty in this._model.VectorProperties)
{
diff --git a/dotnet/src/VectorData/InMemory/InMemory.csproj b/dotnet/src/VectorData/InMemory/InMemory.csproj
index aa8cbb340f55..dcd70c709db2 100644
--- a/dotnet/src/VectorData/InMemory/InMemory.csproj
+++ b/dotnet/src/VectorData/InMemory/InMemory.csproj
@@ -34,11 +34,8 @@
+
-
-
-
-
diff --git a/dotnet/src/VectorData/MongoDB/MongoDB.csproj b/dotnet/src/VectorData/MongoDB/MongoDB.csproj
index 4bc2786c1161..6196ba1c4fee 100644
--- a/dotnet/src/VectorData/MongoDB/MongoDB.csproj
+++ b/dotnet/src/VectorData/MongoDB/MongoDB.csproj
@@ -37,10 +37,7 @@
-
-
-
-
+
diff --git a/dotnet/src/VectorData/PgVector/PgVector.csproj b/dotnet/src/VectorData/PgVector/PgVector.csproj
index b171819ce395..8b33c42e99f6 100644
--- a/dotnet/src/VectorData/PgVector/PgVector.csproj
+++ b/dotnet/src/VectorData/PgVector/PgVector.csproj
@@ -32,16 +32,13 @@
+
8.0.7
-
-
-
-
diff --git a/dotnet/src/VectorData/Pinecone/Pinecone.csproj b/dotnet/src/VectorData/Pinecone/Pinecone.csproj
index d5c5847327a2..f065a03f1462 100644
--- a/dotnet/src/VectorData/Pinecone/Pinecone.csproj
+++ b/dotnet/src/VectorData/Pinecone/Pinecone.csproj
@@ -28,6 +28,7 @@
+
@@ -39,8 +40,4 @@
-
-
-
-
diff --git a/dotnet/src/VectorData/Qdrant/Qdrant.csproj b/dotnet/src/VectorData/Qdrant/Qdrant.csproj
index 86e2503a2056..248a0a2c0b22 100644
--- a/dotnet/src/VectorData/Qdrant/Qdrant.csproj
+++ b/dotnet/src/VectorData/Qdrant/Qdrant.csproj
@@ -27,6 +27,7 @@
+
@@ -40,8 +41,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/dotnet/src/VectorData/Redis/Redis.csproj b/dotnet/src/VectorData/Redis/Redis.csproj
index 41e673ad61a5..d463c09b373d 100644
--- a/dotnet/src/VectorData/Redis/Redis.csproj
+++ b/dotnet/src/VectorData/Redis/Redis.csproj
@@ -26,6 +26,7 @@
+
@@ -33,8 +34,4 @@
-
-
-
-
\ No newline at end of file
diff --git a/dotnet/src/VectorData/SqlServer/SqlServer.csproj b/dotnet/src/VectorData/SqlServer/SqlServer.csproj
index 7896ffcb03f5..c6075692aa84 100644
--- a/dotnet/src/VectorData/SqlServer/SqlServer.csproj
+++ b/dotnet/src/VectorData/SqlServer/SqlServer.csproj
@@ -30,13 +30,10 @@
+
-
-
-
-
diff --git a/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj b/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj
index ab5a3f4798dd..d3e2062b157b 100644
--- a/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj
+++ b/dotnet/src/VectorData/SqliteVec/SqliteVec.csproj
@@ -31,16 +31,13 @@
+
-
-
-
-
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/.editorconfig b/dotnet/src/VectorData/VectorData.Abstractions/.editorconfig
deleted file mode 100644
index acb2cb62caf4..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/.editorconfig
+++ /dev/null
@@ -1,3 +0,0 @@
-# Suppress missing documentation warnings for generated code (strings)
-[*.Designer.cs]
-dotnet_diagnostic.CS1591.severity = none
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/AnyTagEqualToFilterClause.cs b/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/AnyTagEqualToFilterClause.cs
deleted file mode 100644
index c9419d087732..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/AnyTagEqualToFilterClause.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-
-namespace Microsoft.Extensions.VectorData;
-
-///
-/// Represents a filter clause that filters by checking if a field consisting of a list of values contains a specific value.
-///
-[Obsolete("Use LINQ expressions via VectorSearchOptions.Filter instead. This type will be removed in a future version.")]
-public sealed class AnyTagEqualToFilterClause : FilterClause
-{
- ///
- /// Initializes a new instance of the class.
- ///
- /// The name of the field with the list of values.
- /// The value that the list should contain.
- public AnyTagEqualToFilterClause(string fieldName, string value)
- {
- this.FieldName = fieldName;
- this.Value = value;
- }
-
- ///
- /// Gets the name of the field with the list of values.
- ///
- public string FieldName { get; private set; }
-
- ///
- /// Gets the value that the list should contain.
- ///
- public string Value { get; private set; }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/EqualToFilterClause.cs b/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/EqualToFilterClause.cs
deleted file mode 100644
index 03fc678abc8b..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/EqualToFilterClause.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-
-namespace Microsoft.Extensions.VectorData;
-
-///
-/// Represents a filter clause that filters using equality of a field value.
-///
-[Obsolete("Use LINQ expressions via VectorSearchOptions.Filter instead. This type will be removed in a future version.")]
-public sealed class EqualToFilterClause : FilterClause
-{
- ///
- /// Initializes a new instance of the class.
- ///
- /// Field name.
- /// Field value.
- public EqualToFilterClause(string fieldName, object value)
- {
- this.FieldName = fieldName;
- this.Value = value;
- }
-
- ///
- /// Gets the field name to match.
- ///
- public string FieldName { get; private set; }
-
- ///
- /// Gets the field value to match.
- ///
- public object Value { get; private set; }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs b/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs
deleted file mode 100644
index 97c8869a27ea..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/FilterClauses/FilterClause.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-
-namespace Microsoft.Extensions.VectorData;
-
-///
-/// Defines a base class for filter clauses.
-///
-///
-/// A is used to request that the underlying search service should
-/// filter search results based on the specified criteria.
-///
-[Obsolete("Use LINQ expressions via VectorSearchOptions.Filter instead. This type will be removed in a future version.")]
-public abstract class FilterClause
-{
- ///
- /// Initializes a new instance of the class.
- ///
- protected FilterClause()
- {
- }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/PACKAGE.md b/dotnet/src/VectorData/VectorData.Abstractions/PACKAGE.md
deleted file mode 100644
index 948b8527c6a8..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/PACKAGE.md
+++ /dev/null
@@ -1,51 +0,0 @@
-## About
-
-Contains abstractions for accessing Vector Databases and Vector Indexes.
-
-## Key Features
-
-- Base abstract classes and interfaces for Vector Database implementation. Vector Database implementations are provided separately in other packages, for example `Microsoft.SemanticKernel.Connectors.AzureAISearch`.
-- Abstractions include:
- - Creating, listing and deleting collections with custom schema support.
- - Creating, retrieving, updating and deleting records.
- - Similarty search using vector embeddings.
- - Search using filters.
- - Hybrid search combining vector similarity and keyword search.
- - Built-in embedding generation using `Microsoft.Extensions.AI`.
-
-## How to Use
-
-This package is typically used with an implementation of the vector database abstractions such as `Microsoft.SemanticKernel.Connectors.AzureAISearch`.
-
-## Main Types
-
-The main types provided by this library are:
-
-- [Microsoft.Extensions.VectorData.VectorStore](https://learn.microsoft.com/dotnet/api/microsoft.extensions.vectordata.vectorstore)
-- [Microsoft.Extensions.VectorData.VectorStoreCollection](https://learn.microsoft.com/dotnet/api/microsoft.extensions.vectordata.vectorstorecollection-2)
-
-## Additional Documentation
-
-- [Conceptual documentation](https://learn.microsoft.com/en-us/semantic-kernel/concepts/vector-store-connectors)
-
-## Related Packages
-
-Vector Database implementations:
-
-- [Microsoft.SemanticKernel.Connectors.AzureAISearch](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.AzureAISearch)
-- [Microsoft.SemanticKernel.Connectors.CosmosMongoDB](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.CosmosMongoDB)
-- [Microsoft.SemanticKernel.Connectors.CosmosNoSQL](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.CosmosNoSQL)
-- [Elastic.SemanticKernel.Connectors.Elasticsearch](https://www.nuget.org/packages/Elastic.SemanticKernel.Connectors.Elasticsearch)
-- [Microsoft.SemanticKernel.Connectors.InMemory](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.InMemory)
-- [Microsoft.SemanticKernel.Connectors.MongoDB](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.MongoDB)
-- [Microsoft.SemanticKernel.Connectors.PgVector](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.PgVector)
-- [Microsoft.SemanticKernel.Connectors.Pinecone](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Pinecone)
-- [Microsoft.SemanticKernel.Connectors.Qdrant](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Qdrant)
-- [Microsoft.SemanticKernel.Connectors.Redis](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Redis)
-- [Microsoft.SemanticKernel.Connectors.SqliteVec](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.SqliteVec)
-- [Microsoft.SemanticKernel.Connectors.SqlServer](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.SqlServer)
-- [Microsoft.SemanticKernel.Connectors.Weaviate](https://www.nuget.org/packages/Microsoft.SemanticKernel.Connectors.Weaviate)
-
-## Feedback & Contributing
-
-Microsoft.Extensions.VectorData.Abstractions is released as open source under the [MIT license](https://licenses.nuget.org/MIT). Bug reports and contributions are welcome at [the GitHub repository](https://github.com/microsoft/semantic-kernel).
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/Properties/AssemblyInfo.cs b/dotnet/src/VectorData/VectorData.Abstractions/Properties/AssemblyInfo.cs
deleted file mode 100644
index 09647faa37af..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,3 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-[assembly: System.Resources.NeutralResourcesLanguage("en-US")]
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs
deleted file mode 100644
index 90a2db9433f3..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionJsonModelBuilder.cs
+++ /dev/null
@@ -1,104 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-using System.Diagnostics.CodeAnalysis;
-using System.Reflection;
-using System.Text.Json;
-using System.Text.Json.Serialization;
-using Microsoft.Extensions.AI;
-
-namespace Microsoft.Extensions.VectorData.ProviderServices;
-
-///
-/// Represents a model builder that performs logic specific to connectors that use System.Text.Json for serialization.
-/// This is an internal support type meant for use by connectors only and not by applications.
-///
-[Experimental("MEVD9001")]
-public abstract class CollectionJsonModelBuilder : CollectionModelBuilder
-{
- private JsonSerializerOptions? _jsonSerializerOptions;
-
- ///
- /// Constructs a new .
- ///
- protected CollectionJsonModelBuilder(CollectionModelBuildingOptions options)
- : base(options)
- {
- }
-
- ///
- /// Builds and returns a from the given and .
- ///
- [RequiresDynamicCode("This model building variant is not compatible with NativeAOT. See BuildDynamic() for dynamic mapping, and a third variant accepting source-generated delegates will be introduced in the future.")]
- [RequiresUnreferencedCode("This model building variant is not compatible with trimming. See BuildDynamic() for dynamic mapping, and a third variant accepting source-generated delegates will be introduced in the future.")]
- public virtual CollectionModel Build(
- Type recordType,
- Type keyType,
- VectorStoreCollectionDefinition? definition,
- IEmbeddingGenerator? defaultEmbeddingGenerator,
- JsonSerializerOptions jsonSerializerOptions)
- {
- this._jsonSerializerOptions = jsonSerializerOptions;
-
- return this.Build(recordType, keyType, definition, defaultEmbeddingGenerator);
- }
-
- ///
- /// Builds and returns a for dynamic mapping scenarios from the given .
- ///
- public virtual CollectionModel BuildDynamic(
- VectorStoreCollectionDefinition definition,
- IEmbeddingGenerator? defaultEmbeddingGenerator,
- JsonSerializerOptions jsonSerializerOptions)
- {
- this._jsonSerializerOptions = jsonSerializerOptions;
-
- return this.BuildDynamic(definition, defaultEmbeddingGenerator);
- }
-
- ///
- protected override void Customize()
- {
- // This mimics the naming behavior of the System.Text.Json serializer, which we use for serialization/deserialization.
- // The property storage names in the model must in sync with the serializer configuration, since the model is used e.g. for filtering
- // even if serialization/deserialization doesn't use the model.
- var namingPolicy = this._jsonSerializerOptions?.PropertyNamingPolicy;
-
- foreach (var property in this.Properties)
- {
- var keyPropertyWithReservedName = this.Options.ReservedKeyStorageName is not null && property is KeyPropertyModel;
- string storageName;
-
- if (property.PropertyInfo?.GetCustomAttribute() is { } jsonPropertyNameAttribute)
- {
- if (keyPropertyWithReservedName && jsonPropertyNameAttribute.Name != this.Options.ReservedKeyStorageName)
- {
- throw new InvalidOperationException($"The key property for your connector must always have the reserved name '{this.Options.ReservedKeyStorageName}' and cannot be changed.");
- }
-
- storageName = jsonPropertyNameAttribute.Name;
- }
- else if (namingPolicy is not null)
- {
- storageName = namingPolicy.ConvertName(property.ModelName);
- }
- else
- {
- storageName = property.ModelName;
- }
-
- if (keyPropertyWithReservedName)
- {
- // Some providers (Weaviate, Cosmos NoSQL) have a fixed, reserved storage name for keys (id), and at the same time use an external
- // JSON serializer to serialize the entire user POCO. Since the serializer is unaware of the reserved storage name, it will produce
- // a storage name as usual, based on the .NET property's name, possibly with a naming policy applied to it. The connector then needs
- // to look that up and replace with the reserved name.
- ((KeyPropertyModel)property).SerializedKeyName = storageName;
- }
- else
- {
- property.StorageName = storageName;
- }
- }
- }
-}
diff --git a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModel.cs b/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModel.cs
deleted file mode 100644
index 7f837038dfa6..000000000000
--- a/dotnet/src/VectorData/VectorData.Abstractions/ProviderServices/CollectionModel.cs
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright (c) Microsoft. All rights reserved.
-
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Diagnostics.CodeAnalysis;
-using System.Linq;
-using System.Linq.Expressions;
-using System.Reflection;
-using System.Runtime.CompilerServices;
-
-namespace Microsoft.Extensions.VectorData.ProviderServices;
-
-///
-/// Represents a record in a vector store collection.
-/// This is an internal support type meant for use by connectors only and not by applications.
-///
-[Experimental("MEVD9001")]
-public sealed class CollectionModel
-{
- private readonly Type _recordType;
- private readonly Func