-
Notifications
You must be signed in to change notification settings - Fork 816
.NET: Add Anthropic Agent Package #2359
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
Merged
rogerbarreto
merged 31 commits into
microsoft:main
from
rogerbarreto:feature-anthropic-dotnet
Nov 25, 2025
Merged
.NET: Add Anthropic Agent Package #2359
rogerbarreto
merged 31 commits into
microsoft:main
from
rogerbarreto:feature-anthropic-dotnet
Nov 25, 2025
+1,628
−2
Conversation
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
…nto feature-anthropic-package
Copilot finished reviewing on behalf of
rogerbarreto
November 20, 2025 21:43
Contributor
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 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
| File | Description |
|---|---|
| dotnet/src/Microsoft.Agents.AI.Anthropic/Microsoft.Agents.AI.Anthropic.csproj | New project file for Anthropic agent support package |
| dotnet/src/Microsoft.Agents.AI.Anthropic/AnthropicClientExtensions.cs | Extension methods to create AI agents from IAnthropicClient |
| dotnet/src/Microsoft.Agents.AI.Anthropic/AnthropicBetaServiceExtensions.cs | Extension methods to create AI agents from IBetaService |
| dotnet/src/Microsoft.Agents.AI.Anthropic/AnthropicClientJsonContext.cs | JSON serialization context for Anthropic operations |
| dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicClientExtensions.cs | Polyfill implementation for IChatClient support (temporary) |
| dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicBetaClientExtensions.cs | Polyfill implementation for Beta service IChatClient support (temporary) |
| dotnet/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Microsoft.Agents.AI.Anthropic.UnitTests.csproj | Unit test project configuration |
| dotnet/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicClientExtensionsTests.cs | Unit tests for IAnthropicClient extension methods |
| dotnet/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicBetaServiceExtensionsTests.cs | Unit tests for IBetaService extension methods |
| dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletion.IntegrationTests.csproj | Integration test project configuration |
| dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionFixture.cs | Test fixture supporting both regular and reasoning models |
| dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunTests.cs | Integration tests for agent runs |
| dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunStreamingTests.cs | Integration tests for streaming agent runs |
| dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunTests.cs | Integration tests for ChatClientAgent runs |
| dotnet/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunStreamingTests.cs | Integration tests for streaming ChatClientAgent runs |
| dotnet/src/Shared/IntegrationTests/AnthropicConfiguration.cs | Configuration class for Anthropic integration tests |
| dotnet/samples/GettingStarted/README.md | Updated to reference new Anthropic samples |
| dotnet/samples/GettingStarted/AgentWithAnthropic/README.md | Documentation for Anthropic agent samples |
| dotnet/samples/GettingStarted/AgentWithAnthropic/Agent_Anthropic_Step01_Running/Program.cs | Sample demonstrating basic Anthropic agent usage |
| dotnet/samples/GettingStarted/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/Program.cs | Sample demonstrating extended thinking/reasoning capabilities |
| dotnet/samples/GettingStarted/AgentWithAnthropic/Agent_Anthropic_Step03_UsingFunctionTools/Program.cs | Sample demonstrating function tool integration |
| dotnet/samples/GettingStarted/AgentProviders/README.md | Updated to reference new Anthropic provider sample |
| dotnet/samples/GettingStarted/AgentProviders/Agent_With_Anthropic/Program.cs | Sample showing different deployment scenarios (Public API, Azure Foundry) |
| dotnet/samples/GettingStarted/AgentProviders/Agent_With_OpenAIChatCompletion/Program.cs | Unrelated code accidentally added |
| dotnet/nuget.config | Added local package source (developer-specific path) |
| dotnet/Directory.Packages.props | Added Anthropic package references |
| dotnet/agent-framework-dotnet.slnx | Added new projects to solution |
...t/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicClientExtensionsTests.cs
Show resolved
Hide resolved
...t/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicClientExtensionsTests.cs
Show resolved
Hide resolved
...t/tests/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicClientExtensionsTests.cs
Show resolved
Hide resolved
...ts/Microsoft.Agents.AI.Anthropic.UnitTests/Extensions/AnthropicBetaServiceExtensionsTests.cs
Show resolved
Hide resolved
dotnet/samples/GettingStarted/AgentWithAnthropic/Agent_Anthropic_Step02_Reasoning/Program.cs
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicBetaClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicBetaClientExtensions.cs
Outdated
Show resolved
Hide resolved
dotnet/src/Microsoft.Agents.AI.Anthropic/External/AnthropicClientExtensions.cs
Outdated
Show resolved
Hide resolved
SergeyMenshykh
approved these changes
Nov 24, 2025
dotnet/samples/GettingStarted/AgentProviders/Agent_With_Anthropic/Program.cs
Outdated
Show resolved
Hide resolved
westey-m
reviewed
Nov 25, 2025
westey-m
reviewed
Nov 25, 2025
...icChatCompletion.IntegrationTests/AnthropicChatCompletionChatClientAgentRunStreamingTests.cs
Outdated
Show resolved
Hide resolved
westey-m
reviewed
Nov 25, 2025
...t/tests/AnthropicChatCompletion.IntegrationTests/AnthropicChatCompletionRunStreamingTests.cs
Outdated
Show resolved
Hide resolved
westey-m
reviewed
Nov 25, 2025
westey-m
approved these changes
Nov 25, 2025
westey-m
approved these changes
Nov 25, 2025
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.
Adding Anthropic AIAgent Support
Using offical
Anthropic Package.https://www.nuget.org/packages/Anthropic
Polyfill will be removed as soon new Anthropic Package releases with
IChatClientsupport.Add Microsoft.Extensions.AI support anthropics/anthropic-sdk-csharp#10
cc: @stephentoub