Files
agent-framework/dotnet/samples/GettingStarted/AgentWithAnthropic
T
Copilot de78348d76 .NET: Add .NET Anthropic Claude Skills sample (#3497)
* Initial plan

* Add Claude Skills sample and integration tests for Anthropic

- Add Agent_Anthropic_Step04_UsingSkills sample demonstrating pptx skill usage
- Add integration tests for skills functionality
- Update README.md with new sample reference
- Update solution file to include new sample project

Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>

* Simplify Anthropic Skills sample with AsAITool and add file download

* Remove excessive comments from integration tests

* Update README with correct model name and syntax

* Fix Anthropic SDK 12.3.0 API changes: APIKey->ApiKey, SkillListPageResponse->SkillListPage, Data->Items

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rogerbarreto <19890735+rogerbarreto@users.noreply.github.com>
de78348d76 ยท 2026-02-04 17:49:49 +00:00
History
..

Getting started with agents using Anthropic

The getting started with agents using Anthropic samples demonstrate the fundamental concepts and functionalities of single agents using Anthropic as the AI provider.

These samples use Anthropic Claude models as the AI provider and use ChatCompletion as the type of service.

For other samples that demonstrate how to create and configure each type of agent that come with the agent framework, see the How to create an agent for each provider samples.

Getting started with agents using Anthropic prerequisites

Before you begin, ensure you have the following prerequisites:

  • .NET 8.0 SDK or later
  • Anthropic API key configured
  • User has access to Anthropic Claude models

Note: These samples use Anthropic Claude models. For more information, see Anthropic documentation.

Using Anthropic with Azure Foundry

To use Anthropic with Azure Foundry, you can check the sample AgentProviders/Agent_With_Anthropic for more details.

Samples

Sample Description
Running a simple agent This sample demonstrates how to create and run a basic agent with Anthropic Claude
Using reasoning with an agent This sample demonstrates how to use extended thinking/reasoning capabilities with Anthropic Claude agents
Using function tools with an agent This sample demonstrates how to use function tools with an Anthropic Claude agent
Using Skills with an agent This sample demonstrates how to use Anthropic-managed Skills (e.g., pptx) with an Anthropic Claude agent

Running the samples from the console

To run the samples, navigate to the desired sample directory, e.g.

cd Agent_Anthropic_Step01_Running

Set the following environment variables:

$env:ANTHROPIC_API_KEY="your-anthropic-api-key"  # Replace with your Anthropic API key

If the variables are not set, you will be prompted for the values when running the samples.

Execute the following command to build the sample:

dotnet build

Execute the following command to run the sample:

dotnet run --no-build

Or just build and run in one step:

dotnet run

Running the samples from Visual Studio

Open the solution in Visual Studio and set the desired sample project as the startup project. Then, run the project using the built-in debugger or by pressing F5.

You will be prompted for any required environment variables if they are not already set.