diff --git a/skills/dotnet-microsoft-agent-framework/SKILL.md b/skills/dotnet-microsoft-agent-framework/SKILL.md index 36dc8f9..58dde49 100644 --- a/skills/dotnet-microsoft-agent-framework/SKILL.md +++ b/skills/dotnet-microsoft-agent-framework/SKILL.md @@ -1,6 +1,6 @@ --- name: dotnet-microsoft-agent-framework -version: "1.4.0" +version: "1.5.0" category: "AI" description: "Build .NET AI agents and multi-agent workflows with Microsoft Agent Framework using the right agent type, threads, tools, workflows, hosting protocols, and enterprise guardrails." compatibility: "Requires preview-era Microsoft Agent Framework packages and a .NET application that truly needs agentic or workflow orchestration." @@ -11,9 +11,10 @@ compatibility: "Requires preview-era Microsoft Agent Framework packages and a .N ## Trigger On - building or reviewing `.NET` code that uses `Microsoft.Agents.*`, `Microsoft.Extensions.AI`, `AIAgent`, `AgentThread`, or Agent Framework hosting packages -- choosing between `ChatClientAgent`, Responses agents, hosted agents, custom agents, workflows, or durable agents +- choosing between `ChatClientAgent`, Responses agents, hosted agents, custom agents, Anthropic agents, workflows, or durable agents - adding tools, MCP, A2A, OpenAI-compatible hosting, AG-UI, DevUI, background responses, or OpenTelemetry - migrating from Semantic Kernel agent APIs or aligning AutoGen-style multi-agent patterns to Agent Framework +- using Anthropic Claude models (haiku, sonnet, opus) via `AnthropicClient` or through Azure Foundry with `AnthropicFoundryClient` ## Workflow @@ -65,6 +66,7 @@ flowchart LR | OpenAI-style future-facing APIs, background responses, or richer response state | Responses-based agent | Better fit for new OpenAI-compatible integrations | | Simple client-managed chat history | Chat Completions agent | Keeps request/response simple | | Service-hosted agents and service-owned threads/tools | Azure AI Foundry Agent or other hosted agent | Managed runtime is the requirement | +| Anthropic Claude models (haiku, sonnet, opus) directly or via Azure Foundry | `AnthropicClient.AsAIAgent(...)` or `AnthropicFoundryClient.AsAIAgent(...)` | Use `Microsoft.Agents.AI.Anthropic`; add `Anthropic.Foundry` for Azure-hosted Claude | | Typed multi-step orchestration | `Workflow` | Control flow stays explicit and testable | | Week-long or failure-resilient Azure execution | Durable agent on Azure Functions | Durable Task gives replay and persisted state | | Agent-to-agent interoperability | A2A hosting or A2A proxy agent | This is protocol-level delegation, not local inference | diff --git a/skills/dotnet-microsoft-agent-framework/references/official-docs/user-guide/agents/agent-types/anthropic-agent.md b/skills/dotnet-microsoft-agent-framework/references/official-docs/user-guide/agents/agent-types/anthropic-agent.md index cbebf87..cf97ae9 100644 --- a/skills/dotnet-microsoft-agent-framework/references/official-docs/user-guide/agents/agent-types/anthropic-agent.md +++ b/skills/dotnet-microsoft-agent-framework/references/official-docs/user-guide/agents/agent-types/anthropic-agent.md @@ -5,7 +5,7 @@ zone_pivot_groups: programming-languages author: rogerbarreto ms.topic: tutorial ms.author: rbarreto -ms.date: 12/12/2025 +ms.date: 03/11/2026 ms.service: agent-framework --- @@ -23,6 +23,8 @@ Add the required NuGet packages to your project. dotnet add package Microsoft.Agents.AI.Anthropic --prerelease ``` +The `Microsoft.Agents.AI.Anthropic` package uses `Anthropic` 12.8.0 or later and supports Claude Haiku, Sonnet, and Opus model families. + If you're using Azure Foundry, also add: ```powershell @@ -39,9 +41,12 @@ Set up the required environment variables for Anthropic authentication: ```powershell # Required for Anthropic API access $env:ANTHROPIC_API_KEY="your-anthropic-api-key" -$env:ANTHROPIC_DEPLOYMENT_NAME="claude-haiku-4-5" # or your preferred model +$env:ANTHROPIC_DEPLOYMENT_NAME="claude-sonnet-4-5" # or your preferred model (e.g. claude-opus-4-5, claude-haiku-4-5) ``` +> [!NOTE] +> `claude-haiku-3` is deprecated. Prefer `claude-haiku-4-5`, `claude-sonnet-4-5`, `claude-sonnet-4-6`, or `claude-opus-4-5` for new workloads. + You can get an API key from the [Anthropic Console](https://console.anthropic.com/). ### For Azure Foundry with API Key @@ -49,14 +54,14 @@ You can get an API key from the [Anthropic Console](https://console.anthropic.co ```powershell $env:ANTHROPIC_RESOURCE="your-foundry-resource-name" # Subdomain before .services.ai.azure.com $env:ANTHROPIC_API_KEY="your-anthropic-api-key" -$env:ANTHROPIC_DEPLOYMENT_NAME="claude-haiku-4-5" +$env:ANTHROPIC_DEPLOYMENT_NAME="claude-sonnet-4-5" ``` ### For Azure Foundry with Azure CLI ```powershell $env:ANTHROPIC_RESOURCE="your-foundry-resource-name" # Subdomain before .services.ai.azure.com -$env:ANTHROPIC_DEPLOYMENT_NAME="claude-haiku-4-5" +$env:ANTHROPIC_DEPLOYMENT_NAME="claude-sonnet-4-5" ``` > [!NOTE] @@ -70,7 +75,7 @@ The simplest way to create an Anthropic agent using the public API: ```csharp var apiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY"); -var deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_DEPLOYMENT_NAME") ?? "claude-haiku-4-5"; +var deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_DEPLOYMENT_NAME") ?? "claude-sonnet-4-5"; AnthropicClient client = new() { APIKey = apiKey }; @@ -90,7 +95,7 @@ After you've set up Anthropic on Azure Foundry, you can use it with API key auth ```csharp var resource = Environment.GetEnvironmentVariable("ANTHROPIC_RESOURCE"); var apiKey = Environment.GetEnvironmentVariable("ANTHROPIC_API_KEY"); -var deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_DEPLOYMENT_NAME") ?? "claude-haiku-4-5"; +var deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_DEPLOYMENT_NAME") ?? "claude-sonnet-4-5"; AnthropicClient client = new AnthropicFoundryClient( new AnthropicFoundryApiKeyCredentials(apiKey, resource)); @@ -109,7 +114,7 @@ For environments where Azure Credentials are preferred: ```csharp var resource = Environment.GetEnvironmentVariable("ANTHROPIC_RESOURCE"); -var deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_DEPLOYMENT_NAME") ?? "claude-haiku-4-5"; +var deploymentName = Environment.GetEnvironmentVariable("ANTHROPIC_DEPLOYMENT_NAME") ?? "claude-sonnet-4-5"; AnthropicClient client = new AnthropicFoundryClient( new AnthropicAzureTokenCredential(new AzureCliCredential(), resource)); @@ -166,14 +171,14 @@ Set up the required environment variables for Anthropic authentication: ```bash # Required for Anthropic API access ANTHROPIC_API_KEY="your-anthropic-api-key" -ANTHROPIC_CHAT_MODEL_ID="claude-sonnet-4-5-20250929" # or your preferred model +ANTHROPIC_CHAT_MODEL_ID="claude-sonnet-4-6-20260301" # or your preferred model ``` Alternatively, you can use a `.env` file in your project root: ```env ANTHROPIC_API_KEY=your-anthropic-api-key -ANTHROPIC_CHAT_MODEL_ID=claude-sonnet-4-5-20250929 +ANTHROPIC_CHAT_MODEL_ID=claude-sonnet-4-6-20260301 ``` You can get an API key from the [Anthropic Console](https://console.anthropic.com/). @@ -212,7 +217,7 @@ You can provide explicit configuration instead of relying on environment variabl ```python async def explicit_config_example(): agent = AnthropicClient( - model_id="claude-sonnet-4-5-20250929", + model_id="claude-sonnet-4-6-20260301", api_key="your-api-key-here", ).as_agent( name="HelpfulAssistant", diff --git a/skills/dotnet-microsoft-agent-framework/references/providers.md b/skills/dotnet-microsoft-agent-framework/references/providers.md index c8960fa..b8dd10e 100644 --- a/skills/dotnet-microsoft-agent-framework/references/providers.md +++ b/skills/dotnet-microsoft-agent-framework/references/providers.md @@ -34,6 +34,8 @@ If you start from the SDK alone, you usually miss the thread and hosting consequ | Azure OpenAI Responses | `AzureOpenAIClient(...).GetOpenAIResponseClient(...).AsAIAgent(...)` | Service-backed or local, depending on mode | New OpenAI-style apps | Preview packages and mode-specific behavior | | OpenAI Chat Completions | `OpenAIClient(...).GetChatClient(...).AsAIAgent(...)` | Local or custom store | Straightforward request/response chat | No service-backed history by default | | OpenAI Responses | `OpenAIClient(...).GetOpenAIResponseClient(...).AsAIAgent(...)` | Service-backed or local, depending on mode | Long-running or richer response flows | Requires discipline about state mode | +| Anthropic (Claude) | `new AnthropicClient { APIKey = ... }.AsAIAgent(...)` | Local or custom store | Claude models with function tools, streaming, and hosted tools | Preview package; haiku-3 deprecated; use haiku-4-5, sonnet-4-5, sonnet-4-6, or opus-4-5 | +| Anthropic on Azure Foundry | `new AnthropicFoundryClient(...).AsAIAgent(...)` | Local or custom store | Enterprise Claude via Azure Foundry with API key or Azure credentials | Requires `Anthropic.Foundry` package; managed separately from Azure OpenAI | | Azure AI Foundry Agents | `PersistentAgentsClient.CreateAIAgentAsync(...)` | Service-stored only | Managed agent resources and managed tools | Lower portability and provider-specific lifecycle | | OpenAI Assistants | provider-specific assistant client `CreateAIAgentAsync(...)` | Service-stored only | Existing assistant workloads | Not the forward-looking default | | A2A proxy agent | A2A client/proxy agent | Remote service-managed | Calling remote agents | Not a model provider choice | @@ -52,6 +54,8 @@ The official C# docs make these differences explicit: | OpenAI Chat Completions | No | Yes | | OpenAI Responses | Yes | Yes | | OpenAI Assistants | Yes | No | +| Anthropic (direct) | No | Yes | +| Anthropic on Azure Foundry | No | Yes | | Other `IChatClient` implementations | Varies | Varies | This table matters more than it looks. It decides whether your `AgentThread` stores full messages, a remote conversation ID, or custom serialized store state. @@ -67,6 +71,8 @@ This table matters more than it looks. It decides whether your `AgentThread` sto | Azure OpenAI | Azure OpenAI SDK | `Azure.AI.OpenAI` | `https://.openai.azure.com/` | | Azure OpenAI | OpenAI SDK | `OpenAI` | `https://.openai.azure.com/openai/v1/` | | OpenAI | OpenAI SDK | `OpenAI` | default OpenAI endpoint | +| Anthropic (direct) | Anthropic Agent SDK | `Microsoft.Agents.AI.Anthropic` | Anthropic public API | +| Anthropic on Azure Foundry | Anthropic Foundry SDK | `Microsoft.Agents.AI.Anthropic` + `Anthropic.Foundry` | `https://.services.ai.azure.com/` | ## OpenAI SDK Versus Azure OpenAI SDK @@ -148,3 +154,4 @@ Before you commit to a local or custom model path, verify: - `references/official-docs/user-guide/agents/agent-types/openai-chat-completion-agent.md` - `references/official-docs/user-guide/agents/agent-types/openai-responses-agent.md` - `references/official-docs/user-guide/agents/agent-types/azure-ai-foundry-agent.md` +- `references/official-docs/user-guide/agents/agent-types/anthropic-agent.md`