.NET: [BREAKING] Renamed CreateAIAgent/GetAIAgent to AsAIAgent#3222
Merged
dmytrostruk merged 10 commits intomicrosoft:mainfrom Jan 15, 2026
Merged
.NET: [BREAKING] Renamed CreateAIAgent/GetAIAgent to AsAIAgent#3222dmytrostruk merged 10 commits intomicrosoft:mainfrom
dmytrostruk merged 10 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR implements a breaking change to rename extension methods that create local wrapper agents from CreateAIAgent/GetAIAgent to AsAIAgent, following the naming convention where As* indicates a lightweight conversion/wrapping operation without side effects. Methods that perform server-side operations (create/retrieve agents from remote services) retain their original CreateAIAgent/GetAIAgent names.
Changes:
- Renamed local wrapper methods across all agent client extension classes to use
AsAIAgentnaming - Updated all test files to use the new method names
- Updated all sample files to use the new method names
Reviewed changes
Copilot reviewed 92 out of 92 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| ChatClientExtensions.cs | Renamed CreateAIAgent → AsAIAgent for local wrapper methods |
| ChatClientBuilderExtensions.cs | Updated calls to use AsAIAgent |
| OpenAIResponseClientExtensions.cs | Renamed CreateAIAgent → AsAIAgent for local wrapper methods |
| OpenAIChatClientExtensions.cs | Renamed CreateAIAgent → AsAIAgent for local wrapper methods |
| OpenAIAssistantClientExtensions.cs | Renamed GetAIAgent → AsAIAgent for metadata-based wrapper methods only |
| AzureAIProjectChatClientExtensions.cs | Renamed GetAIAgent → AsAIAgent for AgentRecord/AgentVersion overloads |
| PersistentAgentsClientExtensions.cs | Renamed GetAIAgent → AsAIAgent for Response/PersistentAgent overloads |
| AnthropicClientExtensions.cs | Renamed CreateAIAgent → AsAIAgent for local wrapper methods |
| AnthropicBetaServiceExtensions.cs | Renamed CreateAIAgent → AsAIAgent for local wrapper methods |
| A2AClientExtensions.cs | Renamed GetAIAgent → AsAIAgent |
| A2AAgentCardExtensions.cs | Renamed GetAIAgent → AsAIAgent |
| A2ACardResolverExtensions.cs | Updated call to use AsAIAgent |
| AzureAgentProvider.cs | Updated call to use AsAIAgent |
| Test files (13 files) | Updated all method calls from CreateAIAgent/GetAIAgent to AsAIAgent |
| Sample files (47 files) | Updated all method calls from CreateAIAgent/GetAIAgent to AsAIAgent |
Comments suppressed due to low confidence (1)
dotnet/src/Microsoft.Agents.AI.AzureAI/AzureAIProjectChatClientExtensions.cs:199
- The XML documentation comment is misleading. The method at line 208 retrieves an existing server-side agent (as evidenced by the call to
GetAgentRecordByNameat line 225), it does not create a new agent. The comment should say 'Retrieves an existing server side agent' or similar to match the actual behavior and be consistent with otherGetAIAgentoverloads in this file.
This was referenced Jan 24, 2026
This was referenced Feb 1, 2026
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…soft#3222) * Renamed chat client extension method * Additional renaming * Updated documentation * Fixed tests * Small fix * Small fix
arisng
pushed a commit
to arisng/agent-framework
that referenced
this pull request
Feb 2, 2026
…nctions (microsoft#3042) * Durable Agent samples and automated validation for non-Azure Functions * Update test projects * fix file encoding * Remove AgentThreadMetadata usage * Absorb breaking change from microsoft#3152 * Absorb newer breaking changes (AgentRunResponse --> AgentResponse) * Absorb more breaking changes (see microsoft#3222) * Improve integration test reliability (isolated task hubs, etc.) * Fix flakey streaming test --------- Co-authored-by: Mark Wallace <127216156+markwallace-microsoft@users.noreply.github.com>
This was referenced Feb 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Related ADR: https://github.com/microsoft/agent-framework/blob/main/docs/decisions/0011-create-get-agent-api.md
This PR renames extension methods that create local wrapper agents from CreateAIAgent/GetAIAgent to AsAIAgent, following naming conventions where As* indicates a lightweight conversion/wrapping operation without side effects.
Methods that perform server-side operations (create/retrieve agents from remote services) keep their original names.
Impacted Classes:
Contribution Checklist