MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1
Demo010 — Code or agent
Run the deterministic path, then understand the --agent option.
Objectives
- Replay the model-free path.
- Identify projects and dependencies.
- Distinguish expected results from execution evidence.
Before running
From the BaseTechnique root, use the .NET 10.0.402 SDK pinned by global.json and restore NuGet dependencies. Basic C# is enough for the default path; async/await and a working connection profile are needed for --agent. No model service is required for the deterministic path.
| Item | Role | Distribution |
|---|---|---|
| demos/Demo010_CodeOrAgent/Demo010.App.csproj | net10.0 console application | Program.cs entry point |
| shared/Maf.Backlog/Maf.Backlog.csproj | Declared project reference | Keep the shared dependency graph, including DemoConnection |
| shared/Configuration/ai-settings.json | Profile copied to output | Used only after --agent |
| global.json and Directory.Packages.props | SDK and centralized versions | Keep at the distribution root |
The links below target the immutable public revision. Keep shared projects and configuration from the full distribution; the Demo010 folder alone is insufficient.
Model-free path
dotnet build BaseTechnique.slnx -m:1 -c Release
dotnet run --project demos/Demo010_CodeOrAgent/Demo010.App.csproj -c Release --no-buildExpected from reading the code: a discount calculation equal to 90, then a routing message containing Component: Auth and stating that it is not a MAF graph. The decimal separator depends on console culture. Execution ends before loading the profile. These expected observations are not a new runtime test.
Console.WriteLine("Deterministic C#: a fixed discount rule returns " + (100m * 0.9m));
var request = "Login fails for a known account";
var component = request.Contains("Login", StringComparison.OrdinalIgnoreCase) ? "Auth" : "Other";
Console.WriteLine($"Explicit C# orchestration: classify -> route -> display. Component: {component}. This is not a MAF workflow graph.");
if (!args.Contains("--agent")) return;
Source code · Demo010 · Folder
Deterministic C#: a fixed discount rule returns 90,0
Explicit C# orchestration: classify -> route -> display. Component: Auth. This is not a MAF workflow graph.
Optional variant and limits
dotnet run --project demos/Demo010_CodeOrAgent/Demo010.App.csproj -c Release --no-build -- --agentThe shared profile supplies provider and model; no automatic cloud fallback is assumed. The branch displays the provider and requests two English questions about an ambiguous failure. Exact wording varies. The global deadline is two minutes and Ctrl+C requests cancellation. Configuration errors or an unavailable provider remain visible failures.
The --agent branch loads this shared component before creating the client. It combines the configuration file, environment variables and explicit options. The same code is distributed to every demo referencing it.
public static ConnectionOptions Load(string[] args) => ConnectionOptions.FromConfiguration(
new ConfigurationBuilder().AddDemoConfiguration(args).Build());
