Skip to content

.NET: [BREAKING] Change namespaces of the Microsoft.Agents.AI.OpenAI classes - #2627

Merged
SergeyMenshykh merged 16 commits into
microsoft:mainfrom
SergeyMenshykh:openai-fix-namespaces
Dec 9, 2025
Merged

.NET: [BREAKING] Change namespaces of the Microsoft.Agents.AI.OpenAI classes #2627
SergeyMenshykh merged 16 commits into
microsoft:mainfrom
SergeyMenshykh:openai-fix-namespaces

Conversation

@SergeyMenshykh

@SergeyMenshykhSergeyMenshykh commented Dec 4, 2025

Copy link
Copy Markdown
Contributor

Motivation and Context

As part of the AF GA initiative, this PR changes the namespaces of the classes in the Microsoft.Agents.AI.OpenAI package. The

OpenAIChatClientAgent and OpenAIResponseClientAgent classes are moved from the OpenAI namespace to the Microsoft.Agents.AI namespace, while all the extension classes are moved to the namespaces of the types they are extending.

Contributes to: #2542

@SergeyMenshykhSergeyMenshykh self-assigned this Dec 4, 2025
CopilotAI review requested due to automatic review settings December 4, 2025 09:40
@SergeyMenshykhSergeyMenshykh added the .NET Usage: [Issues, PRs], Target: .Net label Dec 4, 2025
@SergeyMenshykhSergeyMenshykh moved this to In Review in Agent FrameworkDec 4, 2025

CopilotAI left a comment

Copy link
Copy Markdown
Contributor

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 implements a breaking change that reorganizes namespaces in the Microsoft.Agents.AI.OpenAI package as part of the Agent Framework GA initiative. The main agent classes (OpenAIChatClientAgent and OpenAIResponseClientAgent) are moved from the OpenAI namespace to Microsoft.Agents.AI, while extension classes are moved to the namespaces of the types they extend.

Key Changes:

  • Moved OpenAIChatClientAgent and OpenAIResponseClientAgent from OpenAI namespace to Microsoft.Agents.AI namespace
  • Moved extension classes to namespaces of extended types (e.g., OpenAIChatClientExtensions to OpenAI.Chat, OpenAIResponseClientExtensions to OpenAI.Responses, OpenAIAssistantClientExtensions to OpenAI.Assistants)
  • Removed redundant method overrides from OpenAIChatClientAgent that simply called base implementations

Reviewed changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated no comments.

Show a summary per file
FileDescription
OpenAIChatClientAgent.csChanged namespace from OpenAI to Microsoft.Agents.AI; removed redundant using statement and base method overrides
OpenAIResponseClientAgent.csChanged namespace from OpenAI to Microsoft.Agents.AI; removed redundant using statement
OpenAIChatClientExtensions.csChanged namespace from OpenAI to OpenAI.Chat to match extended type; removed redundant using statement
OpenAIResponseClientExtensions.csChanged namespace from OpenAI to OpenAI.Responses to match extended type; removed redundant using statement
OpenAIAssistantClientExtensions.csChanged namespace from OpenAI to OpenAI.Assistants to match extended type; removed redundant using statement
AgentRunResponseExtensions.csChanged namespace from OpenAI to Microsoft.Agents.AI to match extended type
AIAgentWithOpenAIExtensions.csChanged namespace from OpenAI to Microsoft.Agents.AI to match extended type; removed redundant using statement
Test files (3 files)Updated using statements from using OpenAI; to using OpenAI.Chat; to match new extension namespaces
Unit test fileAdded ChatMessage alias and OpenAIChatClient alias to resolve ambiguities with OpenAI types
Sample files (35 files)Updated using statements to import specific OpenAI namespaces (OpenAI.Chat, OpenAI.Responses, OpenAI.Assistants) instead of the broad OpenAI namespace; added ChatMessage type aliases where needed to resolve ambiguities

Comment threaddotnet/src/Microsoft.Agents.AI.OpenAI/OpenAIChatClientAgent.cs Outdated
Comment threaddotnet/src/Microsoft.Agents.AI.OpenAI/OpenAIResponseClientAgent.cs Outdated
Aris Nguyen (arisng) pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
…classes (microsoft#2627)
* change namespaces for agents and extension methods of the Microsoft.Agents.AI.OpenAI package
* remove unnecessary namespace
* remove unused namespaces
* fix compilation issues and rrolled back removed run methods
* sort usings
* add extension methods for AIAgent to work with OpenAI Responses primitives
* Move OpenAIChatClientAgent and OpenAIResponseClientAgent to samples
* sort usings
* sort usings
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

.NETUsage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants

@SergeyMenshykh@rogerbarreto@markwallace-microsoft@westey-m