Nabs.Launchpad.Core.Ai.Clients 10.0.232

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Nabs.Launchpad.Core.Ai.Clients --version 10.0.232
                    
NuGet\Install-Package Nabs.Launchpad.Core.Ai.Clients -Version 10.0.232
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nabs.Launchpad.Core.Ai.Clients" Version="10.0.232" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Nabs.Launchpad.Core.Ai.Clients" Version="10.0.232" />
                    
Directory.Packages.props
<PackageReference Include="Nabs.Launchpad.Core.Ai.Clients" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Nabs.Launchpad.Core.Ai.Clients --version 10.0.232
                    
#r "nuget: Nabs.Launchpad.Core.Ai.Clients, 10.0.232"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Nabs.Launchpad.Core.Ai.Clients@10.0.232
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Nabs.Launchpad.Core.Ai.Clients&version=10.0.232
                    
Install as a Cake Addin
#tool nuget:?package=Nabs.Launchpad.Core.Ai.Clients&version=10.0.232
                    
Install as a Cake Tool

NuGet

Nabs.Launchpad.Core.Ai.Clients

Nabs.Launchpad.Core.Ai.Clients gives you production-ready IAIClientFactory implementations and DI extensions so you can switch between Azure Foundry, local OpenAI-compatible endpoints, and deterministic simulators with minimal code changes.

Installation

dotnet add package Nabs.Launchpad.Core.Ai.Clients

The Problem

// 1) AI client wiring duplicated across apps
var openAiClient = new OpenAIClient(new ApiKeyCredential(key), new OpenAIClientOptions { Endpoint = new Uri(url) });
var chat = openAiClient.GetChatClient(model).AsIChatClient();

// 2) Environment switching is brittle and scattered
if (env.IsDevelopment())
{
	// local endpoint
}
else
{
	// azure endpoint
}

// 3) Tests require live services or heavy mocks
// No deterministic queue/keyed response simulator for chat streaming behavior.

// 4) Missing response setup causes runtime failures deep in execution flow
// InvalidOperationException thrown too late, hard to diagnose.

Features

  • Factory-based AI client resolution through IAIClientFactory.
  • Azure Foundry integration with AzureFoundryProjectClientFactory and DefaultAzureCredential.
  • Local OpenAI-compatible integration with LocalOpenAIClientFactory.
  • Deterministic simulation with AIChatClientSimulator for streaming and keyed responses.
  • DI convenience extensions via AddAzureFoundryClientFactory, AddLocalOpenAIClientFactory, and AddSimulatorClientFactory.

Usage

using Microsoft.Extensions.DependencyInjection;
using Nabs.Launchpad.Core.Ai;
using Nabs.Launchpad.Core.Ai.Clients;

var services = new ServiceCollection();

services.AddAzureFoundryClientFactory("https://my-project.services.ai.azure.com/api/projects/my-project");

using var provider = services.BuildServiceProvider();
var factory = provider.GetRequiredService<IAIClientFactory>();
var chatClient = factory.GetChatClient("gpt-4.1-mini");
using Microsoft.Extensions.DependencyInjection;
using Nabs.Launchpad.Core.Ai;
using Nabs.Launchpad.Core.Ai.Clients;

var services = new ServiceCollection();

services.AddSimulatorClientFactory(sim =>
{
	sim.AddTextResponse("First simulated response")
	   .AddKeyedTextResponse("status", "All systems green");
});

using var provider = services.BuildServiceProvider();
var factory = provider.GetRequiredService<IAIClientFactory>();
var chatClient = factory.GetChatClient("ignored-by-simulator");

Configuration

  • Azure Foundry: pass your AI project URL to AddAzureFoundryClientFactory(string aiProjectUrl).
  • Local endpoint: pass your local OpenAI-compatible URL to AddLocalOpenAIClientFactory(string aiProjectUrl).
  • Simulator: configure queued or keyed responses in AddSimulatorClientFactory(Action<AIChatClientSimulator>).

Project Structure

  • ProjectExtensions - dependency injection extension methods for registering factory implementations.
  • AzureFoundryProjectClientFactory - creates IChatClient instances from Azure AI Project OpenAI clients.
  • LocalOpenAIClientFactory - creates local OpenAI-compatible IChatClient instances.
  • SimulatorClientFactory - returns an AIChatClientSimulator implementation of IChatClient.
  • AIChatClientSimulator - deterministic test client with queued and keyed streaming responses.

License

Copyright (c) Net Advantage Business Solutions.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.