mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
6a39d5a652
* Rename WorkflowOutputEvent.SourceId to ExecutorId for Python consistency - Rename SourceId property to ExecutorId in WorkflowOutputEvent - Add [Obsolete] SourceId property for backward compatibility - Update all test usages to use ExecutorId Resolves part of #2938 * Unify AgentResponse events with WorkflowOutputEvent (#2938) - Change AgentResponseEvent and AgentResponseUpdateEvent to inherit from WorkflowOutputEvent instead of ExecutorEvent - Update AIAgentHostExecutor and HandoffAgentExecutor to use YieldOutputAsync() instead of AddEventAsync() for agent outputs - Add special-casing in InProcessRunnerContext.YieldOutputAsync() to create specific event types for AgentResponse and AgentResponseUpdate, bypassing OutputFilter for backwards compatibility - Update TestRunContext and TestWorkflowContext with same special-casing - Add regression tests in AgentEventsTests * refactor: Seal AgentResponse events
6a39d5a652
ยท
2026-02-18 18:55:26 +00:00
History
Get Started with Microsoft Agent Framework for C# Developers
Samples
- Getting Started with Agents: basic agent creation and tool usage
- Agent Provider Samples: samples showing different agent providers
- Workflow Samples: advanced multi-agent patterns and workflow orchestration
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)
.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
- Getting Started with Agents: basic agent creation and tool usage
- Agent Provider Samples: samples showing different agent providers
- Workflow Samples: advanced multi-agent patterns and workflow orchestration