db620d33df
dotnet-build-and-test / dotnet-build (Debug, windows-latest, net9.0) (push) Blocked by required conditions
CodeQL / Analyze (csharp) (push) Waiting to run
CodeQL / Analyze (python) (push) Waiting to run
dotnet-build-and-test / paths-filter (push) Waiting to run
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net10.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build (Release, ubuntu-latest, net8.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build (Release, windows-latest, net472) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-test (Release, integration, true, ubuntu-latest, net10.0) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-test (Release, integration, true, windows-latest, net472) (push) Blocked by required conditions
dotnet-build-and-test / dotnet-foundry-hosted-it (push) Blocked by required conditions
dotnet-build-and-test / dotnet-test-functions (push) Blocked by required conditions
dotnet-build-and-test / dotnet-build-and-test-check (push) Blocked by required conditions
dotnet-build-and-test / Integration Test Report (push) Blocked by required conditions
Creating an AIAgent with various providers
These samples show how to create an AIAgent instance using various providers, organized by provider. This is not an exhaustive list, but shows a variety of the more popular options.
For other samples that demonstrate how to use AIAgent instances, see the Getting Started With Agents samples.
Prerequisites
See the README.md for each sample for the prerequisites for that sample.
Providers
A2A
| Sample | Description |
|---|---|
| Agent with A2A | Create an AIAgent for an existing A2A agent |
Anthropic
| Sample | Description |
|---|---|
| Agent with Anthropic | Create an AIAgent using Anthropic Claude models |
| Running | Basic Anthropic agent usage |
| Reasoning | Using Anthropic reasoning capabilities |
| Function Tools | Using function tools with Anthropic |
| Skills | Using skills with Anthropic agents |
Azure
| Sample | Description |
|---|---|
| Azure AI Project | Create a Foundry Project agent using the Azure.AI.Project SDK |
| Azure Foundry Model | Use any model deployed to Microsoft Foundry |
| Azure OpenAI ChatCompletion | Create an AIAgent using Azure OpenAI ChatCompletion |
| Azure OpenAI Responses | Create an AIAgent using Azure OpenAI Responses |
Custom
| Sample | Description |
|---|---|
| Custom Implementation | Create an AIAgent with a custom implementation |
Foundry
See foundry/README.md for the full list of Foundry agent samples, covering basics, function tools, structured output, middleware, MCP, code interpreter, and more.
GitHub Copilot
| Sample | Description |
|---|---|
| GitHub Copilot | Create an AIAgent using GitHub Copilot SDK |
Google Gemini
| Sample | Description |
|---|---|
| Google Gemini | Create an AIAgent using Google Gemini |
Ollama
| Sample | Description |
|---|---|
| Ollama | Create an AIAgent using Ollama |
ONNX
| Sample | Description |
|---|---|
| ONNX | Create an AIAgent using ONNX Runtime |
OpenAI
| Sample | Description |
|---|---|
| OpenAI ChatCompletion | Create an AIAgent using OpenAI ChatCompletion |
| OpenAI Responses | Create an AIAgent using OpenAI Responses |
| Running | Basic OpenAI agent usage |
| Reasoning | Using OpenAI reasoning capabilities |
| Create from ChatClient | Create agent from IChatClient |
| Create from Response Client | Create agent from OpenAI Response client |
| Conversation | Multi-turn conversations with OpenAI |
| Code Interpreter | Code interpreter with file downloads |
Running the samples
Navigate to a sample directory and run:
dotnet run
Set the required environment variables as documented in each sample's README. If the variables are not set, you will be prompted for the values when running the samples.