Uh oh!
There was an error while loading. Please reload this page.
.NET: Add Anthropic Agent Package - #2359
Conversation
…nto feature-anthropic-package
There was a problem hiding this comment.
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 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
* 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>
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: Stephen Toub (@stephentoub)