mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
refactor: [BREAKING] Remove generic Workflow<T> (#1551)
Remove input type checking in favour of explicit `.DescribeProtocolAsync()` flow. Also removes `.AsAgentAsync()` as the validation happens at workflow run time. This makes it easier to use Workflows with DI without resorting to async-over-sync.
This commit is contained in:
committed by
GitHub
Unverified
parent
7c1e3db846
commit
0ef4e739d5
@@ -25,11 +25,11 @@ public static class Program
|
||||
JudgeExecutor judgeExecutor = new("Judge", 42);
|
||||
|
||||
// Build the workflow by connecting executors in a loop
|
||||
var workflow = await new WorkflowBuilder(guessNumberExecutor)
|
||||
var workflow = new WorkflowBuilder(guessNumberExecutor)
|
||||
.AddEdge(guessNumberExecutor, judgeExecutor)
|
||||
.AddEdge(judgeExecutor, guessNumberExecutor)
|
||||
.WithOutputFrom(judgeExecutor)
|
||||
.BuildAsync<NumberSignal>();
|
||||
.Build();
|
||||
|
||||
// Execute the workflow
|
||||
await using StreamingRun run = await InProcessExecution.StreamAsync(workflow, NumberSignal.Init);
|
||||
|
||||
Reference in New Issue
Block a user