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: Add date to obsolete messages for when to expect these methods to be deleted. #11329

Merged
Merged
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
12 changes: 6 additions & 6 deletions dotnet/src/Agents/AzureAI/AzureAIAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public AzureAIAgent(
/// <remarks>
/// Only supports messages with <see href="https://platform.openai.com/docs/api-reference/runs/createRun#runs-createrun-additional_messages">role = User or agent</see>.
/// </remarks>
[Obsolete("Pass messages directly to Invoke instead.")]
[Obsolete("Pass messages directly to Invoke instead. This method will be removed after May 1st 2025.")]
public Task AddChatMessageAsync(string threadId, ChatMessageContent message, CancellationToken cancellationToken = default)
{
return AgentThreadActions.CreateMessageAsync(this.Client, threadId, message, cancellationToken);
Expand All @@ -118,7 +118,7 @@ public Task AddChatMessageAsync(string threadId, ChatMessageContent message, Can
/// <param name="threadId">The thread identifier.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An asynchronous enumeration of messages.</returns>
[Obsolete("Use the AzureAIAgentThread to retrieve messages instead.")]
[Obsolete("Use the AzureAIAgentThread to retrieve messages instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> GetThreadMessagesAsync(string threadId, CancellationToken cancellationToken = default)
{
return AgentThreadActions.GetMessagesAsync(this.Client, threadId, null, cancellationToken);
Expand All @@ -135,7 +135,7 @@ public IAsyncEnumerable<ChatMessageContent> GetThreadMessagesAsync(string thread
/// <remarks>
/// The `arguments` parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeAsync with AgentThread instead.")]
[Obsolete("Use InvokeAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> InvokeAsync(
string threadId,
KernelArguments? arguments = null,
Expand Down Expand Up @@ -236,7 +236,7 @@ async IAsyncEnumerable<ChatMessageContent> InternalInvokeAsync()
/// <remarks>
/// The `arguments` parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeAsync with AgentThread instead.")]
[Obsolete("Use InvokeAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> InvokeAsync(
string threadId,
AzureAIInvocationOptions? options,
Expand Down Expand Up @@ -347,7 +347,7 @@ public async IAsyncEnumerable<AgentResponseItem<StreamingChatMessageContent>> In
/// <remarks>
/// The `arguments` parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeStreamingAsync with AgentThread instead.")]
[Obsolete("Use InvokeStreamingAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
string threadId,
KernelArguments? arguments = null,
Expand All @@ -371,7 +371,7 @@ public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
/// <remarks>
/// The `arguments` parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeStreamingAsync with AgentThread instead.")]
[Obsolete("Use InvokeStreamingAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
string threadId,
AzureAIInvocationOptions? options,
Expand Down
8 changes: 4 additions & 4 deletions dotnet/src/Agents/Bedrock/BedrockAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ public async IAsyncEnumerable<AgentResponseItem<ChatMessageContent>> InvokeAsync
/// <param name="invokeAgentRequest">The request to send to the agent.</param>
/// <param name="arguments">The arguments to use when invoking the agent.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
[Obsolete("Use InvokeAsync with AgentThread instead.")]
[Obsolete("Use InvokeAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> InvokeAsync(
InvokeAgentRequest invokeAgentRequest,
KernelArguments? arguments,
Expand Down Expand Up @@ -284,7 +284,7 @@ async IAsyncEnumerable<ChatMessageContent> InvokeInternal()
/// <param name="agentAliasId">The alias id of the agent to use. The default is the working draft alias id.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An <see cref="IAsyncEnumerable{T}"/> of <see cref="ChatMessageContent"/>.</returns>
[Obsolete("Use InvokeAsync with AgentThread instead.")]
[Obsolete("Use InvokeAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> InvokeAsync(
string sessionId,
string message,
Expand Down Expand Up @@ -462,7 +462,7 @@ public async IAsyncEnumerable<AgentResponseItem<StreamingChatMessageContent>> In
/// <param name="agentAliasId">The alias id of the agent to use. The default is the working draft alias id.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An <see cref="IAsyncEnumerable{T}"/> of <see cref="ChatMessageContent"/>.</returns>
[Obsolete("Use InvokeStreamingAsync with AgentThread instead.")]
[Obsolete("Use InvokeStreamingAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
string sessionId,
string message,
Expand Down Expand Up @@ -492,7 +492,7 @@ public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
/// <param name="arguments">The arguments to use when invoking the agent.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An <see cref="IAsyncEnumerable{T}"/> of <see cref="StreamingChatMessageContent"/>.</returns>
[Obsolete("Use InvokeStreamingAsync with AgentThread instead.")]
[Obsolete("Use InvokeStreamingAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
InvokeAgentRequest invokeAgentRequest,
KernelArguments? arguments,
Expand Down
4 changes: 2 additions & 2 deletions dotnet/src/Agents/Core/ChatCompletionAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public override async IAsyncEnumerable<AgentResponseItem<ChatMessageContent>> In
}

/// <inheritdoc/>
[Obsolete("Use InvokeAsync with AgentThread instead.")]
[Obsolete("Use InvokeAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public override IAsyncEnumerable<ChatMessageContent> InvokeAsync(
ChatHistory history,
KernelArguments? arguments = null,
Expand Down Expand Up @@ -186,7 +186,7 @@ public override async IAsyncEnumerable<AgentResponseItem<StreamingChatMessageCon
}

/// <inheritdoc/>
[Obsolete("Use InvokeStreamingAsync with AgentThread instead.")]
[Obsolete("Use InvokeStreamingAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public override IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
ChatHistory history,
KernelArguments? arguments = null,
Expand Down
30 changes: 15 additions & 15 deletions dotnet/src/Agents/OpenAI/OpenAIAssistantAgent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public OpenAIAssistantAgent(
/// An assistant removed by other means will result in an exception when invoked.
/// </remarks>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to manage the Assistant definition lifecycle.")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to manage the Assistant definition lifecycle. This method will be removed after May 1st 2025.")]
public bool IsDeleted { get; private set; }

/// <summary>
Expand All @@ -114,7 +114,7 @@ public OpenAIAssistantAgent(
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An <see cref="OpenAIAssistantAgent"/> instance.</returns>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantFromTemplateAsync).")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantFromTemplateAsync). This method will be removed after May 1st 2025.")]
public static async Task<OpenAIAssistantAgent> 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,
Expand Down Expand Up @@ -164,7 +164,7 @@ public static async Task<OpenAIAssistantAgent> CreateFromTemplateAsync(
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An <see cref="OpenAIAssistantAgent"/> instance.</returns>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantAsync).")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantAsync). This method will be removed after May 1st 2025.")]
public static async Task<OpenAIAssistantAgent> 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,
Expand Down Expand Up @@ -202,7 +202,7 @@ public static async Task<OpenAIAssistantAgent> CreateAsync(
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>A list of <see cref="OpenAIAssistantDefinition"/> objects.</returns>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to query for assistant definitions (GetAssistantsAsync).")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to query for assistant definitions (GetAssistantsAsync). This method will be removed after May 1st 2025.")]
public static async IAsyncEnumerable<OpenAIAssistantDefinition> 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,
Expand Down Expand Up @@ -230,7 +230,7 @@ public static async IAsyncEnumerable<OpenAIAssistantDefinition> ListDefinitionsA
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An <see cref="OpenAIAssistantAgent"/> instance.</returns>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to retrieve an assistant definition (GetAssistantsAsync).")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to retrieve an assistant definition (GetAssistantsAsync). This method will be removed after May 1st 2025.")]
public static async Task<OpenAIAssistantAgent> 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,
Expand Down Expand Up @@ -274,7 +274,7 @@ public static async Task<OpenAIAssistantAgent> RetrieveAsync(
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The thread identifier.</returns>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAIAssistantAgentThread to create a thread or use invoke without a thread to create a new one.")]
[Obsolete("Use the OpenAIAssistantAgentThread to create a thread or use invoke without a thread to create a new one. This method will be removed after May 1st 2025.")]
public Task<string> CreateThreadAsync(CancellationToken cancellationToken = default)
=> this.CreateThreadAsync(options: null, cancellationToken);

Expand All @@ -285,7 +285,7 @@ public Task<string> CreateThreadAsync(CancellationToken cancellationToken = defa
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The thread identifier.</returns>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAIAssistantAgentThread to create a thread or use invoke without a thread to create a new one.")]
[Obsolete("Use the OpenAIAssistantAgentThread to create a thread or use invoke without a thread to create a new one. This method will be removed after May 1st 2025.")]
public Task<string> CreateThreadAsync(OpenAIThreadCreationOptions? options, CancellationToken cancellationToken = default)
=> this.Client.CreateThreadAsync(
options?.Messages,
Expand All @@ -301,7 +301,7 @@ public Task<string> CreateThreadAsync(OpenAIThreadCreationOptions? options, Canc
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>The thread identifier.</returns>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAIAssistantAgentThread to delete an existing thread.")]
[Obsolete("Use the OpenAIAssistantAgentThread to delete an existing thread. This method will be removed after May 1st 2025.")]
public async Task<bool> DeleteThreadAsync(
string threadId,
CancellationToken cancellationToken = default)
Expand All @@ -323,7 +323,7 @@ public async Task<bool> DeleteThreadAsync(
/// <remarks>
/// This method only supports messages with <see href="https://platform.openai.com/docs/api-reference/runs/createRun#runs-createrun-additional_messages">role = User or Assistant</see>.
/// </remarks>
[Obsolete("Pass messages directly to Invoke instead.")]
[Obsolete("Pass messages directly to Invoke instead. This method will be removed after May 1st 2025.")]
public Task AddChatMessageAsync(string threadId, ChatMessageContent message, CancellationToken cancellationToken = default)
{
return AssistantThreadActions.CreateMessageAsync(this.Client, threadId, message, cancellationToken);
Expand All @@ -335,7 +335,7 @@ public Task AddChatMessageAsync(string threadId, ChatMessageContent message, Can
/// <param name="threadId">The thread identifier.</param>
/// <param name="cancellationToken">The <see cref="CancellationToken"/> to monitor for cancellation requests. The default is <see cref="CancellationToken.None"/>.</param>
/// <returns>An asynchronous enumeration of messages.</returns>
[Obsolete("Use the OpenAIAssistantAgentThread to retrieve messages instead.")]
[Obsolete("Use the OpenAIAssistantAgentThread to retrieve messages instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> GetThreadMessagesAsync(string threadId, CancellationToken cancellationToken = default)
{
return AssistantThreadActions.GetMessagesAsync(this.Client, threadId, null, cancellationToken);
Expand All @@ -350,7 +350,7 @@ public IAsyncEnumerable<ChatMessageContent> GetThreadMessagesAsync(string thread
/// An assistant-based agent is not usable after deletion.
/// </remarks>
[Experimental("SKEXP0110")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to remove or otherwise modify the Assistant definition.")]
[Obsolete("Use the OpenAI.Assistants.AssistantClient to remove or otherwise modify the Assistant definition. This method will be removed after May 1st 2025.")]
public async Task<bool> DeleteAsync(CancellationToken cancellationToken = default)
{
if (!this.IsDeleted)
Expand Down Expand Up @@ -460,7 +460,7 @@ async IAsyncEnumerable<ChatMessageContent> InternalInvokeAsync()
/// <remarks>
/// The "arguments" parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeAsync with AgentThread instead.")]
[Obsolete("Use InvokeAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> InvokeAsync(
string threadId,
KernelArguments? arguments = null,
Expand All @@ -480,7 +480,7 @@ public IAsyncEnumerable<ChatMessageContent> InvokeAsync(
/// <remarks>
/// The "arguments" parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeAsync with AgentThread instead.")]
[Obsolete("Use InvokeAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<ChatMessageContent> InvokeAsync(
string threadId,
RunCreationOptions? options,
Expand Down Expand Up @@ -599,7 +599,7 @@ public async IAsyncEnumerable<AgentResponseItem<StreamingChatMessageContent>> In
/// <remarks>
/// The "arguments" parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeStreamingAsync with AgentThread instead.")]
[Obsolete("Use InvokeStreamingAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
string threadId,
KernelArguments? arguments = null,
Expand All @@ -621,7 +621,7 @@ public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
/// <remarks>
/// The "arguments" parameter is not currently used by the agent, but is provided for future extensibility.
/// </remarks>
[Obsolete("Use InvokeStreamingAsync with AgentThread instead.")]
[Obsolete("Use InvokeStreamingAsync with AgentThread instead. This method will be removed after May 1st 2025.")]
public IAsyncEnumerable<StreamingChatMessageContent> InvokeStreamingAsync(
string threadId,
RunCreationOptions? options,
Expand Down
Loading