From 4a16849264c2c0695b8a1a8355289f5b636325cf Mon Sep 17 00:00:00 2001 From: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> Date: Mon, 11 Nov 2024 10:52:33 +0000 Subject: [PATCH] .Net: Remove experimental attribute from the new function calling model classes (#9524) Removes the Experimental attribute from the new function-calling model classes and function call content classes as part of their graduation. Corresponding tasks: - https://github.com/microsoft/semantic-kernel/issues/6706 - https://github.com/microsoft/semantic-kernel/issues/8490 --- dotnet/src/Functions/Functions.Yaml/Functions.Yaml.csproj | 2 +- .../AI/ChatCompletion/StreamingKernelContentItemCollection.cs | 2 -- .../AI/FunctionChoiceBehaviors/AutoFunctionChoiceBehavior.cs | 2 -- .../AI/FunctionChoiceBehaviors/FunctionChoice.cs | 1 - .../AI/FunctionChoiceBehaviors/FunctionChoiceBehavior.cs | 4 ---- .../FunctionChoiceBehaviorConfiguration.cs | 2 -- .../FunctionChoiceBehaviorConfigurationContext.cs | 2 -- .../FunctionChoiceBehaviors/FunctionChoiceBehaviorOptions.cs | 2 -- .../AI/FunctionChoiceBehaviors/NoneFunctionChoiceBehavior.cs | 2 -- .../FunctionChoiceBehaviors/RequiredFunctionChoiceBehavior.cs | 2 -- .../SemanticKernel.Abstractions/AI/PromptExecutionSettings.cs | 3 --- .../Contents/FunctionCallContent.cs | 2 -- .../Contents/FunctionCallContentBuilder.cs | 1 - .../Contents/FunctionResultContent.cs | 2 -- .../Contents/StreamingChatMessageContent.cs | 1 - .../Contents/StreamingFunctionCallUpdateContent.cs | 2 -- 16 files changed, 1 insertion(+), 31 deletions(-) diff --git a/dotnet/src/Functions/Functions.Yaml/Functions.Yaml.csproj b/dotnet/src/Functions/Functions.Yaml/Functions.Yaml.csproj index 61199d9478b6..f08cb186dac5 100644 --- a/dotnet/src/Functions/Functions.Yaml/Functions.Yaml.csproj +++ b/dotnet/src/Functions/Functions.Yaml/Functions.Yaml.csproj @@ -6,7 +6,7 @@ $(AssemblyName) net8.0;netstandard2.0 true - $(NoWarn);SKEXP0001 + $(NoWarn) diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/StreamingKernelContentItemCollection.cs b/dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/StreamingKernelContentItemCollection.cs index d3dbac4f919d..196f3ab90abe 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/StreamingKernelContentItemCollection.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/ChatCompletion/StreamingKernelContentItemCollection.cs @@ -3,7 +3,6 @@ using System; using System.Collections; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; namespace Microsoft.SemanticKernel.ChatCompletion; @@ -12,7 +11,6 @@ namespace Microsoft.SemanticKernel.ChatCompletion; /// /// Contains collection of streaming kernel content items of type . /// -[Experimental("SKEXP0001")] public sealed class StreamingKernelContentItemCollection : IList, IReadOnlyList { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/AutoFunctionChoiceBehavior.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/AutoFunctionChoiceBehavior.cs index 7bc1b67e7455..d221bdc74a8f 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/AutoFunctionChoiceBehavior.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/AutoFunctionChoiceBehavior.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.Json.Serialization; @@ -11,7 +10,6 @@ namespace Microsoft.SemanticKernel; /// Represents a that provides either all of the 's plugins' functions to AI model to call or specified ones. /// This behavior allows the model to decide whether to call the functions and, if so, which ones to call. /// -[Experimental("SKEXP0001")] public sealed class AutoFunctionChoiceBehavior : FunctionChoiceBehavior { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoice.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoice.cs index 14daa4b303c5..59eb0e1e5eba 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoice.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoice.cs @@ -9,7 +9,6 @@ namespace Microsoft.SemanticKernel; /// Represents an AI model's decision-making strategy for calling functions, offering predefined choices: Auto, Required, and None. /// Auto allows the model to decide if and which functions to call, Required enforces calling one or more functions, and None prevents any function calls, generating only a user-facing message. /// -[Experimental("SKEXP0001")] public readonly struct FunctionChoice : IEquatable { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehavior.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehavior.cs index eb253809ca22..30f18874571d 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehavior.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehavior.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.Json.Serialization; @@ -11,7 +10,6 @@ namespace Microsoft.SemanticKernel; /// Represents the base class for different function choice behaviors. /// These behaviors define the way functions are chosen by AI model and various aspects of their invocation by AI connectors. /// -[Experimental("SKEXP0001")] [JsonPolymorphic(TypeDiscriminatorPropertyName = "type")] [JsonDerivedType(typeof(AutoFunctionChoiceBehavior), typeDiscriminator: "auto")] [JsonDerivedType(typeof(RequiredFunctionChoiceBehavior), typeDiscriminator: "required")] @@ -105,9 +103,7 @@ public static FunctionChoiceBehavior None(IEnumerable? functions /// /// The context provided by AI connectors, used to determine the configuration. /// The configuration. -#pragma warning disable SKEXP0001 // FunctionChoiceBehavior is an experimental feature and is subject to change in future updates. Suppress this diagnostic to proceed. public abstract FunctionChoiceBehaviorConfiguration GetConfiguration(FunctionChoiceBehaviorConfigurationContext context); -#pragma warning restore SKEXP0001 // FunctionChoiceBehavior is an experimental feature and is subject to change in future updates. Suppress this diagnostic to proceed. /// /// Returns functions AI connector should provide to the AI model. diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfiguration.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfiguration.cs index 4e6664f4e7fc..8df6b86a3c6c 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfiguration.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfiguration.cs @@ -1,14 +1,12 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; namespace Microsoft.SemanticKernel; /// /// Represents function choice behavior configuration produced by a . /// -[Experimental("SKEXP0001")] public sealed class FunctionChoiceBehaviorConfiguration { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfigurationContext.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfigurationContext.cs index bfb0307e15c4..d2525f459761 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfigurationContext.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorConfigurationContext.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Diagnostics.CodeAnalysis; using Microsoft.SemanticKernel.ChatCompletion; namespace Microsoft.SemanticKernel; @@ -8,7 +7,6 @@ namespace Microsoft.SemanticKernel; /// /// The context is to be provided by the choice behavior consumer – AI connector in order to obtain the choice behavior configuration. /// -[Experimental("SKEXP0001")] public sealed class FunctionChoiceBehaviorConfigurationContext { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorOptions.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorOptions.cs index ecb3988b9611..889132bc4095 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorOptions.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/FunctionChoiceBehaviorOptions.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; namespace Microsoft.SemanticKernel; @@ -8,7 +7,6 @@ namespace Microsoft.SemanticKernel; /// /// Represents the options for a function choice behavior. /// -[Experimental("SKEXP0001")] public sealed class FunctionChoiceBehaviorOptions { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/NoneFunctionChoiceBehavior.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/NoneFunctionChoiceBehavior.cs index 5272eb42c065..3923cbc29ab5 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/NoneFunctionChoiceBehavior.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/NoneFunctionChoiceBehavior.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.Json.Serialization; @@ -12,7 +11,6 @@ namespace Microsoft.SemanticKernel; /// The model may use the provided function in the response it generates. E.g. the model may describe which functions it would call and with what parameter values. /// This response is useful if the user should first validate what functions the model will use. /// -[Experimental("SKEXP0001")] public sealed class NoneFunctionChoiceBehavior : FunctionChoiceBehavior { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/RequiredFunctionChoiceBehavior.cs b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/RequiredFunctionChoiceBehavior.cs index c90db27f906f..5fee78799d2f 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/RequiredFunctionChoiceBehavior.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/FunctionChoiceBehaviors/RequiredFunctionChoiceBehavior.cs @@ -1,7 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.Json.Serialization; @@ -11,7 +10,6 @@ namespace Microsoft.SemanticKernel; /// Represents that provides either all of the 's plugins' functions to AI model to call or specified ones. /// This behavior forces the model to always call one or more functions. /// -[Experimental("SKEXP0001")] public sealed class RequiredFunctionChoiceBehavior : FunctionChoiceBehavior { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettings.cs b/dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettings.cs index ca838c4393c0..c42baa962d7e 100644 --- a/dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettings.cs +++ b/dotnet/src/SemanticKernel.Abstractions/AI/PromptExecutionSettings.cs @@ -90,7 +90,6 @@ public string? ModelId /// The intermediate messages will be retained in the provided . /// [JsonPropertyName("function_choice_behavior")] - [Experimental("SKEXP0001")] public FunctionChoiceBehavior? FunctionChoiceBehavior { get => this._functionChoiceBehavior; @@ -149,7 +148,6 @@ public virtual void Freeze() /// public virtual PromptExecutionSettings Clone() { -#pragma warning disable SKEXP0001 // FunctionChoiceBehavior is an experimental feature and is subject to change in future updates. Suppress this diagnostic to proceed. return new() { ModelId = this.ModelId, @@ -157,7 +155,6 @@ public virtual PromptExecutionSettings Clone() FunctionChoiceBehavior = this.FunctionChoiceBehavior, ExtensionData = this.ExtensionData is not null ? new Dictionary(this.ExtensionData) : null }; -#pragma warning restore SKEXP0001 // FunctionChoiceBehavior is an experimental feature and is subject to change in future updates. Suppress this diagnostic to proceed. } /// diff --git a/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContent.cs b/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContent.cs index 5530d568b562..df3d99312301 100644 --- a/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContent.cs +++ b/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContent.cs @@ -2,7 +2,6 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.Json.Serialization; using System.Threading; @@ -13,7 +12,6 @@ namespace Microsoft.SemanticKernel; /// /// Represents a function call requested by AI model. /// -[Experimental("SKEXP0001")] public sealed class FunctionCallContent : KernelContent { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContentBuilder.cs b/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContentBuilder.cs index 4645df33ee1b..756f6d8959bd 100644 --- a/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContentBuilder.cs +++ b/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionCallContentBuilder.cs @@ -13,7 +13,6 @@ namespace Microsoft.SemanticKernel; /// /// A builder class for creating objects from incremental function call updates represented by . /// -[Experimental("SKEXP0001")] public sealed class FunctionCallContentBuilder { private Dictionary? _functionCallIdsByIndex = null; diff --git a/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionResultContent.cs b/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionResultContent.cs index ab1e342f7906..a4e2358eb6b4 100644 --- a/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionResultContent.cs +++ b/dotnet/src/SemanticKernel.Abstractions/Contents/FunctionResultContent.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; using Microsoft.SemanticKernel.ChatCompletion; @@ -9,7 +8,6 @@ namespace Microsoft.SemanticKernel; /// /// Represents the result of a function call. /// -[Experimental("SKEXP0001")] public sealed class FunctionResultContent : KernelContent { /// diff --git a/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs b/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs index cc2b0c354284..9e7325b771c2 100644 --- a/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs +++ b/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs @@ -52,7 +52,6 @@ public string? Content /// Chat message content items. /// [JsonIgnore] - [Experimental("SKEXP0001")] public StreamingKernelContentItemCollection Items { get => this._items ??= []; diff --git a/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingFunctionCallUpdateContent.cs b/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingFunctionCallUpdateContent.cs index 3d186681f481..48280aad3bd2 100644 --- a/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingFunctionCallUpdateContent.cs +++ b/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingFunctionCallUpdateContent.cs @@ -1,6 +1,5 @@ // Copyright (c) Microsoft. All rights reserved. -using System.Diagnostics.CodeAnalysis; using System.Text; namespace Microsoft.SemanticKernel; @@ -8,7 +7,6 @@ namespace Microsoft.SemanticKernel; /// /// Represents a function streaming call requested by LLM. /// -[Experimental("SKEXP0001")] public class StreamingFunctionCallUpdateContent : StreamingKernelContent { ///