Files
agent-framework/dotnet/samples/02-agents/AgentProviders
T
Giles Odigwe af772997af .NET: [BREAKING] Migrate .NET GitHub Copilot SDK to v1.0.0 (#6381)
* Migrate .NET GitHub Copilot SDK from 1.0.0-beta.2 to 1.0.0

- Update namespace from GitHub.Copilot.SDK to GitHub.Copilot
- Replace PermissionRequestResult/PermissionRequestResultKind with PermissionDecision
- Remove ConnectionState check (StartAsync is now idempotent)
- Rename ConfigDir to ConfigDirectory
- Use SessionConfig.Clone() for CopySessionConfig
- Update Tools type from List<AIFunction> to List<AIFunctionDeclaration>
- Rename UserMessageAttachmentFile to AttachmentFile
- Update usage data types (CacheWriteTokens: long, Duration: TimeSpan)
- Add GHCP001 NoWarn for experimental SDK APIs (matches framework convention)
- Specify type argument on CopilotSession.On<SessionEvent>()

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Fix formatting: remove unused using directive

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Skip AzureFunctions SamplesValidation tests pending func tools fix

Azure Functions Core Tools v4 can no longer auto-detect the worker
runtime in CI (local.settings.json is gitignored). All 7 active
SamplesValidation tests fail with 'Worker runtime cannot be None'.

Tracked by: https://github.com/microsoft/agent-framework/issues/6402

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* Skip additional failing integration tests in CI

WorkflowSamplesValidation (5 tests): same func tools issue as #6402.
WorkflowConsoleAppSamplesValidation (4 tests): KeyNotFoundException
during workflow execution, tracked by #6404.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
af772997af · 2026-06-08 22:34:05 +00:00
History
..

Creating an AIAgent instance for various providers

These samples show how to create an AIAgent instance using various providers. 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.

Samples

Sample Description
Creating an AIAgent with A2A This sample demonstrates how to create AIAgent for an existing A2A agent.
Creating an AIAgent with Anthropic This sample demonstrates how to create an AIAgent using Anthropic Claude models as the underlying inference service
Creating an AIAgent with Foundry Agents using Azure.AI.Agents.Persistent This sample demonstrates how to create a Foundry Persistent agent and expose it as an AIAgent using the Azure.AI.Agents.Persistent SDK
Creating an AIAgent with Foundry Agents using Azure.AI.Project This sample demonstrates how to create an Foundry Project agent and expose it as an AIAgent using the Azure.AI.Project SDK
Creating an AIAgent with Foundry Model This sample demonstrates how to use any model deployed to Microsoft Foundry to create an AIAgent
Creating an AIAgent with Azure OpenAI ChatCompletion This sample demonstrates how to create an AIAgent using Azure OpenAI ChatCompletion as the underlying inference service
Creating an AIAgent with Azure OpenAI Responses This sample demonstrates how to create an AIAgent using Azure OpenAI Responses as the underlying inference service
Creating an AIAgent with a custom implementation This sample demonstrates how to create an AIAgent with a custom implementation
Creating an AIAgent with GitHub Copilot This sample demonstrates how to create an AIAgent using GitHub Copilot SDK as the underlying inference service
Creating an AIAgent with Ollama This sample demonstrates how to create an AIAgent using Ollama as the underlying inference service
Creating an AIAgent with ONNX This sample demonstrates how to create an AIAgent using ONNX as the underlying inference service
Creating an AIAgent with OpenAI ChatCompletion This sample demonstrates how to create an AIAgent using OpenAI ChatCompletion as the underlying inference service
Creating an AIAgent with OpenAI Responses This sample demonstrates how to create an AIAgent using OpenAI Responses as the underlying inference service

Running the samples from the console

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

cd AIAgent_With_AzureOpenAIChatCompletion

Set the required environment variables as documented in the sample readme. 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.