diff --git a/dotnet/samples/Concepts/Memory/VectorStoreEmbeddingGeneration/TextEmbeddingVectorStoreRecordCollection.cs b/dotnet/samples/Concepts/Memory/VectorStoreEmbeddingGeneration/TextEmbeddingVectorStoreRecordCollection.cs index a3c5517653af..5c1c4b05c56f 100644 --- a/dotnet/samples/Concepts/Memory/VectorStoreEmbeddingGeneration/TextEmbeddingVectorStoreRecordCollection.cs +++ b/dotnet/samples/Concepts/Memory/VectorStoreEmbeddingGeneration/TextEmbeddingVectorStoreRecordCollection.cs @@ -77,15 +77,15 @@ public Task DeleteCollectionAsync(CancellationToken cancellationToken = default) } /// - public Task DeleteAsync(TKey key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(TKey key, CancellationToken cancellationToken = default) { - return this._decoratedVectorStoreRecordCollection.DeleteAsync(key, options, cancellationToken); + return this._decoratedVectorStoreRecordCollection.DeleteAsync(key, cancellationToken); } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { - return this._decoratedVectorStoreRecordCollection.DeleteBatchAsync(keys, options, cancellationToken); + return this._decoratedVectorStoreRecordCollection.DeleteBatchAsync(keys, cancellationToken); } /// @@ -101,18 +101,18 @@ public IAsyncEnumerable GetBatchAsync(IEnumerable keys, GetRecord } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { var recordWithEmbeddings = await this.AddEmbeddingsAsync(record, cancellationToken).ConfigureAwait(false); - return await this._decoratedVectorStoreRecordCollection.UpsertAsync(recordWithEmbeddings, options, cancellationToken).ConfigureAwait(false); + return await this._decoratedVectorStoreRecordCollection.UpsertAsync(recordWithEmbeddings, cancellationToken).ConfigureAwait(false); } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { var recordWithEmbeddingsTasks = records.Select(r => this.AddEmbeddingsAsync(r, cancellationToken)); var recordWithEmbeddings = await Task.WhenAll(recordWithEmbeddingsTasks).ConfigureAwait(false); - var upsertResults = this._decoratedVectorStoreRecordCollection.UpsertBatchAsync(recordWithEmbeddings, options, cancellationToken); + var upsertResults = this._decoratedVectorStoreRecordCollection.UpsertBatchAsync(recordWithEmbeddings, cancellationToken); await foreach (var upsertResult in upsertResults.ConfigureAwait(false)) { yield return upsertResult; diff --git a/dotnet/samples/Concepts/Memory/VectorStoreLangchainInterop/MappingVectorStoreRecordCollection.cs b/dotnet/samples/Concepts/Memory/VectorStoreLangchainInterop/MappingVectorStoreRecordCollection.cs index 581ed6bf2565..076be09c9ca5 100644 --- a/dotnet/samples/Concepts/Memory/VectorStoreLangchainInterop/MappingVectorStoreRecordCollection.cs +++ b/dotnet/samples/Concepts/Memory/VectorStoreLangchainInterop/MappingVectorStoreRecordCollection.cs @@ -64,15 +64,15 @@ public Task CreateCollectionIfNotExistsAsync(CancellationToken cancellationToken } /// - public Task DeleteAsync(TPublicKey key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(TPublicKey key, CancellationToken cancellationToken = default) { - return this._collection.DeleteAsync(this._publicToInternalKeyMapper(key), options, cancellationToken); + return this._collection.DeleteAsync(this._publicToInternalKeyMapper(key), cancellationToken); } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { - return this._collection.DeleteBatchAsync(keys.Select(this._publicToInternalKeyMapper), options, cancellationToken); + return this._collection.DeleteBatchAsync(keys.Select(this._publicToInternalKeyMapper), cancellationToken); } /// @@ -101,18 +101,18 @@ public IAsyncEnumerable GetBatchAsync(IEnumerable key } /// - public async Task UpsertAsync(TPublicRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TPublicRecord record, CancellationToken cancellationToken = default) { var internalRecord = this._publicToInternalRecordMapper(record); - var internalKey = await this._collection.UpsertAsync(internalRecord, options, cancellationToken).ConfigureAwait(false); + var internalKey = await this._collection.UpsertAsync(internalRecord, cancellationToken).ConfigureAwait(false); return this._internalToPublicKeyMapper(internalKey); } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { var internalRecords = records.Select(this._publicToInternalRecordMapper); - var internalKeys = this._collection.UpsertBatchAsync(internalRecords, options, cancellationToken); + var internalKeys = this._collection.UpsertBatchAsync(internalRecords, cancellationToken); await foreach (var internalKey in internalKeys.ConfigureAwait(false)) { yield return this._internalToPublicKeyMapper(internalKey); diff --git a/dotnet/samples/GettingStartedWithVectorStores/Step4_NonStringKey_VectorStore.cs b/dotnet/samples/GettingStartedWithVectorStores/Step4_NonStringKey_VectorStore.cs index 906df16d84a1..7303ddc9801a 100644 --- a/dotnet/samples/GettingStartedWithVectorStores/Step4_NonStringKey_VectorStore.cs +++ b/dotnet/samples/GettingStartedWithVectorStores/Step4_NonStringKey_VectorStore.cs @@ -124,15 +124,15 @@ public Task CreateCollectionIfNotExistsAsync(CancellationToken cancellationToken } /// - public Task DeleteAsync(TPublicKey key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(TPublicKey key, CancellationToken cancellationToken = default) { - return this._collection.DeleteAsync(this._publicToInternalKeyMapper(key), options, cancellationToken); + return this._collection.DeleteAsync(this._publicToInternalKeyMapper(key), cancellationToken); } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { - return this._collection.DeleteBatchAsync(keys.Select(this._publicToInternalKeyMapper), options, cancellationToken); + return this._collection.DeleteBatchAsync(keys.Select(this._publicToInternalKeyMapper), cancellationToken); } /// @@ -161,18 +161,18 @@ public IAsyncEnumerable GetBatchAsync(IEnumerable key } /// - public async Task UpsertAsync(TPublicRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TPublicRecord record, CancellationToken cancellationToken = default) { var internalRecord = this._publicToInternalRecordMapper(record); - var internalKey = await this._collection.UpsertAsync(internalRecord, options, cancellationToken).ConfigureAwait(false); + var internalKey = await this._collection.UpsertAsync(internalRecord, cancellationToken).ConfigureAwait(false); return this._internalToPublicKeyMapper(internalKey); } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { var internalRecords = records.Select(this._publicToInternalRecordMapper); - var internalKeys = this._collection.UpsertBatchAsync(internalRecords, options, cancellationToken); + var internalKeys = this._collection.UpsertBatchAsync(internalRecords, cancellationToken); await foreach (var internalKey in internalKeys.ConfigureAwait(false)) { yield return this._internalToPublicKeyMapper(internalKey); diff --git a/dotnet/src/Connectors/Connectors.AzureAISearch.UnitTests/AzureAISearchVectorStoreRecordCollectionTests.cs b/dotnet/src/Connectors/Connectors.AzureAISearch.UnitTests/AzureAISearchVectorStoreRecordCollectionTests.cs index 1d0a4d90bb34..467207b29ace 100644 --- a/dotnet/src/Connectors/Connectors.AzureAISearch.UnitTests/AzureAISearchVectorStoreRecordCollectionTests.cs +++ b/dotnet/src/Connectors/Connectors.AzureAISearch.UnitTests/AzureAISearchVectorStoreRecordCollectionTests.cs @@ -514,10 +514,7 @@ public async Task CanUpsertRecordWithCustomMapperAsync() }); // Act. - await sut.UpsertAsync( - model, - null, - this._testCancellationToken); + await sut.UpsertAsync(model, this._testCancellationToken); // Assert. mapperMock diff --git a/dotnet/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs index 7658b52fc702..bdf25bd2b8a4 100644 --- a/dotnet/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.AzureAISearch/AzureAISearchVectorStoreRecordCollection.cs @@ -263,7 +263,7 @@ public async IAsyncEnumerable GetBatchAsync(IEnumerable keys, G } /// - public Task DeleteAsync(string key, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteAsync(string key, CancellationToken cancellationToken = default) { Verify.NotNullOrWhiteSpace(key); @@ -274,7 +274,7 @@ public Task DeleteAsync(string key, DeleteRecordOptions? options = default, Canc } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); @@ -285,7 +285,7 @@ public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? opti } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = default, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -298,7 +298,7 @@ public async Task UpsertAsync(TRecord record, UpsertRecordOptions? optio } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = default, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); diff --git a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBMongoDB/AzureCosmosDBMongoDBVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBMongoDB/AzureCosmosDBMongoDBVectorStoreRecordCollection.cs index 94f423743d65..d54a184e5771 100644 --- a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBMongoDB/AzureCosmosDBMongoDBVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBMongoDB/AzureCosmosDBMongoDBVectorStoreRecordCollection.cs @@ -117,7 +117,7 @@ public async Task CreateCollectionIfNotExistsAsync(CancellationToken cancellatio } /// - public async Task DeleteAsync(string key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string key, CancellationToken cancellationToken = default) { Verify.NotNullOrWhiteSpace(key); @@ -126,7 +126,7 @@ await this.RunOperationAsync("DeleteOne", () => this._mongoCollection.DeleteOneA } /// - public async Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); @@ -199,7 +199,7 @@ public async IAsyncEnumerable GetBatchAsync( } /// - public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -225,14 +225,11 @@ await this._mongoCollection } /// - public async IAsyncEnumerable UpsertBatchAsync( - IEnumerable records, - UpsertRecordOptions? options = null, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); - var tasks = records.Select(record => this.UpsertAsync(record, options, cancellationToken)); + var tasks = records.Select(record => this.UpsertAsync(record, cancellationToken)); var results = await Task.WhenAll(tasks).ConfigureAwait(false); foreach (var result in results) @@ -278,7 +275,7 @@ public async Task> VectorizedSearchAsync( this._storagePropertyNames); // Constructing a query to fetch "skip + top" total items - // to perform skip logic locally, since skip option is not part of API. + // to perform skip logic locally, since skip option is not part of API. var itemsAmount = searchOptions.Skip + searchOptions.Top; var vectorPropertyIndexKind = AzureCosmosDBMongoDBVectorStoreCollectionSearchMapping.GetVectorPropertyIndexKind(vectorProperty.IndexKind); diff --git a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs index ba993c758dc8..6ab9222d2a14 100644 --- a/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.AzureCosmosDBNoSQL/AzureCosmosDBNoSQLVectorStoreRecordCollection.cs @@ -215,7 +215,7 @@ public Task DeleteCollectionAsync(CancellationToken cancellationToken = default) #region Implementation of IVectorStoreRecordCollection /// - public Task DeleteAsync(string key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(string key, CancellationToken cancellationToken = default) { // Use record key as partition key var compositeKey = new AzureCosmosDBNoSQLCompositeKey(recordKey: key, partitionKey: key); @@ -224,7 +224,7 @@ public Task DeleteAsync(string key, DeleteRecordOptions? options = null, Cancell } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { // Use record keys as partition keys var compositeKeys = keys.Select(key => new AzureCosmosDBNoSQLCompositeKey(recordKey: key, partitionKey: key)); @@ -262,7 +262,7 @@ public async IAsyncEnumerable GetBatchAsync( } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { var key = await this.InternalUpsertAsync(record, cancellationToken).ConfigureAwait(false); @@ -270,10 +270,7 @@ public async Task UpsertAsync(TRecord record, UpsertRecordOptions? optio } /// - public async IAsyncEnumerable UpsertBatchAsync( - IEnumerable records, - UpsertRecordOptions? options = null, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); @@ -318,19 +315,19 @@ public async IAsyncEnumerable GetBatchAsync( } /// - public Task DeleteAsync(AzureCosmosDBNoSQLCompositeKey key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(AzureCosmosDBNoSQLCompositeKey key, CancellationToken cancellationToken = default) { return this.InternalDeleteAsync([key], cancellationToken); } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { return this.InternalDeleteAsync(keys, cancellationToken); } /// - Task IVectorStoreRecordCollection.UpsertAsync(TRecord record, UpsertRecordOptions? options, CancellationToken cancellationToken) + Task IVectorStoreRecordCollection.UpsertAsync(TRecord record, CancellationToken cancellationToken) { return this.InternalUpsertAsync(record, cancellationToken); } @@ -338,7 +335,6 @@ Task IVectorStoreRecordCollection async IAsyncEnumerable IVectorStoreRecordCollection.UpsertBatchAsync( IEnumerable records, - UpsertRecordOptions? options, [EnumeratorCancellation] CancellationToken cancellationToken) { Verify.NotNull(records); diff --git a/dotnet/src/Connectors/Connectors.Memory.InMemory/InMemoryVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.InMemory/InMemoryVectorStoreRecordCollection.cs index 3526990f18b0..a2fe21e0cfc6 100644 --- a/dotnet/src/Connectors/Connectors.Memory.InMemory/InMemoryVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.InMemory/InMemoryVectorStoreRecordCollection.cs @@ -165,7 +165,7 @@ public async IAsyncEnumerable GetBatchAsync(IEnumerable keys, Get } /// - public Task DeleteAsync(TKey key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(TKey key, CancellationToken cancellationToken = default) { var collectionDictionary = this.GetCollectionDictionary(); @@ -174,7 +174,7 @@ public Task DeleteAsync(TKey key, DeleteRecordOptions? options = null, Cancellat } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { var collectionDictionary = this.GetCollectionDictionary(); @@ -187,7 +187,7 @@ public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? option } /// - public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -200,11 +200,11 @@ public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = nul } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { foreach (var record in records) { - yield return await this.UpsertAsync(record, options, cancellationToken).ConfigureAwait(false); + yield return await this.UpsertAsync(record, cancellationToken).ConfigureAwait(false); } } diff --git a/dotnet/src/Connectors/Connectors.Memory.MongoDB/MongoDBVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.MongoDB/MongoDBVectorStoreRecordCollection.cs index f27c8a975bc3..353b3534dab9 100644 --- a/dotnet/src/Connectors/Connectors.Memory.MongoDB/MongoDBVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.MongoDB/MongoDBVectorStoreRecordCollection.cs @@ -120,7 +120,7 @@ public async Task CreateCollectionIfNotExistsAsync(CancellationToken cancellatio } /// - public async Task DeleteAsync(string key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string key, CancellationToken cancellationToken = default) { Verify.NotNullOrWhiteSpace(key); @@ -129,7 +129,7 @@ await this.RunOperationAsync("DeleteOne", () => this._mongoCollection.DeleteOneA } /// - public async Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); @@ -202,7 +202,7 @@ public async IAsyncEnumerable GetBatchAsync( } /// - public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -228,14 +228,11 @@ await this._mongoCollection } /// - public async IAsyncEnumerable UpsertBatchAsync( - IEnumerable records, - UpsertRecordOptions? options = null, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); - var tasks = records.Select(record => this.UpsertAsync(record, options, cancellationToken)); + var tasks = records.Select(record => this.UpsertAsync(record, cancellationToken)); var results = await Task.WhenAll(tasks).ConfigureAwait(false); foreach (var result in results) @@ -281,7 +278,7 @@ public async Task> VectorizedSearchAsync( this._storagePropertyNames); // Constructing a query to fetch "skip + top" total items - // to perform skip logic locally, since skip option is not part of API. + // to perform skip logic locally, since skip option is not part of API. var itemsAmount = searchOptions.Skip + searchOptions.Top; var numCandidates = this._options.NumCandidates ?? itemsAmount * MongoDBConstants.DefaultNumCandidatesRatio; diff --git a/dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeVectorStoreRecordCollection.cs index 3ae05bd4f0f6..8a956f53f635 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Pinecone/PineconeVectorStoreRecordCollection.cs @@ -177,15 +177,15 @@ public async IAsyncEnumerable GetBatchAsync( } /// - public Task DeleteAsync(string key, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteAsync(string key, CancellationToken cancellationToken = default) { Verify.NotNullOrWhiteSpace(key); - return this.DeleteBatchAsync([key], options, cancellationToken); + return this.DeleteBatchAsync([key], cancellationToken); } /// - public async Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public async Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); @@ -199,7 +199,7 @@ await this.RunOperationAsync( } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = default, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -221,10 +221,7 @@ await this.RunOperationAsync( } /// - public async IAsyncEnumerable UpsertBatchAsync( - IEnumerable records, - UpsertRecordOptions? options = default, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); diff --git a/dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreRecordCollection.cs index 95c8a4bcf282..de4a432ea48c 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Postgres/PostgresVectorStoreRecordCollection.cs @@ -141,7 +141,7 @@ public Task DeleteCollectionAsync(CancellationToken cancellationToken = default) } /// - public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { const string OperationName = "Upsert"; @@ -166,7 +166,7 @@ public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = nul } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { const string OperationName = "UpsertBatch"; @@ -232,7 +232,7 @@ public IAsyncEnumerable GetBatchAsync(IEnumerable keys, GetRecord } /// - public Task DeleteAsync(TKey key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(TKey key, CancellationToken cancellationToken = default) { const string OperationName = "Delete"; return this.RunOperationAsync(OperationName, () => @@ -241,7 +241,7 @@ public Task DeleteAsync(TKey key, DeleteRecordOptions? options = null, Cancellat } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { const string OperationName = "DeleteBatch"; return this.RunOperationAsync(OperationName, () => diff --git a/dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorStoreRecordCollection.cs index 6ddf009391b9..7dd77b76baff 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Qdrant/QdrantVectorStoreRecordCollection.cs @@ -268,7 +268,7 @@ public IAsyncEnumerable GetBatchAsync(IEnumerable keys, GetRecord } /// - public Task DeleteAsync(ulong key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(ulong key, CancellationToken cancellationToken = default) { Verify.NotNull(key); @@ -282,7 +282,7 @@ public Task DeleteAsync(ulong key, DeleteRecordOptions? options = null, Cancella } /// - public Task DeleteAsync(Guid key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(Guid key, CancellationToken cancellationToken = default) { Verify.NotNull(key); @@ -296,7 +296,7 @@ public Task DeleteAsync(Guid key, DeleteRecordOptions? options = null, Cancellat } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); @@ -310,7 +310,7 @@ public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? optio } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); @@ -324,7 +324,7 @@ public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? option } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = default, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -343,7 +343,7 @@ await this.RunOperationAsync( } /// - async Task IVectorStoreRecordCollection.UpsertAsync(TRecord record, UpsertRecordOptions? options, CancellationToken cancellationToken) + async Task IVectorStoreRecordCollection.UpsertAsync(TRecord record, CancellationToken cancellationToken) { Verify.NotNull(record); @@ -362,7 +362,7 @@ await this.RunOperationAsync( } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = default, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); @@ -385,7 +385,7 @@ await this.RunOperationAsync( } /// - async IAsyncEnumerable IVectorStoreRecordCollection.UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options, [EnumeratorCancellation] CancellationToken cancellationToken) + async IAsyncEnumerable IVectorStoreRecordCollection.UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken) { Verify.NotNull(records); diff --git a/dotnet/src/Connectors/Connectors.Memory.Redis/RedisHashSetVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.Redis/RedisHashSetVectorStoreRecordCollection.cs index ebf21a7cf5a2..41971c5adb86 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Redis/RedisHashSetVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Redis/RedisHashSetVectorStoreRecordCollection.cs @@ -262,7 +262,7 @@ public async IAsyncEnumerable GetBatchAsync(IEnumerable keys, G } /// - public Task DeleteAsync(string key, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteAsync(string key, CancellationToken cancellationToken = default) { Verify.NotNullOrWhiteSpace(key); @@ -277,17 +277,17 @@ public Task DeleteAsync(string key, DeleteRecordOptions? options = default, Canc } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); // Remove records in parallel. - var tasks = keys.Select(key => this.DeleteAsync(key, options, cancellationToken)); + var tasks = keys.Select(key => this.DeleteAsync(key, cancellationToken)); return Task.WhenAll(tasks); } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = default, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -311,12 +311,12 @@ await this.RunOperationAsync( } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = default, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); // Upsert records in parallel. - var tasks = records.Select(x => this.UpsertAsync(x, options, cancellationToken)); + var tasks = records.Select(x => this.UpsertAsync(x, cancellationToken)); var results = await Task.WhenAll(tasks).ConfigureAwait(false); foreach (var result in results) { diff --git a/dotnet/src/Connectors/Connectors.Memory.Redis/RedisJsonVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.Redis/RedisJsonVectorStoreRecordCollection.cs index 08fb1155ee60..f8afa3ed875e 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Redis/RedisJsonVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Redis/RedisJsonVectorStoreRecordCollection.cs @@ -278,7 +278,7 @@ public async IAsyncEnumerable GetBatchAsync(IEnumerable keys, G } /// - public Task DeleteAsync(string key, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteAsync(string key, CancellationToken cancellationToken = default) { Verify.NotNullOrWhiteSpace(key); @@ -294,17 +294,17 @@ public Task DeleteAsync(string key, DeleteRecordOptions? options = default, Canc } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { Verify.NotNull(keys); // Remove records in parallel. - var tasks = keys.Select(key => this.DeleteAsync(key, options, cancellationToken)); + var tasks = keys.Select(key => this.DeleteAsync(key, cancellationToken)); return Task.WhenAll(tasks); } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = default, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -335,7 +335,7 @@ await this.RunOperationAsync( } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = default, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { Verify.NotNull(records); diff --git a/dotnet/src/Connectors/Connectors.Memory.Sqlite/SqliteVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.Sqlite/SqliteVectorStoreRecordCollection.cs index 9b6d247e2a36..08c976abf43f 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Sqlite/SqliteVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Sqlite/SqliteVectorStoreRecordCollection.cs @@ -219,27 +219,27 @@ public IAsyncEnumerable GetBatchAsync(IEnumerable keys, GetRecor } /// - public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { - return this.InternalUpsertAsync(record, options, cancellationToken); + return this.InternalUpsertAsync(record, cancellationToken); } /// - public IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public IAsyncEnumerable UpsertBatchAsync(IEnumerable records, CancellationToken cancellationToken = default) { - return this.InternalUpsertBatchAsync(records, options, cancellationToken); + return this.InternalUpsertBatchAsync(records, cancellationToken); } /// - public Task DeleteAsync(ulong key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(ulong key, CancellationToken cancellationToken = default) { - return this.InternalDeleteAsync(key, options, cancellationToken); + return this.InternalDeleteAsync(key, cancellationToken); } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { - return this.InternalDeleteBatchAsync(keys, options, cancellationToken); + return this.InternalDeleteBatchAsync(keys, cancellationToken); } #endregion @@ -259,27 +259,27 @@ public IAsyncEnumerable GetBatchAsync(IEnumerable keys, GetReco } /// - Task IVectorStoreRecordCollection.UpsertAsync(TRecord record, UpsertRecordOptions? options, CancellationToken cancellationToken) + Task IVectorStoreRecordCollection.UpsertAsync(TRecord record, CancellationToken cancellationToken) { - return this.InternalUpsertAsync(record, options, cancellationToken); + return this.InternalUpsertAsync(record, cancellationToken); } /// - IAsyncEnumerable IVectorStoreRecordCollection.UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options, CancellationToken cancellationToken) + IAsyncEnumerable IVectorStoreRecordCollection.UpsertBatchAsync(IEnumerable records, CancellationToken cancellationToken) { - return this.InternalUpsertBatchAsync(records, options, cancellationToken); + return this.InternalUpsertBatchAsync(records, cancellationToken); } /// - public Task DeleteAsync(string key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(string key, CancellationToken cancellationToken = default) { - return this.InternalDeleteAsync(key, options, cancellationToken); + return this.InternalDeleteAsync(key, cancellationToken); } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { - return this.InternalDeleteBatchAsync(keys, options, cancellationToken); + return this.InternalDeleteBatchAsync(keys, cancellationToken); } #endregion @@ -475,10 +475,7 @@ private async IAsyncEnumerable InternalGetBatchAsync( } } - private async Task InternalUpsertAsync( - TRecord record, - UpsertRecordOptions? options, - CancellationToken cancellationToken) + private async Task InternalUpsertAsync(TRecord record, CancellationToken cancellationToken) { const string OperationName = "Upsert"; @@ -494,17 +491,14 @@ private async Task InternalUpsertAsync( var condition = new SqliteWhereEqualsCondition(this._propertyReader.KeyPropertyStoragePropertyName, key); - var upsertedRecordKey = await this.InternalUpsertBatchAsync([storageModel], condition, options, cancellationToken) + var upsertedRecordKey = await this.InternalUpsertBatchAsync([storageModel], condition, cancellationToken) .FirstOrDefaultAsync(cancellationToken) .ConfigureAwait(false); return upsertedRecordKey ?? throw new VectorStoreOperationException("Error occurred during upsert operation."); } - private IAsyncEnumerable InternalUpsertBatchAsync( - IEnumerable records, - UpsertRecordOptions? options, - CancellationToken cancellationToken) + private IAsyncEnumerable InternalUpsertBatchAsync(IEnumerable records, CancellationToken cancellationToken) { const string OperationName = "UpsertBatch"; @@ -518,13 +512,12 @@ private IAsyncEnumerable InternalUpsertBatchAsync( var condition = new SqliteWhereInCondition(this._propertyReader.KeyPropertyStoragePropertyName, keys); - return this.InternalUpsertBatchAsync(storageModels, condition, options, cancellationToken); + return this.InternalUpsertBatchAsync(storageModels, condition, cancellationToken); } private async IAsyncEnumerable InternalUpsertBatchAsync( List> storageModels, SqliteWhereCondition condition, - UpsertRecordOptions? options, [EnumeratorCancellation] CancellationToken cancellationToken) { Verify.NotNull(storageModels); @@ -571,22 +564,16 @@ private async IAsyncEnumerable InternalUpsertBatchAsync( } } - private Task InternalDeleteAsync( - TKey key, - DeleteRecordOptions? options, - CancellationToken cancellationToken) + private Task InternalDeleteAsync(TKey key, CancellationToken cancellationToken) { Verify.NotNull(key); var condition = new SqliteWhereEqualsCondition(this._propertyReader.KeyPropertyStoragePropertyName, key); - return this.InternalDeleteBatchAsync(condition, options, cancellationToken); + return this.InternalDeleteBatchAsync(condition, cancellationToken); } - private Task InternalDeleteBatchAsync( - IEnumerable keys, - DeleteRecordOptions? options, - CancellationToken cancellationToken) + private Task InternalDeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken) { Verify.NotNull(keys); @@ -598,13 +585,10 @@ private Task InternalDeleteBatchAsync( this._propertyReader.KeyPropertyStoragePropertyName, keysList); - return this.InternalDeleteBatchAsync(condition, options, cancellationToken); + return this.InternalDeleteBatchAsync(condition, cancellationToken); } - private Task InternalDeleteBatchAsync( - SqliteWhereCondition condition, - DeleteRecordOptions? options, - CancellationToken cancellationToken) + private Task InternalDeleteBatchAsync(SqliteWhereCondition condition, CancellationToken cancellationToken) { const string OperationName = "Delete"; diff --git a/dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateVectorStoreRecordCollection.cs b/dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateVectorStoreRecordCollection.cs index 64eb3b91002f..a4ba633535a7 100644 --- a/dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/Connectors.Memory.Weaviate/WeaviateVectorStoreRecordCollection.cs @@ -213,7 +213,7 @@ public Task DeleteCollectionAsync(CancellationToken cancellationToken = default) } /// - public Task DeleteAsync(Guid key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(Guid key, CancellationToken cancellationToken = default) { const string OperationName = "DeleteObject"; @@ -226,7 +226,7 @@ public Task DeleteAsync(Guid key, DeleteRecordOptions? options = null, Cancellat } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { const string OperationName = "DeleteObjectBatch"; const string ContainsAnyOperator = "ContainsAny"; @@ -295,18 +295,15 @@ public async IAsyncEnumerable GetBatchAsync( } /// - public async Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public async Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { - return await this.UpsertBatchAsync([record], options, cancellationToken) + return await this.UpsertBatchAsync([record], cancellationToken) .FirstOrDefaultAsync(cancellationToken) .ConfigureAwait(false); } /// - public async IAsyncEnumerable UpsertBatchAsync( - IEnumerable records, - UpsertRecordOptions? options = null, - [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { const string OperationName = "UpsertCollectionObject"; diff --git a/dotnet/src/Connectors/Connectors.Qdrant.UnitTests/QdrantVectorStoreRecordCollectionTests.cs b/dotnet/src/Connectors/Connectors.Qdrant.UnitTests/QdrantVectorStoreRecordCollectionTests.cs index 7d215ab2eeac..1bb89a91344e 100644 --- a/dotnet/src/Connectors/Connectors.Qdrant.UnitTests/QdrantVectorStoreRecordCollectionTests.cs +++ b/dotnet/src/Connectors/Connectors.Qdrant.UnitTests/QdrantVectorStoreRecordCollectionTests.cs @@ -510,10 +510,7 @@ public async Task CanUpsertRecordWithCustomMapperAsync() var model = CreateModel(UlongTestRecordKey1, true); // Act - await sut.UpsertAsync( - model, - null, - this._testCancellationToken); + await sut.UpsertAsync(model, this._testCancellationToken); // Assert mapperMock diff --git a/dotnet/src/Connectors/VectorData.Abstractions/CompatibilitySuppressions.xml b/dotnet/src/Connectors/VectorData.Abstractions/CompatibilitySuppressions.xml new file mode 100644 index 000000000000..0860b81e7585 --- /dev/null +++ b/dotnet/src/Connectors/VectorData.Abstractions/CompatibilitySuppressions.xml @@ -0,0 +1,214 @@ + + + + + CP0001 + T:Microsoft.Extensions.VectorData.DeleteRecordOptions + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0001 + T:Microsoft.Extensions.VectorData.UpsertRecordOptions + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0001 + T:Microsoft.Extensions.VectorData.DeleteRecordOptions + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0001 + T:Microsoft.Extensions.VectorData.UpsertRecordOptions + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0001 + T:Microsoft.Extensions.VectorData.DeleteRecordOptions + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0001 + T:Microsoft.Extensions.VectorData.UpsertRecordOptions + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteAsync(`0,Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertAsync(`1,Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteAsync(`0,Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertAsync(`1,Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteAsync(`0,Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertAsync(`1,Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0002 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteAsync(`0,System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertAsync(`1,System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},System.Threading.CancellationToken) + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net462/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteAsync(`0,System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertAsync(`1,System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},System.Threading.CancellationToken) + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/net8.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteAsync(`0,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertAsync(`1,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + + CP0006 + M:Microsoft.Extensions.VectorData.IVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + lib/netstandard2.0/Microsoft.Extensions.VectorData.Abstractions.dll + true + + \ No newline at end of file diff --git a/dotnet/src/Connectors/VectorData.Abstractions/RecordOptions/DeleteRecordOptions.cs b/dotnet/src/Connectors/VectorData.Abstractions/RecordOptions/DeleteRecordOptions.cs deleted file mode 100644 index cc1ebd74745e..000000000000 --- a/dotnet/src/Connectors/VectorData.Abstractions/RecordOptions/DeleteRecordOptions.cs +++ /dev/null @@ -1,27 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace Microsoft.Extensions.VectorData; - -/// -/// Options when calling . -/// -/// -/// This class does not currently include any options, but is added for future extensibility of the API. -/// -public class DeleteRecordOptions -{ - /// - /// Initializes a new instance of the class. - /// - public DeleteRecordOptions() - { - } - - /// - /// Initializes a new instance of the class by cloning the given options. - /// - /// The options to clone - public DeleteRecordOptions(DeleteRecordOptions source) - { - } -} diff --git a/dotnet/src/Connectors/VectorData.Abstractions/RecordOptions/UpsertRecordOptions.cs b/dotnet/src/Connectors/VectorData.Abstractions/RecordOptions/UpsertRecordOptions.cs deleted file mode 100644 index bc6e0b2dd52b..000000000000 --- a/dotnet/src/Connectors/VectorData.Abstractions/RecordOptions/UpsertRecordOptions.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -namespace Microsoft.Extensions.VectorData; - -/// -/// Options when calling . -/// Reserved for future use. -/// -/// -/// This class does not currently include any options, but is added for future extensibility of the API. -/// -public class UpsertRecordOptions -{ - /// - /// Initializes a new instance of the class. - /// - public UpsertRecordOptions() - { - } - - /// - /// Initializes a new instance of the class by cloning the given options. - /// - /// The options to clone - public UpsertRecordOptions(UpsertRecordOptions source) - { - } -} diff --git a/dotnet/src/Connectors/VectorData.Abstractions/VectorStorage/IVectorStoreRecordCollection.cs b/dotnet/src/Connectors/VectorData.Abstractions/VectorStorage/IVectorStoreRecordCollection.cs index 1aacdff332fa..6415ed35fe59 100644 --- a/dotnet/src/Connectors/VectorData.Abstractions/VectorStorage/IVectorStoreRecordCollection.cs +++ b/dotnet/src/Connectors/VectorData.Abstractions/VectorStorage/IVectorStoreRecordCollection.cs @@ -79,11 +79,10 @@ public interface IVectorStoreRecordCollection : IVectorizedSearch /// Deletes a record from the vector store. Does not guarantee that the collection exists. /// /// The unique id associated with the record to remove. - /// Optional options for removing the record. /// The to monitor for cancellation requests. The default is . /// The unique identifier for the record. /// Throw when the command fails to execute for any reason other than that the record does not exit. - Task DeleteAsync(TKey key, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default); + Task DeleteAsync(TKey key, CancellationToken cancellationToken = default); /// /// Deletes a batch of records from the vector store. Does not guarantee that the collection exists. @@ -92,11 +91,10 @@ public interface IVectorStoreRecordCollection : IVectorizedSearch /// If any record cannot be deleted for any other reason, the operation will throw. Some records may have already been deleted, while others may not, so the entire operation should be retried. /// /// The unique ids associated with the records to remove. - /// Optional options for removing the records. /// The to monitor for cancellation requests. The default is . /// A that completes when the records have been deleted. /// Throw when the command fails to execute for any reason other than that a record does not exist. - Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = default, CancellationToken cancellationToken = default); + Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default); /// /// Upserts a record into the vector store. Does not guarantee that the collection exists. @@ -104,12 +102,11 @@ public interface IVectorStoreRecordCollection : IVectorizedSearch /// If the record does not exist, it will be created. /// /// The record to upsert. - /// Optional options for upserting the record. /// The to monitor for cancellation requests. The default is . /// The unique identifier for the record. /// Throw when the command fails to execute for any reason. /// Throw when mapping between the storage model and record data model fails. - Task UpsertAsync(TRecord record, UpsertRecordOptions? options = default, CancellationToken cancellationToken = default); + Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default); /// /// Upserts a group of records into the vector store. Does not guarantee that the collection exists. @@ -118,10 +115,9 @@ public interface IVectorStoreRecordCollection : IVectorizedSearch /// Upserts will be made in a single request or in a single parallel batch depending on the available store functionality. /// /// The records to upsert. - /// Optional options for upserting the records. /// The to monitor for cancellation requests. The default is . /// The unique identifiers for the records. /// Throw when the command fails to execute for any reason. /// Throw when mapping between the storage model and record data model fails. - IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = default, CancellationToken cancellationToken = default); + IAsyncEnumerable UpsertBatchAsync(IEnumerable records, CancellationToken cancellationToken = default); } diff --git a/dotnet/src/SemanticKernel.Core/CompatibilitySuppressions.xml b/dotnet/src/SemanticKernel.Core/CompatibilitySuppressions.xml new file mode 100644 index 000000000000..de2e33319a56 --- /dev/null +++ b/dotnet/src/SemanticKernel.Core/CompatibilitySuppressions.xml @@ -0,0 +1,60 @@ + + + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.DeleteAsync(`0,Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.SemanticKernel.Core.dll + lib/net8.0/Microsoft.SemanticKernel.Core.dll + true + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.SemanticKernel.Core.dll + lib/net8.0/Microsoft.SemanticKernel.Core.dll + true + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.UpsertAsync(`1,Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.SemanticKernel.Core.dll + lib/net8.0/Microsoft.SemanticKernel.Core.dll + true + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/net8.0/Microsoft.SemanticKernel.Core.dll + lib/net8.0/Microsoft.SemanticKernel.Core.dll + true + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.DeleteAsync(`0,Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + true + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.DeleteBatchAsync(System.Collections.Generic.IEnumerable{`0},Microsoft.Extensions.VectorData.DeleteRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + true + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.UpsertAsync(`1,Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + true + + + CP0002 + M:Microsoft.SemanticKernel.Data.VolatileVectorStoreRecordCollection`2.UpsertBatchAsync(System.Collections.Generic.IEnumerable{`1},Microsoft.Extensions.VectorData.UpsertRecordOptions,System.Threading.CancellationToken) + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + lib/netstandard2.0/Microsoft.SemanticKernel.Core.dll + true + + \ No newline at end of file diff --git a/dotnet/src/SemanticKernel.Core/Data/VolatileVectorStoreRecordCollection.cs b/dotnet/src/SemanticKernel.Core/Data/VolatileVectorStoreRecordCollection.cs index e68a3f2d5af2..da062934cfbb 100644 --- a/dotnet/src/SemanticKernel.Core/Data/VolatileVectorStoreRecordCollection.cs +++ b/dotnet/src/SemanticKernel.Core/Data/VolatileVectorStoreRecordCollection.cs @@ -168,7 +168,7 @@ public async IAsyncEnumerable GetBatchAsync(IEnumerable keys, Get } /// - public Task DeleteAsync(TKey key, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteAsync(TKey key, CancellationToken cancellationToken = default) { var collectionDictionary = this.GetCollectionDictionary(); @@ -177,7 +177,7 @@ public Task DeleteAsync(TKey key, DeleteRecordOptions? options = null, Cancellat } /// - public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task DeleteBatchAsync(IEnumerable keys, CancellationToken cancellationToken = default) { var collectionDictionary = this.GetCollectionDictionary(); @@ -190,7 +190,7 @@ public Task DeleteBatchAsync(IEnumerable keys, DeleteRecordOptions? option } /// - public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = null, CancellationToken cancellationToken = default) + public Task UpsertAsync(TRecord record, CancellationToken cancellationToken = default) { Verify.NotNull(record); @@ -203,11 +203,11 @@ public Task UpsertAsync(TRecord record, UpsertRecordOptions? options = nul } /// - public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, UpsertRecordOptions? options = null, [EnumeratorCancellation] CancellationToken cancellationToken = default) + public async IAsyncEnumerable UpsertBatchAsync(IEnumerable records, [EnumeratorCancellation] CancellationToken cancellationToken = default) { foreach (var record in records) { - yield return await this.UpsertAsync(record, options, cancellationToken).ConfigureAwait(false); + yield return await this.UpsertAsync(record, cancellationToken).ConfigureAwait(false); } }