mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
27 lines
933 B
C#
27 lines
933 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using Microsoft.Agents.AI.Hosting.AzureFunctions;
|
|
using Microsoft.Agents.AI.Workflows;
|
|
using Microsoft.Azure.Functions.Worker.Builder;
|
|
using Microsoft.Extensions.Hosting;
|
|
using SingleAgent;
|
|
|
|
OrderIdParser orderParser = new();
|
|
OrderEnrich orderEnrich = new();
|
|
PaymentProcesser paymentProcessor = new();
|
|
NotifyFraud notifyFraud = new();
|
|
|
|
WorkflowBuilder builder = new(orderParser);
|
|
builder
|
|
.AddEdge(orderParser, orderEnrich)
|
|
.AddEdge(orderEnrich, notifyFraud, condition: OrderRouteConditions.WhenBlocked())
|
|
.AddEdge(orderEnrich, paymentProcessor, condition: OrderRouteConditions.WhenNotBlocked());
|
|
|
|
var workflow = builder.WithName("AuditOrder").Build();
|
|
|
|
FunctionsApplication.CreateBuilder(args)
|
|
.ConfigureFunctionsWebApplication()
|
|
.ConfigureDurableOptions(options => options.Workflows.AddWorkflow(workflow, enableMcpToolTrigger: true))
|
|
.Build()
|
|
.Run();
|