Files
agent-framework/dotnet
T
Peter Ibekwe 23921c0f6e .NET: Pass through external input request and handle response conversion for workflow as agent scenario (#4361)
* Handle external input request and response conversion for workflow as agent scenario

* Remove unnecessary test comment

* Fix PR comments

* Updated to fix edge cases, and add more tests.

* Update pending requests to use typed properties instead of relying on StateBag. replying to PR feedback.

* Fixed external response de-dup and updated possible brittle test.

* Address PR comments on sending turn token for normal messages and handle contentId collision by source agent

* Remove unnecessary serialization element and address pr comment on intercepted outgoing requests

* Updated MEAI changes for UserInput request and response abstractions.
23921c0f6e · 2026-03-25 19:23:44 +00:00
History
..
2026-03-11 19:05:27 +00:00

Get Started with Microsoft Agent Framework for C# Developers

Quickstart

Basic Agent - .NET

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

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

var agent = new AzureOpenAIClient(new Uri(endpoint), new AzureCliCredential())
    .GetResponsesClient(deploymentName)
    .AsAIAgent(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