Merged
Conversation
Introduce universal ChatClientLLMProvider for Microsoft.Extensions.AI IChatClient interop, enabling plug-and-play support for OpenAI, Azure OpenAI, Anthropic, Ollama, Copilot, LM Studio, vLLM, LocalAI, ONNX, and more. Add runnable example and update Program.cs with --chatclient option. Document usage, DI, and limitations in README and new ChatClientLLMProvider.md. Enhance OllamaProvider and ProviderFactory to support maxOutputTokens (fixing truncated responses), update caching, and improve error handling. Bump version to 10.2.5.
- Dynamically discover and dispatch examples with explicit IDs and aliases - Replace hardcoded CLI flag checks with ExampleRegistry.Find - Add --list flag to show all examples in a Spectre.Console table - Implement interactive menu for example selection - Migrate output to Spectre.Console markup and tables - Update banner and error reporting with Spectre.Console - Centralize example execution and error handling - Modernize and clean up main program flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR modernizes the Delibera.ConsoleApp with a Spectre.Console-powered
interactive experience and documents the Microsoft.Extensions.AI integration.
Changes
Console app (Spectre.Console)
Spectre.Console0.57.2 NuGet referenceFigletText+ centeredText+Ruleargs.Contains("--xyz")if-chain with a dynamicExampleRegistrythat discovers every example by reflectionSelectionPromptmenu (grouped by category) shown whenno CLI flag is given and stdin is a TTY
--listto print the example catalog as a Spectre table--di,--msai,--chatclient,--pgvector,--multiprovider,--separate-files,--rag,--operator,--operator-mcp,--autochunking,--cancellation,--resilience,--compression,--quick)Markup.Escapefor modeloutput) and
Ruleseparators; keepWriteLogEntry/WriteErrorEntryonConsolefor thread-safe streamingPanel(rounded border)--chatclientexample (ChatClientLLMProviderExample) demonstratingChatClientLLMProvider+MicrosoftAIExtensions(chat, streaming,embeddings, reverse bridge) using local Ollama, with the OpenAI variant in
comments
Documentation
docs/ChatClientLLMProvider.md— full provider list (OpenAI, AzureOpenAI, Microsoft Foundry, Anthropic, Ollama, GitHub Copilot, LM Studio /
vLLM / LocalAI, ONNX, custom), interop bridge table, OpenAI / Azure /
Ollama / OpenAI-compatible / streaming / embeddings / DI examples,
capabilities & limitations
src/README.md:providers table, interop table, and link to the new doc
--chatclientand--msaito the ConsoleApp examples blockMicrosoft.Extensions.AIto the NuGet dependencies tableRelated Issues
N/A
Type of Change
Checklist
dotnet build)(
ExampleRegistry,ExampleEntry)README.md,docs/ChatClientLLMProvider.md)--listresolves all 14 examples; documentedflags resolve via the alias system)
Additional Notes
Examples/requires zero changes toProgram.csorExampleRegistry— it is auto-discovered. Add curatedmetadata (title/category/aliases) to
ExampleRegistry.Metadataonly whenyou want a friendly id or aliases beyond the auto-derived kebab name.
rendering changed (Spectre markup instead of
Console.WriteLine).WriteLogEntry/WriteErrorEntryintentionally stay onConsole(notAnsiConsole.MarkupLine) because they fire from the executor's backgroundthreads and may contain arbitrary model output with Spectre markup chars.