diff --git a/dotnet/src/Agents/Abstractions/Agent.cs b/dotnet/src/Agents/Abstractions/Agent.cs index 474ff1c886f8..383b5df27385 100644 --- a/dotnet/src/Agents/Abstractions/Agent.cs +++ b/dotnet/src/Agents/Abstractions/Agent.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; @@ -64,7 +65,10 @@ public abstract class Agent /// For example, two OpenAI Assistant agents each targeting a different Azure OpenAI endpoint /// would require their own channel. In this case, the endpoint could be expressed as an additional key. /// + [Experimental("SKEXP0110")] +#pragma warning disable CA1024 // Use properties where appropriate protected internal abstract IEnumerable GetChannelKeys(); +#pragma warning restore CA1024 // Use properties where appropriate /// /// Produce an appropriate for the agent type. @@ -75,6 +79,7 @@ public abstract class Agent /// Every agent conversation, or , will establish one or more /// objects according to the specific type. /// + [Experimental("SKEXP0110")] protected internal abstract Task CreateChannelAsync(CancellationToken cancellationToken); /// @@ -87,6 +92,7 @@ public abstract class Agent /// Every agent conversation, or , will establish one or more /// objects according to the specific type. /// + [Experimental("SKEXP0110")] protected internal abstract Task RestoreChannelAsync(string channelState, CancellationToken cancellationToken); private ILogger? _logger; diff --git a/dotnet/src/Agents/Abstractions/AgentChannel.cs b/dotnet/src/Agents/Abstractions/AgentChannel.cs index e6c0f572e43e..56c631b0c1b9 100644 --- a/dotnet/src/Agents/Abstractions/AgentChannel.cs +++ b/dotnet/src/Agents/Abstractions/AgentChannel.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; @@ -13,6 +14,7 @@ namespace Microsoft.SemanticKernel.Agents; /// /// An agent provides it own via . /// +[Experimental("SKEXP0110")] public abstract class AgentChannel { /// @@ -83,6 +85,7 @@ protected internal abstract IAsyncEnumerable Invoke /// An agent provides it own via . /// This class is a convenience upcast to an agent for . /// +[Experimental("SKEXP0110")] public abstract class AgentChannel : AgentChannel where TAgent : Agent { /// diff --git a/dotnet/src/Agents/Abstractions/AgentChat.cs b/dotnet/src/Agents/Abstractions/AgentChat.cs index 7549974a7a42..22b4077527e1 100644 --- a/dotnet/src/Agents/Abstractions/AgentChat.cs +++ b/dotnet/src/Agents/Abstractions/AgentChat.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using System.Text.Json; @@ -21,6 +22,7 @@ namespace Microsoft.SemanticKernel.Agents; /// instances don't support concurrent invocation and /// will throw an exception if concurrent activity is attempted for any public method. /// +[Experimental("SKEXP0110")] public abstract class AgentChat { private readonly BroadcastQueue _broadcastQueue; diff --git a/dotnet/src/Agents/Abstractions/AgentChatSerializer.cs b/dotnet/src/Agents/Abstractions/AgentChatSerializer.cs index c5e56ad36cd5..b6174284d959 100644 --- a/dotnet/src/Agents/Abstractions/AgentChatSerializer.cs +++ b/dotnet/src/Agents/Abstractions/AgentChatSerializer.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Text.Json; using System.Text.Json.Serialization; @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Agents; /// /// Serializes and deserializes an . /// +[Experimental("SKEXP0110")] public sealed class AgentChatSerializer { private readonly AgentChatState _state; diff --git a/dotnet/src/Agents/Abstractions/Agents.Abstractions.csproj b/dotnet/src/Agents/Abstractions/Agents.Abstractions.csproj index fa5b1daa4910..5deea28529ca 100644 --- a/dotnet/src/Agents/Abstractions/Agents.Abstractions.csproj +++ b/dotnet/src/Agents/Abstractions/Agents.Abstractions.csproj @@ -1,4 +1,4 @@ - + @@ -6,7 +6,7 @@ Microsoft.SemanticKernel.Agents net8.0;netstandard2.0 false - alpha + rc diff --git a/dotnet/src/Agents/Abstractions/AggregatorAgent.cs b/dotnet/src/Agents/Abstractions/AggregatorAgent.cs index e29c41ca57c9..8cde6b5a9001 100644 --- a/dotnet/src/Agents/Abstractions/AggregatorAgent.cs +++ b/dotnet/src/Agents/Abstractions/AggregatorAgent.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Threading; using System.Threading.Tasks; @@ -12,6 +13,7 @@ namespace Microsoft.SemanticKernel.Agents; /// Defines the relationship between the internal aggregated chat and the chat /// with which is participating. /// +[Experimental("SKEXP0110")] public enum AggregatorMode { /// @@ -29,6 +31,7 @@ public enum AggregatorMode /// Allows an to participate in another as an . /// /// A factory method that produces a new instance. +[Experimental("SKEXP0110")] public sealed class AggregatorAgent(Func chatProvider) : Agent { /// diff --git a/dotnet/src/Agents/Abstractions/AggregatorChannel.cs b/dotnet/src/Agents/Abstractions/AggregatorChannel.cs index f0dcf5736192..a002e41351af 100644 --- a/dotnet/src/Agents/Abstractions/AggregatorChannel.cs +++ b/dotnet/src/Agents/Abstractions/AggregatorChannel.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using System.Text.Json; @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Agents; /// /// Adapt channel contract to underlying . /// +[Experimental("SKEXP0110")] internal sealed class AggregatorChannel(AgentChat chat) : AgentChannel { private readonly AgentChat _chat = chat; diff --git a/dotnet/src/Agents/Abstractions/Internal/BroadcastQueue.cs b/dotnet/src/Agents/Abstractions/Internal/BroadcastQueue.cs index 6a53ece7004d..5c3d6fcf7bb3 100644 --- a/dotnet/src/Agents/Abstractions/Internal/BroadcastQueue.cs +++ b/dotnet/src/Agents/Abstractions/Internal/BroadcastQueue.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using ChannelQueue = System.Collections.Generic.Queue>; @@ -21,6 +22,7 @@ namespace Microsoft.SemanticKernel.Agents.Internal; /// is never invoked concurrently, which eliminates /// race conditions over the queue dictionary. /// +[Experimental("SKEXP0110")] internal sealed class BroadcastQueue { private readonly Dictionary _queues = []; diff --git a/dotnet/src/Agents/Abstractions/Internal/ChannelReference.cs b/dotnet/src/Agents/Abstractions/Internal/ChannelReference.cs index f49835355157..236e25415879 100644 --- a/dotnet/src/Agents/Abstractions/Internal/ChannelReference.cs +++ b/dotnet/src/Agents/Abstractions/Internal/ChannelReference.cs @@ -1,9 +1,12 @@ // Copyright (c) Microsoft. All rights reserved. +using System.Diagnostics.CodeAnalysis; + namespace Microsoft.SemanticKernel.Agents.Internal; /// /// Tracks channel along with its hashed key. /// +[Experimental("SKEXP0110")] internal readonly struct ChannelReference(AgentChannel channel, string hash) { /// diff --git a/dotnet/src/Agents/Abstractions/Logging/AggregatorAgentLogMessages.cs b/dotnet/src/Agents/Abstractions/Logging/AggregatorAgentLogMessages.cs index 441c9da117f5..08eb87c8613a 100644 --- a/dotnet/src/Agents/Abstractions/Logging/AggregatorAgentLogMessages.cs +++ b/dotnet/src/Agents/Abstractions/Logging/AggregatorAgentLogMessages.cs @@ -15,6 +15,7 @@ namespace Microsoft.SemanticKernel.Agents; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class AggregatorAgentLogMessages { /// diff --git a/dotnet/src/Agents/Abstractions/Properties/AssemblyInfo.cs b/dotnet/src/Agents/Abstractions/Properties/AssemblyInfo.cs deleted file mode 100644 index bd1c0f58314e..000000000000 --- a/dotnet/src/Agents/Abstractions/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -using System.Diagnostics.CodeAnalysis; - -// This assembly is currently experimental. -[assembly: Experimental("SKEXP0110")] diff --git a/dotnet/src/Agents/Abstractions/Serialization/ChatMessageReference.cs b/dotnet/src/Agents/Abstractions/Serialization/ChatMessageReference.cs index 2f66f67ac9f8..d69011639d86 100644 --- a/dotnet/src/Agents/Abstractions/Serialization/ChatMessageReference.cs +++ b/dotnet/src/Agents/Abstractions/Serialization/ChatMessageReference.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.Json.Serialization; using Microsoft.SemanticKernel.ChatCompletion; @@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Agents.Serialization; /// Represents a for serialization without metadata. /// /// The referenced message +[Experimental("SKEXP0110")] public sealed class ChatMessageReference(ChatMessageContent message) { /// diff --git a/dotnet/src/Agents/AzureAI/Agents.AzureAI.csproj b/dotnet/src/Agents/AzureAI/Agents.AzureAI.csproj index 1103ca422a05..5d26a6a16798 100644 --- a/dotnet/src/Agents/AzureAI/Agents.AzureAI.csproj +++ b/dotnet/src/Agents/AzureAI/Agents.AzureAI.csproj @@ -7,7 +7,7 @@ net8.0;netstandard2.0 $(NoWarn);SKEXP0110 false - alpha + preview diff --git a/dotnet/src/Agents/Core/AgentGroupChat.cs b/dotnet/src/Agents/Core/AgentGroupChat.cs index 320410f9e11a..1cdb3c638d4b 100644 --- a/dotnet/src/Agents/Core/AgentGroupChat.cs +++ b/dotnet/src/Agents/Core/AgentGroupChat.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using System.Threading; @@ -15,6 +16,7 @@ namespace Microsoft.SemanticKernel.Agents; /// /// Represents an that supports multi-turn interactions. /// +[Experimental("SKEXP0110")] public sealed class AgentGroupChat : AgentChat { private readonly HashSet _agentIds; // Efficient existence test O(1) vs O(n) for list. diff --git a/dotnet/src/Agents/Core/Agents.Core.csproj b/dotnet/src/Agents/Core/Agents.Core.csproj index c594e131f655..4311785f61c9 100644 --- a/dotnet/src/Agents/Core/Agents.Core.csproj +++ b/dotnet/src/Agents/Core/Agents.Core.csproj @@ -5,9 +5,9 @@ Microsoft.SemanticKernel.Agents.Core Microsoft.SemanticKernel.Agents net8.0;netstandard2.0 - $(NoWarn);SKEXP0110 + $(NoWarn);SKEXP0110;SKEXP0001 false - alpha + preview diff --git a/dotnet/src/Agents/Core/Chat/AgentGroupChatSettings.cs b/dotnet/src/Agents/Core/Chat/AgentGroupChatSettings.cs index 2510408a59f0..e5399ab46133 100644 --- a/dotnet/src/Agents/Core/Chat/AgentGroupChatSettings.cs +++ b/dotnet/src/Agents/Core/Chat/AgentGroupChatSettings.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// /// The default behavior results in no agent selection. /// +[Experimental("SKEXP0110")] public class AgentGroupChatSettings { /// diff --git a/dotnet/src/Agents/Core/Chat/AggregatorTerminationStrategy.cs b/dotnet/src/Agents/Core/Chat/AggregatorTerminationStrategy.cs index adf1761aeae1..3a0e8d7fac7b 100644 --- a/dotnet/src/Agents/Core/Chat/AggregatorTerminationStrategy.cs +++ b/dotnet/src/Agents/Core/Chat/AggregatorTerminationStrategy.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -9,6 +10,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// /// Defines aggregation behavior for . /// +[Experimental("SKEXP0110")] public enum AggregateTerminationCondition { /// @@ -26,6 +28,7 @@ public enum AggregateTerminationCondition /// Provides methods to aggregate a set of objects. /// /// The set of strategies upon which to aggregate. +[Experimental("SKEXP0110")] public sealed class AggregatorTerminationStrategy(params TerminationStrategy[] strategies) : TerminationStrategy { private readonly TerminationStrategy[] _strategies = strategies; diff --git a/dotnet/src/Agents/Core/Chat/KernelFunctionSelectionStrategy.cs b/dotnet/src/Agents/Core/Chat/KernelFunctionSelectionStrategy.cs index 6a67dbea4294..4fa3c001e2c8 100644 --- a/dotnet/src/Agents/Core/Chat/KernelFunctionSelectionStrategy.cs +++ b/dotnet/src/Agents/Core/Chat/KernelFunctionSelectionStrategy.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -15,6 +16,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// /// A used for selection criteria. /// A kernel instance with services for function execution. +[Experimental("SKEXP0110")] public class KernelFunctionSelectionStrategy(KernelFunction function, Kernel kernel) : SelectionStrategy { /// diff --git a/dotnet/src/Agents/Core/Chat/KernelFunctionTerminationStrategy.cs b/dotnet/src/Agents/Core/Chat/KernelFunctionTerminationStrategy.cs index f3f5c496fbf4..707aa46af466 100644 --- a/dotnet/src/Agents/Core/Chat/KernelFunctionTerminationStrategy.cs +++ b/dotnet/src/Agents/Core/Chat/KernelFunctionTerminationStrategy.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -15,6 +16,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// /// A used for termination criteria. /// A kernel instance with services for function execution. +[Experimental("SKEXP0110")] public class KernelFunctionTerminationStrategy(KernelFunction function, Kernel kernel) : TerminationStrategy { /// diff --git a/dotnet/src/Agents/Core/Chat/RegExTerminationStrategy.cs b/dotnet/src/Agents/Core/Chat/RegExTerminationStrategy.cs index 2745a325ee88..0b84c09b8c79 100644 --- a/dotnet/src/Agents/Core/Chat/RegExTerminationStrategy.cs +++ b/dotnet/src/Agents/Core/Chat/RegExTerminationStrategy.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Text.RegularExpressions; using System.Threading; @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// Signals termination when the most recent message matches against the defined regular expressions /// for the specified agent (if provided). /// +[Experimental("SKEXP0110")] public sealed class RegexTerminationStrategy : TerminationStrategy { private readonly Regex[] _expressions; diff --git a/dotnet/src/Agents/Core/Chat/SelectionStrategy.cs b/dotnet/src/Agents/Core/Chat/SelectionStrategy.cs index 096102b0fbba..e9bca243ec9c 100644 --- a/dotnet/src/Agents/Core/Chat/SelectionStrategy.cs +++ b/dotnet/src/Agents/Core/Chat/SelectionStrategy.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Microsoft.Extensions.Logging; @@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// /// Provides a base strategy class for selecting the next agent for an . /// +[Experimental("SKEXP0110")] public abstract class SelectionStrategy { /// diff --git a/dotnet/src/Agents/Core/Chat/SequentialSelectionStrategy.cs b/dotnet/src/Agents/Core/Chat/SequentialSelectionStrategy.cs index 6d27b5874171..9f71372f38d4 100644 --- a/dotnet/src/Agents/Core/Chat/SequentialSelectionStrategy.cs +++ b/dotnet/src/Agents/Core/Chat/SequentialSelectionStrategy.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Microsoft.SemanticKernel.Agents.Extensions; @@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// Represents a round-robin turn-taking strategy. Agent order is based on the order /// in which they joined . /// +[Experimental("SKEXP0110")] public sealed class SequentialSelectionStrategy : SelectionStrategy { private int _index = -1; diff --git a/dotnet/src/Agents/Core/Chat/TerminationStrategy.cs b/dotnet/src/Agents/Core/Chat/TerminationStrategy.cs index e661d8dd9b4c..4a579a44fdf9 100644 --- a/dotnet/src/Agents/Core/Chat/TerminationStrategy.cs +++ b/dotnet/src/Agents/Core/Chat/TerminationStrategy.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -12,6 +13,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// /// Provides a base strategy class for defining termination criteria for an . /// +[Experimental("SKEXP0110")] public abstract class TerminationStrategy { /// diff --git a/dotnet/src/Agents/Core/ChatCompletionAgent.cs b/dotnet/src/Agents/Core/ChatCompletionAgent.cs index 527e633bf443..ed3f1ce3d2c6 100644 --- a/dotnet/src/Agents/Core/ChatCompletionAgent.cs +++ b/dotnet/src/Agents/Core/ChatCompletionAgent.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Runtime.CompilerServices; using System.Text; using System.Text.Json; @@ -87,6 +88,7 @@ public override IAsyncEnumerable InvokeStreamingAsy } /// + [Experimental("SKEXP0110")] protected override Task RestoreChannelAsync(string channelState, CancellationToken cancellationToken) { ChatHistory history = diff --git a/dotnet/src/Agents/Core/ChatHistoryChannel.cs b/dotnet/src/Agents/Core/ChatHistoryChannel.cs index d93b5f9f73b2..4b44a5cd9fec 100644 --- a/dotnet/src/Agents/Core/ChatHistoryChannel.cs +++ b/dotnet/src/Agents/Core/ChatHistoryChannel.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using System.Text.Json; @@ -15,6 +16,7 @@ namespace Microsoft.SemanticKernel.Agents; /// /// Represents an specialization that acts upon a . /// +[Experimental("SKEXP0110")] internal sealed class ChatHistoryChannel : AgentChannel { // Supported content types for when diff --git a/dotnet/src/Agents/Core/ChatHistoryKernelAgent.cs b/dotnet/src/Agents/Core/ChatHistoryKernelAgent.cs index 1e18ff4b2282..f3572a75d3c2 100644 --- a/dotnet/src/Agents/Core/ChatHistoryKernelAgent.cs +++ b/dotnet/src/Agents/Core/ChatHistoryKernelAgent.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Threading; using System.Threading.Tasks; @@ -25,6 +26,7 @@ public abstract class ChatHistoryKernelAgent : KernelAgent /// The reducer is automatically applied to the history before invoking the agent, only when using /// an . It must be explicitly applied via . /// + [Experimental("SKEXP0110")] public IChatHistoryReducer? HistoryReducer { get; init; } /// @@ -61,10 +63,12 @@ public abstract IAsyncEnumerable InvokeStreamingAsy /// The source history. /// The to monitor for cancellation requests. The default is . /// if reduction occurred. + [Experimental("SKEXP0110")] public Task ReduceAsync(ChatHistory history, CancellationToken cancellationToken = default) => history.ReduceInPlaceAsync(this.HistoryReducer, cancellationToken); /// + [Experimental("SKEXP0110")] protected sealed override IEnumerable GetChannelKeys() { yield return typeof(ChatHistoryChannel).FullName!; @@ -82,6 +86,7 @@ protected sealed override IEnumerable GetChannelKeys() } /// + [Experimental("SKEXP0110")] protected sealed override Task CreateChannelAsync(CancellationToken cancellationToken) { ChatHistoryChannel channel = diff --git a/dotnet/src/Agents/Core/Internal/ChatMessageForPrompt.cs b/dotnet/src/Agents/Core/Internal/ChatMessageForPrompt.cs index 8d970988466b..ecedad3c04af 100644 --- a/dotnet/src/Agents/Core/Internal/ChatMessageForPrompt.cs +++ b/dotnet/src/Agents/Core/Internal/ChatMessageForPrompt.cs @@ -24,7 +24,9 @@ internal sealed class ChatMessageForPrompt(ChatMessageContent message) /// The referenced property. /// [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] +#pragma warning disable SKEXP0001 public string? Name => message.AuthorName; +#pragma warning restore SKEXP0001 /// /// The referenced property. diff --git a/dotnet/src/Agents/Core/Logging/AgentGroupChatLogMessages.cs b/dotnet/src/Agents/Core/Logging/AgentGroupChatLogMessages.cs index 81552b57887e..59835f576c4f 100644 --- a/dotnet/src/Agents/Core/Logging/AgentGroupChatLogMessages.cs +++ b/dotnet/src/Agents/Core/Logging/AgentGroupChatLogMessages.cs @@ -18,6 +18,7 @@ namespace Microsoft.SemanticKernel.Agents; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class AgentGroupChatLogMessages { /// diff --git a/dotnet/src/Agents/Core/Logging/AggregatorTerminationStrategyLogMessages.cs b/dotnet/src/Agents/Core/Logging/AggregatorTerminationStrategyLogMessages.cs index 777ec8806ec7..de2e18d63d8c 100644 --- a/dotnet/src/Agents/Core/Logging/AggregatorTerminationStrategyLogMessages.cs +++ b/dotnet/src/Agents/Core/Logging/AggregatorTerminationStrategyLogMessages.cs @@ -14,6 +14,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class AggregatorTerminationStrategyLogMessages { /// diff --git a/dotnet/src/Agents/Core/Logging/KernelFunctionSelectionStrategyLogMessages.cs b/dotnet/src/Agents/Core/Logging/KernelFunctionSelectionStrategyLogMessages.cs index c846f5e2534e..0da707a0c096 100644 --- a/dotnet/src/Agents/Core/Logging/KernelFunctionSelectionStrategyLogMessages.cs +++ b/dotnet/src/Agents/Core/Logging/KernelFunctionSelectionStrategyLogMessages.cs @@ -15,6 +15,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class KernelFunctionStrategyLogMessages { /// diff --git a/dotnet/src/Agents/Core/Logging/KernelFunctionTerminationStrategyLogMessages.cs b/dotnet/src/Agents/Core/Logging/KernelFunctionTerminationStrategyLogMessages.cs index 61a4dea167b5..bd110c54fc8c 100644 --- a/dotnet/src/Agents/Core/Logging/KernelFunctionTerminationStrategyLogMessages.cs +++ b/dotnet/src/Agents/Core/Logging/KernelFunctionTerminationStrategyLogMessages.cs @@ -15,6 +15,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class KernelFunctionTerminationStrategyLogMessages { /// diff --git a/dotnet/src/Agents/Core/Logging/RegExTerminationStrategyLogMessages.cs b/dotnet/src/Agents/Core/Logging/RegExTerminationStrategyLogMessages.cs index a748158252b7..0f85053bb570 100644 --- a/dotnet/src/Agents/Core/Logging/RegExTerminationStrategyLogMessages.cs +++ b/dotnet/src/Agents/Core/Logging/RegExTerminationStrategyLogMessages.cs @@ -15,6 +15,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class RegExTerminationStrategyLogMessages { /// diff --git a/dotnet/src/Agents/Core/Logging/SequentialSelectionStrategyLogMessages.cs b/dotnet/src/Agents/Core/Logging/SequentialSelectionStrategyLogMessages.cs index 7af1ddd93b63..6b32b574dd69 100644 --- a/dotnet/src/Agents/Core/Logging/SequentialSelectionStrategyLogMessages.cs +++ b/dotnet/src/Agents/Core/Logging/SequentialSelectionStrategyLogMessages.cs @@ -14,6 +14,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class SequentialSelectionStrategyLogMessages { /// diff --git a/dotnet/src/Agents/Core/Logging/TerminationStrategyLogMessages.cs b/dotnet/src/Agents/Core/Logging/TerminationStrategyLogMessages.cs index 79f2e2047f8b..365c262c819f 100644 --- a/dotnet/src/Agents/Core/Logging/TerminationStrategyLogMessages.cs +++ b/dotnet/src/Agents/Core/Logging/TerminationStrategyLogMessages.cs @@ -15,6 +15,7 @@ namespace Microsoft.SemanticKernel.Agents.Chat; /// generate logging code at compile time to achieve optimized code. /// [ExcludeFromCodeCoverage] +[Experimental("SKEXP0110")] internal static partial class TerminationStrategyLogMessages { /// diff --git a/dotnet/src/Agents/Core/Properties/AssemblyInfo.cs b/dotnet/src/Agents/Core/Properties/AssemblyInfo.cs deleted file mode 100644 index bd1c0f58314e..000000000000 --- a/dotnet/src/Agents/Core/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -using System.Diagnostics.CodeAnalysis; - -// This assembly is currently experimental. -[assembly: Experimental("SKEXP0110")] diff --git a/dotnet/src/Agents/OpenAI/Agents.OpenAI.csproj b/dotnet/src/Agents/OpenAI/Agents.OpenAI.csproj index c03d06e6e999..bb5de10306b1 100644 --- a/dotnet/src/Agents/OpenAI/Agents.OpenAI.csproj +++ b/dotnet/src/Agents/OpenAI/Agents.OpenAI.csproj @@ -5,9 +5,8 @@ Microsoft.SemanticKernel.Agents.OpenAI Microsoft.SemanticKernel.Agents.OpenAI net8.0;netstandard2.0 - $(NoWarn);SKEXP0110 + $(NoWarn);SKEXP0110;SKEXP0001;OPENAI001;NU5104 false - alpha diff --git a/dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs b/dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs index 7beb380f5bc4..c8d300874c60 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Runtime.CompilerServices; using System.Text.Json; @@ -87,6 +88,7 @@ public OpenAIAssistantAgent( /// /// An assistant removed by other means will result in an exception when invoked. /// + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to manage the Assistant definition lifecycle.")] public bool IsDeleted { get; private set; } @@ -111,9 +113,12 @@ public OpenAIAssistantAgent( /// An prompt template factory to produce the for the agent. /// The to monitor for cancellation requests. The default is . /// An instance. + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantFromTemplateAsync).")] public static async Task CreateFromTemplateAsync( +#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. OpenAIClientProvider clientProvider, +#pragma warning restore SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. OpenAIAssistantCapabilities capabilities, Kernel kernel, KernelArguments defaultArguments, @@ -158,9 +163,12 @@ public static async Task CreateFromTemplateAsync( /// Optional default arguments, including any . /// The to monitor for cancellation requests. The default is . /// An instance. + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantAsync).")] public static async Task CreateAsync( +#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. OpenAIClientProvider clientProvider, +#pragma warning restore SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. OpenAIAssistantDefinition definition, Kernel kernel, KernelArguments? defaultArguments = null, @@ -193,9 +201,12 @@ public static async Task CreateAsync( /// The configuration for accessing the API service. /// The to monitor for cancellation requests. The default is . /// A list of objects. + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to query for assistant definitions (GetAssistantsAsync).")] public static async IAsyncEnumerable ListDefinitionsAsync( +#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. OpenAIClientProvider clientProvider, +#pragma warning restore SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. [EnumeratorCancellation] CancellationToken cancellationToken = default) { // Create the client @@ -218,9 +229,12 @@ public static async IAsyncEnumerable ListDefinitionsA /// An optional factory to produce the for the agent. /// The to monitor for cancellation requests. The default is . /// An instance. + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to retrieve an assistant definition (GetAssistantsAsync).")] public static async Task RetrieveAsync( +#pragma warning disable SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. OpenAIClientProvider clientProvider, +#pragma warning restore SKEXP0110 // Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed. string id, Kernel kernel, KernelArguments? defaultArguments = null, @@ -259,6 +273,7 @@ public static async Task RetrieveAsync( /// /// The to monitor for cancellation requests. The default is . /// The thread identifier. + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to create a thread.")] public Task CreateThreadAsync(CancellationToken cancellationToken = default) => this.CreateThreadAsync(options: null, cancellationToken); @@ -269,6 +284,7 @@ public Task CreateThreadAsync(CancellationToken cancellationToken = defa /// The options for creating the thread. /// The to monitor for cancellation requests. The default is . /// The thread identifier. + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to create a thread.")] public Task CreateThreadAsync(OpenAIThreadCreationOptions? options, CancellationToken cancellationToken = default) => this.Client.CreateThreadAsync( @@ -284,6 +300,7 @@ public Task CreateThreadAsync(OpenAIThreadCreationOptions? options, Canc /// The thread identifier. /// The to monitor for cancellation requests. The default is . /// The thread identifier. + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to delete an existing thread.")] public async Task DeleteThreadAsync( string threadId, @@ -330,6 +347,7 @@ public IAsyncEnumerable GetThreadMessagesAsync(string thread /// /// An assistant-based agent is not usable after deletion. /// + [Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient to remove or otherwise modify the Assistant definition.")] public async Task DeleteAsync(CancellationToken cancellationToken = default) { @@ -440,10 +458,12 @@ public IAsyncEnumerable InvokeStreamingAsync( ChatHistory? messages = null, CancellationToken cancellationToken = default) { +#pragma warning disable SKEXP0001 // ModelDiagnostics is marked experimental. return ActivityExtensions.RunWithActivityAsync( () => ModelDiagnostics.StartAgentInvocationActivity(this.Id, this.GetDisplayName(), this.Description), () => InternalInvokeStreamingAsync(), cancellationToken); +#pragma warning restore SKEXP0001 // ModelDiagnostics is marked experimental. IAsyncEnumerable InternalInvokeStreamingAsync() { @@ -455,6 +475,7 @@ IAsyncEnumerable InternalInvokeStreamingAsync() } /// + [Experimental("SKEXP0110")] protected override IEnumerable GetChannelKeys() { // Distinguish from other channel types. @@ -464,6 +485,7 @@ protected override IEnumerable GetChannelKeys() } /// + [Experimental("SKEXP0110")] protected override async Task CreateChannelAsync(CancellationToken cancellationToken) { this.Logger.LogOpenAIAssistantAgentCreatingChannel(nameof(CreateChannelAsync), nameof(OpenAIAssistantChannel)); @@ -487,6 +509,7 @@ protected override async Task CreateChannelAsync(CancellationToken this.FormatInstructionsAsync(kernel, arguments, cancellationToken); /// + [Experimental("SKEXP0110")] protected override async Task RestoreChannelAsync(string channelState, CancellationToken cancellationToken) { string threadId = channelState; diff --git a/dotnet/src/Agents/OpenAI/OpenAIAssistantCapabilities.cs b/dotnet/src/Agents/OpenAI/OpenAIAssistantCapabilities.cs index 8274541862f1..5642017c89dd 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIAssistantCapabilities.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIAssistantCapabilities.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; namespace Microsoft.SemanticKernel.Agents.OpenAI; @@ -8,6 +9,7 @@ namespace Microsoft.SemanticKernel.Agents.OpenAI; /// /// Defines the capabilities of an assistant. /// +[Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient.CreateAssistantAsync() to create an assistant definition.")] public class OpenAIAssistantCapabilities { diff --git a/dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs b/dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs index dea26353618e..4b91bac74178 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIAssistantChannel.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Threading; using System.Threading.Tasks; using Microsoft.SemanticKernel.Agents.Extensions; @@ -12,6 +13,7 @@ namespace Microsoft.SemanticKernel.Agents.OpenAI; /// /// A specialization for use with . /// +[Experimental("SKEXP0110")] internal sealed class OpenAIAssistantChannel(AssistantClient client, string threadId) : AgentChannel { diff --git a/dotnet/src/Agents/OpenAI/OpenAIAssistantDefinition.cs b/dotnet/src/Agents/OpenAI/OpenAIAssistantDefinition.cs index af25620bfcd2..9560857b101e 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIAssistantDefinition.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIAssistantDefinition.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System; +using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; namespace Microsoft.SemanticKernel.Agents.OpenAI; @@ -7,6 +8,7 @@ namespace Microsoft.SemanticKernel.Agents.OpenAI; /// /// Defines an assistant. /// +[Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient.CreateAssistantAsync() to create an assistant definition.")] public sealed class OpenAIAssistantDefinition : OpenAIAssistantCapabilities { diff --git a/dotnet/src/Agents/OpenAI/OpenAIAssistantExecutionOptions.cs b/dotnet/src/Agents/OpenAI/OpenAIAssistantExecutionOptions.cs index 7e3d72788fa6..ecfd4e52fa58 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIAssistantExecutionOptions.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIAssistantExecutionOptions.cs @@ -1,5 +1,6 @@ // Copyright (c) Microsoft. All rights reserved. using System; +using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; namespace Microsoft.SemanticKernel.Agents.OpenAI; @@ -10,6 +11,7 @@ namespace Microsoft.SemanticKernel.Agents.OpenAI; /// /// These options are persisted as a single entry of the assistant's metadata with key: "__run_options". /// +[Experimental("SKEXP0110")] [Obsolete("Use RunCreationOptions to specify assistant invocation behavior.")] public sealed class OpenAIAssistantExecutionOptions { diff --git a/dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs b/dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs index 1e9cb83e9461..7aec34ee15ed 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIAssistantInvocationOptions.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; namespace Microsoft.SemanticKernel.Agents.OpenAI; @@ -11,6 +12,7 @@ namespace Microsoft.SemanticKernel.Agents.OpenAI; /// /// This class is not applicable to usage. /// +[Experimental("SKEXP0110")] [Obsolete("Use RunCreationOptions to specify assistant invocation behavior.")] public sealed class OpenAIAssistantInvocationOptions { diff --git a/dotnet/src/Agents/OpenAI/OpenAIClientProvider.cs b/dotnet/src/Agents/OpenAI/OpenAIClientProvider.cs index ab4f542eb49b..eccb9509ffd1 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIClientProvider.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIClientProvider.cs @@ -3,6 +3,7 @@ using System.ClientModel; using System.ClientModel.Primitives; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Linq; using System.Net.Http; using System.Threading; @@ -17,6 +18,7 @@ namespace Microsoft.SemanticKernel.Agents.OpenAI; /// /// Provides an for use by . /// +[Experimental("SKEXP0110")] public sealed class OpenAIClientProvider { /// diff --git a/dotnet/src/Agents/OpenAI/OpenAIThreadCreationOptions.cs b/dotnet/src/Agents/OpenAI/OpenAIThreadCreationOptions.cs index 11f4adb6cfe3..5be75f860eb8 100644 --- a/dotnet/src/Agents/OpenAI/OpenAIThreadCreationOptions.cs +++ b/dotnet/src/Agents/OpenAI/OpenAIThreadCreationOptions.cs @@ -1,6 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.Text.Json.Serialization; namespace Microsoft.SemanticKernel.Agents.OpenAI; @@ -8,6 +9,7 @@ namespace Microsoft.SemanticKernel.Agents.OpenAI; /// /// Specifies thread creation options. /// +[Experimental("SKEXP0110")] [Obsolete("Use the OpenAI.Assistants.AssistantClient.CreateThreadAsync() to create a thread.")] public sealed class OpenAIThreadCreationOptions { diff --git a/dotnet/src/Agents/OpenAI/Properties/AssemblyInfo.cs b/dotnet/src/Agents/OpenAI/Properties/AssemblyInfo.cs deleted file mode 100644 index bd1c0f58314e..000000000000 --- a/dotnet/src/Agents/OpenAI/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft. All rights reserved. - -using System.Diagnostics.CodeAnalysis; - -// This assembly is currently experimental. -[assembly: Experimental("SKEXP0110")] diff --git a/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs b/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs index 9e7325b771c2..ac8380506d43 100644 --- a/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs +++ b/dotnet/src/SemanticKernel.Abstractions/Contents/StreamingChatMessageContent.cs @@ -61,8 +61,8 @@ public StreamingKernelContentItemCollection Items /// /// Name of the author of the message /// - [Experimental("SKEXP0001")] [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + [Experimental("SKEXP0001")] public string? AuthorName { get => this._authorName;