Skip to content

Rebuild provider-agnostic Microsoft.Extensions.AI gateway sample - #27

Merged
balajibashyam merged 3 commits into
mainfrom
feature/provider-agnostic-chat-gateway-rebuild
Sep 29, 2026
Merged

balajibashyam merged 3 commits into
mainfrom
feature/provider-agnostic-chat-gateway-rebuild

Conversation

@balajibashyam

Copy link
Copy Markdown
Contributor

Summary

Replaces the existing minimal provider-gateway companion with the verified .NET 10
sample for the
Microsoft.Extensions.AI Tutorial: Build a Multi-Provider IChatClient Gateway.

The existing GitHub path is preserved:

dotnet-ai/provider-agnostic-chat-gateway/

What's included

  • Rebuilt sample

    • ASP.NET Core Minimal API
    • Microsoft.Extensions.AI.IChatClient provider boundary
    • allow-listed provider registration
    • Ollama, OpenAI, OpenRouter/OpenAI-compatible, and Azure OpenAI construction paths
    • bounded in-memory conversation state
    • provider-bound conversations
    • non-streaming chat
    • SSE streaming
    • deterministic convert_temperature function tool
    • explicit tool-invocation logging
    • 25 deterministic tests
  • Verification

    • .NET SDK 10.0.401
    • net10.0
    • Release build passed
    • deterministic tests passed: 25/25
    • local Ollama live verification completed with qwen3.8:27b
    • non-streaming chat verified
    • conversation continuity verified
    • SSE streaming verified
    • real tool invocation verified
    • unregistered-provider HTTP rejection verified
  • Root README

    • existing sample row updated
    • run commands updated
    • repository structure updated
  • GitHub Actions

    • existing build-chat-gateway job updated for the new .slnx
    • deterministic tests added to CI
    • no live model or provider credential required

Package baseline

  • Microsoft.Extensions.AI 10.10.0
  • Microsoft.Extensions.AI.OpenAI 10.10.1
  • Azure.AI.OpenAI 2.1.0
  • Azure.Identity 1.21.0
  • OllamaSharp 5.4.30

Deliberately omitted

  • Agent Framework
  • MCP
  • RAG/vector search
  • persistent conversation storage
  • automatic failover/load balancing
  • model ranking
  • multi-agent orchestration
  • arbitrary caller-supplied endpoints
  • write-capable business tools
  • production authentication/deployment

Security boundary

HTTP callers can select only server-registered provider names. Provider endpoints,
models, and credentials remain trusted server configuration.

Independence

This is an independent educational sample and is not an official Microsoft sample
or specification.

@balajibashyam
balajibashyam merged commit f2283c3 into main Sep 29, 2026
28 checks passed
@balajibashyam
balajibashyam deleted the feature/provider-agnostic-chat-gateway-rebuild branch September 29, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant