Files
agent-framework/dotnet
T
Stephen Toub 0fef277c70 Remove System.Linq.Async dependency from src assemblies (#1069)
We shouldn't be shipping any more dependencies on this package, as it's becoming legacy, replaced by System.Linq.AsyncEnumerable.

We'll eventually want to replace it with System.Linq.AsyncEnumerable in all tests/samples, too, but that's hard to do until SK updates to use S.L.AsyncEnumerable once its 10.0.0 version is released. I did remove the package reference from tests/samples where it's not needed.
0fef277c70 ยท 2025-10-01 17:17:21 +00:00
History
..
2025-10-01 15:00:48 +00:00
2025-09-30 18:58:00 +00:00
2025-10-01 16:43:17 +00:00

Get Started with Microsoft Agent Framework for C# Developers

Samples

Quickstart

Basic Agent - .NET

using System;
using Azure.AI.OpenAI;
using Azure.Identity;
using Microsoft.Agents.AI;

var endpoint = Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!;
var deploymentName = Environment.GetEnvironmentVariable("AZURE_OPENAI_DEPLOYMENT_NAME")!;

var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
    .GetOpenAIResponseClient(deploymentName)
    .CreateAIAgent(name: "HaikuBot", instructions: "You are an upbeat assistant that writes beautifully.");

Console.WriteLine(await agent.RunAsync("Write a haiku about Microsoft Agent Framework."));

Examples & Samples

Agent Framework Documentation