Skip to content

Conversation

@SergeyMenshykh
Copy link
Member

@SergeyMenshykh SergeyMenshykh commented Dec 4, 2025

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

@SergeyMenshykh SergeyMenshykh self-assigned this Dec 4, 2025
Copilot AI review requested due to automatic review settings December 4, 2025 09:40
@SergeyMenshykh SergeyMenshykh moved this to In Review in Agent Framework Dec 4, 2025
Copy link
Contributor

Copilot AI left a 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 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
File Description
OpenAIChatClientAgent.cs Changed namespace from OpenAI to Microsoft.Agents.AI; removed redundant using statement and base method overrides
OpenAIResponseClientAgent.cs Changed namespace from OpenAI to Microsoft.Agents.AI; removed redundant using statement
OpenAIChatClientExtensions.cs Changed namespace from OpenAI to OpenAI.Chat to match extended type; removed redundant using statement
OpenAIResponseClientExtensions.cs Changed namespace from OpenAI to OpenAI.Responses to match extended type; removed redundant using statement
OpenAIAssistantClientExtensions.cs Changed namespace from OpenAI to OpenAI.Assistants to match extended type; removed redundant using statement
AgentRunResponseExtensions.cs Changed namespace from OpenAI to Microsoft.Agents.AI to match extended type
AIAgentWithOpenAIExtensions.cs Changed 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 file Added 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

using ChatMessage = OpenAI.Chat.ChatMessage;

namespace OpenAI;
namespace Microsoft.Agents.AI;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this was put in the OpenAI namespace was so that developers who are just using OpenAI and it's primitives don't need a using Microsoft.Agents.AI. This change means OpenAI developers will see the MEAI and OpenAI primitives are there are conflicting names.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this was put in the OpenAI namespace was so that developers who are just using OpenAI and it's primitives don't need a using Microsoft.Agents.AI. This change means OpenAI developers will see the MEAI and OpenAI primitives are there are conflicting names.

Do we need to keep using those?

Can't we just make extensions from RunAsync and RunStreamingAsync that gives back the OpenAI type, do we need to have a specific public class for it?

using OpenAI.Responses;

namespace OpenAI;
namespace Microsoft.Agents.AI;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason this was put in the OpenAI namespace was so that developers who are just using OpenAI and it's primitives don't need a using Microsoft.Agents.AI. This change means OpenAI developers will see the MEAI and OpenAI primitives are there are conflicting names.

using OpenAI.Chat;

namespace OpenAI;
namespace Microsoft.Agents.AI;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One problem with this is if I an not using OpenAI I am going to see these extension methods and they may confuse developers. The intention here was that there are developers who want to use the OpenAI primitives and not the MEAI primitives and we want to make sure they don't have to deal with conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

4 participants