Skip to content

Commit

Permalink
.Net: Remove experimental flag from VectorStore implementations. (#9624)
Browse files Browse the repository at this point in the history
### Motivation and Context

As part of graduating vector stores we want to remove the experimental
flag from the implementations and only keep them on memory store
implementations.

#8539

### Description

- Remove experimental flag from packages with vector store
implementations.
- Add experimental flag to any memory store files in the same package.
- Clean up warning suppressions in vector store projects.

### Contribution Checklist

<!-- Before submitting this PR, please make sure: -->

- [x] The code builds clean without any errors or warnings
- [x] The PR follows the [SK Contribution
Guidelines](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md)
and the [pre-submission formatting
script](https://github.com/microsoft/semantic-kernel/blob/main/CONTRIBUTING.md#development-scripts)
raises no violations
- [x] All unit tests pass, and I have added new tests where possible
- [x] I didn't break anyone 😄
  • Loading branch information
westey-m authored Nov 11, 2024
1 parent 4a16849 commit 14bc62a
Show file tree
Hide file tree
Showing 106 changed files with 200 additions and 54 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;

// This assembly is currently experimental.
[assembly: Experimental("SKEXP0020")]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using System.Text.Json.Serialization;
using Microsoft.SemanticKernel.Memory;
Expand All @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureAISearch;
/// Azure AI Search record and index definition.
/// Note: once defined, index cannot be modified.
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class AzureAISearchMemoryRecord
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
Expand All @@ -23,6 +24,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureAISearch;
/// <summary>
/// <see cref="AzureAISearchMemoryStore"/> is a memory store implementation using Azure AI Search.
/// </summary>
[Experimental("SKEXP0020")]
public partial class AzureAISearchMemoryStore : IMemoryStore
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
<RootNamespace>Microsoft.SemanticKernel.Connectors.AzureAISearch</RootNamespace>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<VersionSuffix>preview</VersionSuffix>
<!--NU5104: A stable release of a package should not have a prerelease dependency.-->
<NoWarn>$(NoWarn);NU5104</NoWarn>
</PropertyGroup>

<!-- IMPORT NUGET PACKAGE SHARED PROPERTIES -->
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;

// This assembly is currently experimental.
[assembly: Experimental("SKEXP0020")]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using Microsoft.SemanticKernel.Http;

namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB;
Expand All @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB;
/// <remarks>
/// Initialize the <see cref="AzureCosmosDBMongoDBConfig"/> with default values.
/// </remarks>
[Experimental("SKEXP0020")]
public class AzureCosmosDBMongoDBConfig(int dimensions)
{
private const string DefaultIndexName = "default_index";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using Microsoft.SemanticKernel.Memory;
using MongoDB.Bson;
Expand All @@ -12,6 +13,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB;
/// <summary>
/// A MongoDB memory record.
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class AzureCosmosDBMongoDBMemoryRecord
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using Microsoft.SemanticKernel.Memory;
using MongoDB.Bson.Serialization.Attributes;

Expand All @@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB;
/// A MongoDB memory record metadata.
/// </summary>
#pragma warning disable CA1815 // Override equals and operator equals on value types
[Experimental("SKEXP0020")]
internal struct AzureCosmosDBMongoDBMemoryRecordMetadata
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
Expand All @@ -17,6 +18,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB;
/// An implementation of <see cref="IMemoryStore"/> backed by a Azure CosmosDB Mongo vCore database.
/// Get more details about Azure Cosmos Mongo vCore vector search https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/vector-search
/// </summary>
[Experimental("SKEXP0020")]
public class AzureCosmosDBMongoDBMemoryStore : IMemoryStore, IDisposable
{
private readonly MongoClient _mongoClient;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
Expand All @@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB;
/// <summary>
/// Similarity metric to use with the index. Possible options are COS (cosine distance), L2 (Euclidean distance), and IP (inner product).
/// </summary>
[Experimental("SKEXP0020")]
public enum AzureCosmosDBSimilarityType
{
/// <summary>
Expand All @@ -31,6 +33,7 @@ public enum AzureCosmosDBSimilarityType
Euclidean
}

[Experimental("SKEXP0020")]
internal static class AzureCosmosDBSimilarityTypeExtensions
{
public static string GetCustomName(this AzureCosmosDBSimilarityType type)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using MongoDB.Bson.Serialization.Attributes;

Expand All @@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB;
/// <summary>
/// Type of vector index to create. The options are vector-ivf and vector-hnsw.
/// </summary>
[Experimental("SKEXP0020")]
public enum AzureCosmosDBVectorSearchType
{
/// <summary>
Expand All @@ -24,6 +26,7 @@ public enum AzureCosmosDBVectorSearchType
VectorHNSW
}

[Experimental("SKEXP0020")]
internal static class AzureCosmosDBVectorSearchTypeExtensions
{
public static string GetCustomName(this AzureCosmosDBVectorSearchType type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<AssemblyName>Microsoft.SemanticKernel.Connectors.AzureCosmosDBMongoDB</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);NU5104;SKEXP0001,SKEXP0010</NoWarn>
<VersionSuffix>preview</VersionSuffix>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;

// This assembly is currently experimental.
[assembly: Experimental("SKEXP0020")]
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
Expand All @@ -21,6 +22,7 @@ namespace Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL;
/// An implementation of <see cref="IMemoryStore"/> backed by a Azure Cosmos DB database.
/// Get more details about Azure Cosmos DB vector search https://learn.microsoft.com/en-us/azure/cosmos-db/
/// </summary>
[Experimental("SKEXP0020")]
public class AzureCosmosDBNoSQLMemoryStore : IMemoryStore, IDisposable
{
private const string EmbeddingPath = "/embedding";
Expand Down Expand Up @@ -444,6 +446,7 @@ protected virtual void Dispose(bool disposing)
/// <param name="timestamp"></param>
[DebuggerDisplay("{GetDebuggerDisplay()}")]
#pragma warning disable CA1812 // 'MemoryRecordWithSimilarityScore' is an internal class that is apparently never instantiated. If so, remove the code from the assembly. If this class is intended to contain only static members, make it 'static' (Module in Visual Basic). (https://learn.microsoft.com/dotnet/fundamentals/code-analysis/quality-rules/ca1812)
[Experimental("SKEXP0020")]
internal sealed class MemoryRecordWithSimilarityScore(
#pragma warning restore CA1812
MemoryRecordMetadata metadata,
Expand All @@ -465,6 +468,7 @@ private string GetDebuggerDisplay()
/// <summary>
/// Creates a new record that also serializes an "id" property.
/// </summary>
[Experimental("SKEXP0020")]
[DebuggerDisplay("{GetDebuggerDisplay()}")]
internal sealed class MemoryRecordWithId : MemoryRecord
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>Microsoft.SemanticKernel.Connectors.AzureCosmosDBNoSQL</AssemblyName>
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<NoWarn>$(NoWarn);NU5104;SKEXP0001,SKEXP0010</NoWarn>
<NoWarn>$(NoWarn);NU5104</NoWarn>
<VersionSuffix>preview</VersionSuffix>
</PropertyGroup>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;

// This assembly is currently experimental.
[assembly: Experimental("SKEXP0020")]
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;

// This assembly is currently experimental.
[assembly: Experimental("SKEXP0020")]
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;
using Microsoft.SemanticKernel.Memory;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
Expand All @@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Connectors.MongoDB;
/// <summary>
/// A MongoDB memory entry.
/// </summary>
[Experimental("SKEXP0020")]
public sealed class MongoDBMemoryEntry
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using Microsoft.SemanticKernel.Memory;
using MongoDB.Bson.Serialization.Attributes;

Expand All @@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.Connectors.MongoDB;
/// A MongoDB record metadata.
/// </summary>
#pragma warning disable CA1815 // Override equals and operator equals on value types
[Experimental("SKEXP0020")]
public struct MongoDBMemoryRecordMetadata
#pragma warning restore CA1815 // Override equals and operator equals on value types
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
Expand All @@ -14,6 +15,7 @@ namespace Microsoft.SemanticKernel.Connectors.MongoDB;
/// <summary>
/// An implementation of <see cref="IMemoryStore"/> backed by a MongoDB database.
/// </summary>
[Experimental("SKEXP0020")]
public class MongoDBMemoryStore : IMemoryStore, IDisposable
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;

// This assembly is currently experimental.
[assembly: Experimental("SKEXP0020")]
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Net.Http;
using System.Text.Json.Serialization;

Expand All @@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.Connectors.Pinecone;
/// This operation specifies the pod type and number of replicas for an index.
/// See https://docs.pinecone.io/reference/configure_index
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class ConfigureIndexRequest
{
public string IndexName { get; set; }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Net.Http;

namespace Microsoft.SemanticKernel.Connectors.Pinecone;
Expand All @@ -8,6 +9,7 @@ namespace Microsoft.SemanticKernel.Connectors.Pinecone;
/// Deletes an index and all its data.
/// See https://docs.pinecone.io/reference/delete_index
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class DeleteIndexRequest
{
public static DeleteIndexRequest Create(string indexName)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http;
using System.Text;
Expand All @@ -12,6 +13,7 @@ namespace Microsoft.SemanticKernel.Connectors.Pinecone;
/// DeleteRequest
/// See https://docs.pinecone.io/reference/delete_post
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class DeleteRequest
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Net.Http;

namespace Microsoft.SemanticKernel.Connectors.Pinecone;
Expand All @@ -8,6 +9,7 @@ namespace Microsoft.SemanticKernel.Connectors.Pinecone;
/// Get information about an index.
/// See https://docs.pinecone.io/reference/describe_index
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class DescribeIndexRequest
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Net.Http;
using System.Text.Json.Serialization;

Expand All @@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Connectors.Pinecone;
/// DescribeIndexStatsRequest
/// See https://docs.pinecone.io/reference/describe_index_stats_post
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class DescribeIndexStatsRequest
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Net.Http;
using System.Text.Json.Serialization;
Expand All @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Connectors.Pinecone;
/// FetchRequest
/// See https://docs.pinecone.io/reference/fetch
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class FetchRequest
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text.Json.Serialization;

Expand All @@ -12,6 +13,7 @@ namespace Microsoft.SemanticKernel.Connectors.Pinecone;
/// FetchResponse
/// See https://docs.pinecone.io/reference/fetch
/// </summary>
[Experimental("SKEXP0020")]
internal sealed class FetchResponse
{
/// <summary>
Expand Down
Loading

0 comments on commit 14bc62a

Please sign in to comment.