Skip to content

.NET: Add Anthropic Agent Package - #2359

Merged
Roger Barreto (rogerbarreto) merged 31 commits into
microsoft:mainfrom
rogerbarreto:feature-anthropic-dotnet
Nov 25, 2025
Merged

.NET: Add Anthropic Agent Package #2359
Roger Barreto (rogerbarreto) merged 31 commits into
microsoft:mainfrom
rogerbarreto:feature-anthropic-dotnet

Conversation

@rogerbarreto

@rogerbarretoRoger Barreto (rogerbarreto) commented Nov 20, 2025

Copy link
Copy Markdown
Member

Adding Anthropic AIAgent Support

Using offical Anthropic Package.

https://www.nuget.org/packages/Anthropic

  • Unit Tests
  • Integration Tests
  • Extensions
  • Samples

cc: Stephen Toub (@stephentoub)

CopilotAI review requested due to automatic review settings November 20, 2025 21:40
@markwallace-microsoftMark Wallace (markwallace-microsoft) added documentation Usage: [Issues, PRs], Target: documentation in the code base and learn docs .NET Usage: [Issues, PRs], Target: .Net labels Nov 20, 2025
@github-actionsgithub-actionsBot changed the title .Net: Add Anthropic Agent Package .NET: Add Anthropic Agent Package Nov 20, 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 adds comprehensive support for Anthropic Claude models to the Microsoft Agent Framework, enabling developers to create AI agents using the official Anthropic SDK.

Key Changes:

  • Integration with Anthropic SDK via polyfill extensions (to be replaced once upstream PR merges)
  • Extension methods for creating agents from IAnthropicClient and IBetaService
  • Support for advanced features including reasoning/thinking capabilities and function tools

Reviewed Changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 27 comments.

Show a summary per file
FileDescription
dotnet/src/Microsoft.Agents.AI.Anthropic/Microsoft.Agents.AI.Anthropic.csprojNew project file for Anthropic agent support package
dotnet/src/Microsoft.Agents.AI.Anthropic/AnthropicClientExtensions.csExtension methods to create AI agents from IAnthropicClient
dotnet/src/Microsoft.Agents.AI.Anthropic/AnthropicBetaServiceExtensions.csExtension methods to create AI agents from IBetaService
dotnet/src/Microsoft.Agents.AI.Anthropic/AnthropicClientJsonContext.csJSON serialization context for Anthropic operations
dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicClientExtensions.csPolyfill implementation for IChatClient support (temporary)
dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicBetaClientExtensions.csPolyfill implementation for Beta service IChatClient support (temporary)
dotnet/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Microsoft.Agents.AI.Anthropic.UnitTests.csprojUnit test project configuration
dotnet/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicClientExtensionsTests.csUnit tests for IAnthropicClient extension methods
dotnet/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicBetaServiceExtensionsTests.csUnit tests for IBetaService extension methods
dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletion.IntegrationTests.csprojIntegration test project configuration
dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.csTest fixture supporting both regular and reasoning models
dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunTests.csIntegration tests for agent runs
dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunStreamingTests.csIntegration tests for streaming agent runs
dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunTests.csIntegration tests for ChatClientAgent runs
dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunStreamingTests.csIntegration tests for streaming ChatClientAgent runs
dotnet/src/Shared/IntegrationTests/AnthropicConfiguration.csConfiguration class for Anthropic integration tests
dotnet/samples/GettingStarted/README.mdUpdated to reference new Anthropic samples
dotnet/samples/GettingStarted/AgentWithAnthropic/README.mdDocumentation for Anthropic agent samples
dotnet/samples/GettingStarted/AgentWithAnthropic/Agent_Anthropic_Step01_Running/Program.csSample demonstrating basic Anthropic agent usage
dotnet/samples/GettingStarted/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/Program.csSample demonstrating extended thinking/reasoning capabilities
dotnet/samples/GettingStarted/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/Program.csSample demonstrating function tool integration
dotnet/samples/GettingStarted/AgentProviders/README.mdUpdated to reference new Anthropic provider sample
dotnet/samples/GettingStarted/AgentProviders/Agent_With_Anthropic/Program.csSample showing different deployment scenarios (Public API, Azure Foundry)
dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Program.csUnrelated code accidentally added
dotnet/nuget.configAdded local package source (developer-specific path)
dotnet/Directory.Packages.propsAdded Anthropic package references
dotnet/agent-framework-dotnet.slnxAdded new projects to solution

Aris Nguyen (arisng) pushed a commit to arisng/agent-framework that referenced this pull request Feb 2, 2026
* WIP
* WIP
* Simple call working
* Update Thinking sample
* Non-Streaming Function calling working
* Update Anthropic Impl
* Public Preps
* UT + IT working
* Update documentation + samples
* Update variable
* Revert nuget.config
* Add IT for BetaService implementation
* Remove polyfill + enable IT to run for netstandard 2.0
* Skipping Anthropic IT's for manual execution and avoid pipeline execution
* Fix compilation error
* Address error in UT
* Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* Fix warning
* Net 10 update
* Update for NET 10, remove Anthropic.Foundry due to vulnerability
* Final missing adjustments for NET 10
* Address PR comments
* Remove unused code
* Address feedback
---------
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentationUsage: [Issues, PRs], Target: documentation in the code base and learn docs.NETUsage: [Issues, PRs], Target: .Net

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

5 participants

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