From 6fb2f27afa7f33ddc339bb7ce25f41e51955335e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 17:58:04 +0000 Subject: [PATCH 1/4] Initial plan From fe969a0ceae4a58164bc4209487f172b2ea895de Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 18:06:07 +0000 Subject: [PATCH 2/4] Add Obsolete attribute to all public methods of OpenAIAssistantClientExtensions Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> --- .../Extensions/OpenAIAssistantClientExtensions.cs | 12 ++++++++++++ .../OpenAIAssistantClientExtensionsTests.cs | 2 ++ 2 files changed, 14 insertions(+) diff --git a/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs b/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs index fb464fdc398..a3ca550257e 100644 --- a/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs @@ -30,6 +30,7 @@ public static class OpenAIAssistantClientExtensions /// Provides a way to customize the creation of the underlying used by the agent. /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, ClientResult assistantClientResult, @@ -54,6 +55,7 @@ public static ChatClientAgent GetAIAgent( /// Provides a way to customize the creation of the underlying used by the agent. /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, Assistant assistantMetadata, @@ -102,6 +104,7 @@ public static ChatClientAgent GetAIAgent( /// An optional to use for resolving services required by the instances being invoked. /// The to monitor for cancellation requests. The default is . /// A instance that can be used to perform operations on the assistant agent. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, string agentId, @@ -134,6 +137,7 @@ public static ChatClientAgent GetAIAgent( /// An optional to use for resolving services required by the instances being invoked. /// The to monitor for cancellation requests. The default is . /// A instance that can be used to perform operations on the assistant agent. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static async Task GetAIAgentAsync( this AssistantClient assistantClient, string agentId, @@ -166,6 +170,7 @@ public static async Task GetAIAgentAsync( /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. /// or is . + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, ClientResult assistantClientResult, @@ -191,6 +196,7 @@ public static ChatClientAgent GetAIAgent( /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. /// or is . + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, Assistant assistantMetadata, @@ -252,6 +258,7 @@ public static ChatClientAgent GetAIAgent( /// A instance that can be used to perform operations on the assistant agent. /// or is . /// is empty or whitespace. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, string agentId, @@ -291,6 +298,7 @@ public static ChatClientAgent GetAIAgent( /// A instance that can be used to perform operations on the assistant agent. /// or is . /// is empty or whitespace. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static async Task GetAIAgentAsync( this AssistantClient assistantClient, string agentId, @@ -333,6 +341,7 @@ public static async Task GetAIAgentAsync( /// An instance backed by the OpenAI Assistant service. /// Thrown when or is . /// Thrown when is empty or whitespace. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent CreateAIAgent( this AssistantClient client, string model, @@ -371,6 +380,7 @@ public static ChatClientAgent CreateAIAgent( /// An instance backed by the OpenAI Assistant service. /// Thrown when or or is . /// Thrown when is empty or whitespace. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static ChatClientAgent CreateAIAgent( this AssistantClient client, string model, @@ -437,6 +447,7 @@ public static ChatClientAgent CreateAIAgent( /// An instance backed by the OpenAI Assistant service. /// Thrown when or is . /// Thrown when is empty or whitespace. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static async Task CreateAIAgentAsync( this AssistantClient client, string model, @@ -477,6 +488,7 @@ await client.CreateAIAgentAsync(model, /// An instance backed by the OpenAI Assistant service. /// Thrown when or is . /// Thrown when is empty or whitespace. + [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] public static async Task CreateAIAgentAsync( this AssistantClient client, string model, diff --git a/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs b/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs index 26f855d59e1..c75d72cf343 100644 --- a/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs +++ b/dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs @@ -1,5 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. +#pragma warning disable CS0618 // Type or member is obsolete - This is intentional as we are testing deprecated methods + using System; using System.ClientModel; using System.ClientModel.Primitives; From d1ac53d5e4d21cb8d1f206e88e7392426729e66f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 4 Dec 2025 20:25:14 +0000 Subject: [PATCH 3/4] Add pragma warning disable CS0618 to files using deprecated OpenAI Assistants API Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> --- .../AgentProviders/Agent_With_OpenAIAssistants/Program.cs | 2 ++ .../OpenAIAssistantClientExtensionsTests.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs index 9a91e43d378..b39a21f71fc 100644 --- a/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs +++ b/dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs @@ -5,6 +5,8 @@ // WARNING: The Assistants API is deprecated and will be shut down. // For more information see the OpenAI documentation: https://platform.openai.com/docs/assistants/migration +#pragma warning disable CS0618 // Type or member is obsolete - OpenAI Assistants API is deprecated but still used in this sample + using Microsoft.Agents.AI; using OpenAI; diff --git a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs index f1373bd98b0..0c8d6b80dd6 100644 --- a/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs +++ b/dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs @@ -1,5 +1,7 @@ // Copyright (c) Microsoft. All rights reserved. +#pragma warning disable CS0618 // Type or member is obsolete - Testing deprecated OpenAI Assistants API extension methods + using System; using System.Diagnostics; using System.IO; From dd56f501033c4c05a2f3e4fe57e3d32930996844 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 5 Dec 2025 09:32:39 +0000 Subject: [PATCH 4/4] Update Obsolete attribute message to use requested text Co-authored-by: SergeyMenshykh <68852919+SergeyMenshykh@users.noreply.github.com> --- .../OpenAIAssistantClientExtensions.cs | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs b/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs index a3ca550257e..f103a7fc1c4 100644 --- a/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs +++ b/dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs @@ -30,7 +30,7 @@ public static class OpenAIAssistantClientExtensions /// Provides a way to customize the creation of the underlying used by the agent. /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, ClientResult assistantClientResult, @@ -55,7 +55,7 @@ public static ChatClientAgent GetAIAgent( /// Provides a way to customize the creation of the underlying used by the agent. /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, Assistant assistantMetadata, @@ -104,7 +104,7 @@ public static ChatClientAgent GetAIAgent( /// An optional to use for resolving services required by the instances being invoked. /// The to monitor for cancellation requests. The default is . /// A instance that can be used to perform operations on the assistant agent. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, string agentId, @@ -137,7 +137,7 @@ public static ChatClientAgent GetAIAgent( /// An optional to use for resolving services required by the instances being invoked. /// The to monitor for cancellation requests. The default is . /// A instance that can be used to perform operations on the assistant agent. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static async Task GetAIAgentAsync( this AssistantClient assistantClient, string agentId, @@ -170,7 +170,7 @@ public static async Task GetAIAgentAsync( /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. /// or is . - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, ClientResult assistantClientResult, @@ -196,7 +196,7 @@ public static ChatClientAgent GetAIAgent( /// An optional to use for resolving services required by the instances being invoked. /// A instance that can be used to perform operations on the assistant. /// or is . - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, Assistant assistantMetadata, @@ -258,7 +258,7 @@ public static ChatClientAgent GetAIAgent( /// A instance that can be used to perform operations on the assistant agent. /// or is . /// is empty or whitespace. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent GetAIAgent( this AssistantClient assistantClient, string agentId, @@ -298,7 +298,7 @@ public static ChatClientAgent GetAIAgent( /// A instance that can be used to perform operations on the assistant agent. /// or is . /// is empty or whitespace. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static async Task GetAIAgentAsync( this AssistantClient assistantClient, string agentId, @@ -341,7 +341,7 @@ public static async Task GetAIAgentAsync( /// An instance backed by the OpenAI Assistant service. /// Thrown when or is . /// Thrown when is empty or whitespace. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent CreateAIAgent( this AssistantClient client, string model, @@ -380,7 +380,7 @@ public static ChatClientAgent CreateAIAgent( /// An instance backed by the OpenAI Assistant service. /// Thrown when or or is . /// Thrown when is empty or whitespace. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static ChatClientAgent CreateAIAgent( this AssistantClient client, string model, @@ -447,7 +447,7 @@ public static ChatClientAgent CreateAIAgent( /// An instance backed by the OpenAI Assistant service. /// Thrown when or is . /// Thrown when is empty or whitespace. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static async Task CreateAIAgentAsync( this AssistantClient client, string model, @@ -488,7 +488,7 @@ await client.CreateAIAgentAsync(model, /// An instance backed by the OpenAI Assistant service. /// Thrown when or is . /// Thrown when is empty or whitespace. - [Obsolete("The OpenAI Assistants API has been deprecated. Please use OpenAI Responses API instead.")] + [Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")] public static async Task CreateAIAgentAsync( this AssistantClient client, string model,