Overhaul orchestration library with new approach (#199)

This commit is contained in:
Stephen Toub
2025-07-23 16:29:37 +00:00
committed by GitHub
parent 27f7af2160
commit 5472d6e996
104 changed files with 1212 additions and 5084 deletions
@@ -1,5 +1,6 @@
// Copyright (c) Microsoft. All rights reserved.
using System.Text.Json;
using System.Text.Json.Serialization;
using Microsoft.Agents.Orchestration;
using Microsoft.Extensions.AI;
@@ -44,7 +45,7 @@ public class HandoffOrchestration_With_StructuredInput(ITestOutputHelper output)
OrchestrationMonitor monitor = new();
// Define the orchestration
HandoffOrchestration<GithubIssue, string> orchestration =
HandoffOrchestration orchestration =
new(OrchestrationHandoffs
.StartWith(triageAgent)
.Add(triageAgent, dotnetAgent, pythonAgent))
@@ -80,8 +81,8 @@ public class HandoffOrchestration_With_StructuredInput(ITestOutputHelper output)
// Run the orchestration
Console.WriteLine($"\n# INPUT:\n{input.Id}: {input.Title}\n");
OrchestrationResult<string> result = await orchestration.InvokeAsync(input);
Console.WriteLine($"\n# RESULT: {await result}");
AgentRunResponse result = await orchestration.RunAsync(JsonSerializer.Serialize(input));
Console.WriteLine($"\n# RESULT: {result}");
Console.WriteLine($"\n# LABELS: {string.Join(",", githubPlugin.Labels["12345"])}\n");
}