Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.Net: Remove experimental attribute from the new function calling model classes #9524

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<RootNamespace>$(AssemblyName)</RootNamespace>
<TargetFrameworks>net8.0;netstandard2.0</TargetFrameworks>
<EnablePackageValidation>true</EnablePackageValidation>
<NoWarn>$(NoWarn);SKEXP0001</NoWarn>
<NoWarn>$(NoWarn)</NoWarn>
</PropertyGroup>

<PropertyGroup Condition="'$(IsReleaseCandidate)' == 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.SemanticKernel.ChatCompletion;

Expand All @@ -12,7 +11,6 @@ namespace Microsoft.SemanticKernel.ChatCompletion;
/// <summary>
/// Contains collection of streaming kernel content items of type <see cref="StreamingKernelContent"/>.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class StreamingKernelContentItemCollection : IList<StreamingKernelContent>, IReadOnlyList<StreamingKernelContent>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -11,7 +10,6 @@ namespace Microsoft.SemanticKernel;
/// Represents a <see cref="FunctionChoiceBehavior"/> that provides either all of the <see cref="Kernel"/>'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.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class AutoFunctionChoiceBehavior : FunctionChoiceBehavior
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
/// </summary>
[Experimental("SKEXP0001")]
public readonly struct FunctionChoice : IEquatable<FunctionChoice>
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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.
/// </summary>
[Experimental("SKEXP0001")]
[JsonPolymorphic(TypeDiscriminatorPropertyName = "type")]
[JsonDerivedType(typeof(AutoFunctionChoiceBehavior), typeDiscriminator: "auto")]
[JsonDerivedType(typeof(RequiredFunctionChoiceBehavior), typeDiscriminator: "required")]
Expand Down Expand Up @@ -105,9 +103,7 @@ public static FunctionChoiceBehavior None(IEnumerable<KernelFunction>? functions
/// </summary>
/// <param name="context">The context provided by AI connectors, used to determine the configuration.</param>
/// <returns>The configuration.</returns>
#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.

/// <summary>
/// Returns functions AI connector should provide to the AI model.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;

namespace Microsoft.SemanticKernel;

/// <summary>
/// Represents function choice behavior configuration produced by a <see cref="FunctionChoiceBehavior" />.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class FunctionChoiceBehaviorConfiguration
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.

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

namespace Microsoft.SemanticKernel;

/// <summary>
/// The context is to be provided by the choice behavior consumer – AI connector in order to obtain the choice behavior configuration.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class FunctionChoiceBehaviorConfigurationContext
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.

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

namespace Microsoft.SemanticKernel;

/// <summary>
/// Represents the options for a function choice behavior.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class FunctionChoiceBehaviorOptions
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class NoneFunctionChoiceBehavior : FunctionChoiceBehavior
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -11,7 +10,6 @@ namespace Microsoft.SemanticKernel;
/// Represents <see cref="FunctionChoiceBehavior"/> that provides either all of the <see cref="Kernel"/>'s plugins' functions to AI model to call or specified ones.
/// This behavior forces the model to always call one or more functions.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class RequiredFunctionChoiceBehavior : FunctionChoiceBehavior
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ public string? ModelId
/// The intermediate messages will be retained in the provided <see cref="ChatHistory"/>.
/// </remarks>
[JsonPropertyName("function_choice_behavior")]
[Experimental("SKEXP0001")]
public FunctionChoiceBehavior? FunctionChoiceBehavior
{
get => this._functionChoiceBehavior;
Expand Down Expand Up @@ -149,15 +148,13 @@ public virtual void Freeze()
/// </summary>
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,
ServiceId = this.ServiceId,
FunctionChoiceBehavior = this.FunctionChoiceBehavior,
ExtensionData = this.ExtensionData is not null ? new Dictionary<string, object>(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.
}

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -13,7 +12,6 @@ namespace Microsoft.SemanticKernel;
/// <summary>
/// Represents a function call requested by AI model.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class FunctionCallContent : KernelContent
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ namespace Microsoft.SemanticKernel;
/// <summary>
/// A builder class for creating <see cref="FunctionCallContent"/> objects from incremental function call updates represented by <see cref="StreamingFunctionCallUpdateContent"/>.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class FunctionCallContentBuilder
{
private Dictionary<int, string>? _functionCallIdsByIndex = null;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Text.Json.Serialization;
using Microsoft.SemanticKernel.ChatCompletion;

Expand All @@ -9,7 +8,6 @@ namespace Microsoft.SemanticKernel;
/// <summary>
/// Represents the result of a function call.
/// </summary>
[Experimental("SKEXP0001")]
public sealed class FunctionResultContent : KernelContent
{
/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ public string? Content
/// Chat message content items.
/// </summary>
[JsonIgnore]
[Experimental("SKEXP0001")]
public StreamingKernelContentItemCollection Items
{
get => this._items ??= [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
// Copyright (c) Microsoft. All rights reserved.

using System.Diagnostics.CodeAnalysis;
using System.Text;

namespace Microsoft.SemanticKernel;

/// <summary>
/// Represents a function streaming call requested by LLM.
/// </summary>
[Experimental("SKEXP0001")]
public class StreamingFunctionCallUpdateContent : StreamingKernelContent
{
/// <summary>
Expand Down
Loading