e-naxosMAF COURSE / COURS
Français

MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1

Demo020 — Connection Profiles

Diagnose chat, embeddings and HTTP availability separately.

Objectives

Prepare the demo

Start at the root of the complete solution already built in Release. Course prerequisites: Demo010. This program uses live chat from the selected profile; no embeddings are required except for Demo020 --embed. Check connectivity and required capabilities before attributing failure to the scenario.

Projects to run
ProjectRole
demos/Demo020_ConnectionProfiles/Console/Demo020.Console.csprojConsole
demos/Demo020_ConnectionProfiles/Backend/Demo020.Backend.csprojBackend

Launch from the root

dotnet run --project demos/Demo020_ConnectionProfiles/Console/Demo020.Console.csproj -c Release --no-build
dotnet run --project demos/Demo020_ConnectionProfiles/Backend/Demo020.Backend.csproj -c Release --no-build
dotnet run --project demos/Demo020_ConnectionProfiles/Console/Demo020.Console.csproj -c Release --no-build -- --embed
dotnet run --project demos/Demo020_ConnectionProfiles/Backend/Demo020.Backend.csproj -c Release --no-build -- --urls=http://127.0.0.1:5187
Invoke-RestMethod http://127.0.0.1:5187/health
Invoke-RestMethod http://127.0.0.1:5187/chat -Method Post -ContentType 'application/json' -Body '{"text":"Hello"}'

Modes and procedure

Run Console for a short greeting. Add -- --embed to obtain a vector and its dimension. For Backend, open a second terminal and choose a free port; the console client does not depend on that backend.

var builder = Host.CreateApplicationBuilder();
builder.Configuration.AddDemoConfiguration(args);
var settings = ConnectionOptions.FromConfiguration(builder.Configuration);
builder.Services.AddDemoConnection(settings);
using var host = builder.Build();

demos/Demo020_ConnectionProfiles/Console/Program.cs · L7–L11 · 9a895c94534c

Source code · Demo020 · Folder

Results and useful failures

GET /health returns ready and configured providers without calling the model. POST /chat with nonblank text calls chat; blank text yields HTTP 400, invalid configuration 503 and service failure 502. Observe explicit failure if Ollama is stopped. --embed requires the independent embedding model.

These observations are expected from inspecting the indicated code revision. No new model call was made to write this page; exact generated wording is not a reference output.

Scope and limits

A chat response establishes neither tool calling nor structured output. Both projects use the same configuration; neither adds conversation storage nor an application streaming interface.

Continue and verify

Prerequisites

Continue reading

Complete demo folder · README

lot007-foundations-1 · 2026-10-24 · 9a895c94534cd5fc6f3da883e37e5f7856e588c1