MICROSOFT AGENT FRAMEWORK · 0.16.0-rc.1
Demo020 — Connection Profiles
Diagnose chat, embeddings and HTTP availability separately.
Objectives
- Select and diagnose independent chat and embedding connections, from console or HTTP.
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.
| Project | Role |
|---|---|
| demos/Demo020_ConnectionProfiles/Console/Demo020.Console.csproj | Console |
| demos/Demo020_ConnectionProfiles/Backend/Demo020.Backend.csproj | Backend |
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-builddotnet 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:5187Invoke-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();
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.
