-
Notifications
You must be signed in to change notification settings - Fork 944
.NET: Annotate all public methods of OpenAIAssistantClientExtensions with Obsolete attribute #2640
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
Conversation
…Extensions Co-authored-by: SergeyMenshykh <[email protected]>
|
@copilot fix the build |
…sistants API Co-authored-by: SergeyMenshykh <[email protected]>
Fixed in d1ac53d. Added |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR marks all 12 public extension methods in OpenAIAssistantClientExtensions as obsolete with the [Obsolete] attribute to guide users away from the deprecated OpenAI Assistants API. The changes also suppress obsolete warnings in existing test files and sample code that continue to use these methods.
Key Changes:
- Added
[Obsolete]attributes to all 12 public methods (6GetAIAgent, 2GetAIAgentAsync, 2CreateAIAgent, and 2CreateAIAgentAsyncoverloads) - Suppressed CS0618 warnings with
#pragma warning disablein test files and sample code that still reference these methods
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs |
Added [Obsolete] attributes to all 12 public extension methods |
dotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs |
Added pragma directive to suppress obsolete warnings in integration tests |
dotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs |
Added pragma directive to suppress obsolete warnings in unit tests |
dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs |
Added pragma directive to suppress obsolete warnings in sample code |
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.OpenAI/Extensions/OpenAIAssistantClientExtensions.cs
Outdated
Show resolved
Hide resolved
|
@copilot Use the "The Assistants API has been deprecated. Please use the Responses API instead." text for the Obsolete attribute |
Co-authored-by: SergeyMenshykh <[email protected]>
Motivation and Context
The OpenAI Assistants API has been deprecated by OpenAI in favor of the Responses API. All public extension methods in
OpenAIAssistantClientExtensionsshould be marked as obsolete to guide users toward the newer API.Description
Added
[Obsolete("The Assistants API has been deprecated. Please use the Responses API instead.")]to all 12 public methods:GetAIAgent(6 overloads)GetAIAgentAsync(2 overloads)CreateAIAgent(2 overloads)CreateAIAgentAsync(2 overloads)Also added
#pragma warning disable CS0618to the following files to suppress obsolete warnings when using/testing the deprecated methods:dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIAssistants/Program.cs- Sample code demonstrating the deprecated APIdotnet/tests/OpenAIAssistant.IntegrationTests/OpenAIAssistantClientExtensionsTests.cs- Integration tests for the deprecated extension methodsdotnet/tests/Microsoft.Agents.AI.OpenAI.UnitTests/Extensions/OpenAIAssistantClientExtensionsTests.cs- Unit tests for the deprecated extension methodsContribution Checklist
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.