Minor cleanups

This commit is contained in:
Shyju Krishnankutty
2026-01-15 11:43:28 -08:00
Unverified
parent ff230c86ce
commit 6fbb4dcb87
8 changed files with 21 additions and 15 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
<packageSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="LocalNugetSource" value="D:\LocalNugetSource" />
<add key="LocalNugetSource" value="C:\LocalNugetSource" />
</packageSources>
<packageSourceMapping>
<packageSource key="nuget.org">
@@ -1,14 +1,14 @@
# Default endpoint address for local testing
@authority=http://localhost:7071
### Prompt the agent
### Start the workflow
POST {{authority}}/api/workflows/HandleSurveyResponse/run
Content-Type: text/plain
Rating: 10. Why was I charged $99 when my plan should be $49? I need a refund for the overcharge
### Start the workflow with another bug report input.
POST {{authority}}/api/workflows/HandleSurveyResponse/run
Content-Type: text/plain
Rating: 10. Why was I charged $99 when my plan should be $49? I need a refund for the overcharge
Rating: 3. The app throws an InvalidOperationException when starting up.
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0</TargetFrameworks>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
@@ -14,6 +14,10 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<None Include="local.settings.json" />
</ItemGroup>
<!-- Azure Functions packages -->
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" />
@@ -19,7 +19,7 @@ internal sealed class ConcurrentStartExecutor() : Executor<string, string>("Conc
}
}
internal sealed class ConcurrentAggregationExecutor() : Executor<string[], string>("ConcurrentAggregationExecutor")
internal sealed class ResultAggregationExecutor() : Executor<string[], string>("ResultAggregationExecutor")
{
/// <summary>
/// Handles incoming messages from the agents and aggregates their responses.
@@ -28,24 +28,22 @@ AIAgent physicist = client.GetChatClient(deploymentName).CreateAIAgent("You are
AIAgent chemist = client.GetChatClient(deploymentName).CreateAIAgent("You are an expert in chemistry. You answer questions from a chemistry perspective.", "Chemist");
var startExecutor = new ConcurrentStartExecutor();
var aggregationExecutor = new ConcurrentAggregationExecutor();
var aggregationExecutor = new ResultAggregationExecutor();
// Build the workflow by adding executors and connecting them
var workflow = new WorkflowBuilder(startExecutor)
.WithName("FanOutWorkflow")
.AddFanOutEdge(startExecutor, [physicist, chemist])
.AddFanInEdge([physicist, chemist], aggregationExecutor)
.WithOutputFrom(aggregationExecutor)
.Build();
// Configure the function app to host AI agents and workflows in a unified way.
// This will automatically generate HTTP API endpoints for agents and workflows.
var functionBuilder = FunctionsApplication.CreateBuilder(args);
functionBuilder
FunctionsApplication.CreateBuilder(args)
.ConfigureFunctionsWebApplication()
.ConfigureDurableOptions(options =>
{
// Configure workflows
options.Workflows.AddWorkflow(workflow);
});
functionBuilder.Build().Run();
}).Build().Run();
@@ -1,7 +1,7 @@
# Default endpoint address for local testing
@authority=http://localhost:7071
### Prompt the agent
### Start the workflow
POST {{authority}}/api/workflows/FanOutWorkflow/run
Content-Type: text/plain
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net10.0</TargetFrameworks>
<AzureFunctionsVersion>v4</AzureFunctionsVersion>
@@ -14,6 +14,10 @@
<FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>
<ItemGroup>
<None Include="local.settings.json" />
</ItemGroup>
<!-- Azure Functions packages -->
<ItemGroup>
<PackageReference Include="Microsoft.Azure.Functions.Worker" />
@@ -15,7 +15,7 @@ using SingleAgent;
// Create the executors with different input/output types
OrderIdParserExecutor orderIdParser = new(); // string → int
OrderLookupExecutor orderLookup = new(); // int → OrderDetails
OrderLookupExecutor orderLookup = new(); // int → OrderDetails POCO
OrderSummaryExecutor orderSummary = new(); // OrderDetails → string
// Build the workflow: Parse → Lookup → Summarize