CodeDesignPlus.Net.AI 1.0.0-beta.14143

This is a prerelease version of CodeDesignPlus.Net.AI.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package CodeDesignPlus.Net.AI --version 1.0.0-beta.14143
                    
NuGet\Install-Package CodeDesignPlus.Net.AI -Version 1.0.0-beta.14143
                    
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="CodeDesignPlus.Net.AI" Version="1.0.0-beta.14143" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CodeDesignPlus.Net.AI" Version="1.0.0-beta.14143" />
                    
Directory.Packages.props
<PackageReference Include="CodeDesignPlus.Net.AI" />
                    
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 CodeDesignPlus.Net.AI --version 1.0.0-beta.14143
                    
#r "nuget: CodeDesignPlus.Net.AI, 1.0.0-beta.14143"
                    
#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 CodeDesignPlus.Net.AI@1.0.0-beta.14143
                    
#: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=CodeDesignPlus.Net.AI&version=1.0.0-beta.14143&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeDesignPlus.Net.AI&version=1.0.0-beta.14143&prerelease
                    
Install as a Cake Tool

CodeDesignPlus.Net.AI

NuGet

Overview

CodeDesignPlus.Net.AI provides a unified interface for integrating AI/LLM providers (Claude, OpenAI, Azure OpenAI) into .NET microservices. It supports configurable agents with system prompts, model selection, and provider routing via appsettings.json.

Features

  • Multi-Provider Support: Claude (Anthropic), OpenAI, and Azure OpenAI out of the box
  • Agent Configuration: Define named agents with system prompts, temperature, max tokens, and provider selection
  • Provider Abstraction: IAIProvider interface allows custom provider implementations
  • Options Pattern: Standard .NET configuration via appsettings.json with validation
  • Dependency Injection: services.AddAI(configuration) registers all services

Installation

dotnet add package CodeDesignPlus.Net.AI

Configuration

{
  "AI": {
    "DefaultProvider": "Claude",
    "Providers": {
      "Claude": {
        "ApiKey": "sk-ant-...",
        "Model": "claude-sonnet-4-5-20250514"
      },
      "OpenAI": {
        "ApiKey": "sk-...",
        "Model": "gpt-4o"
      },
      "AzureOpenAI": {
        "ApiKey": "...",
        "Model": "gpt-4o",
        "Endpoint": "https://your-resource.openai.azure.com/"
      }
    },
    "Agents": {
      "EmailDesigner": {
        "Provider": "Claude",
        "SystemPrompt": "You are an expert HTML email template designer...",
        "MaxTokens": 4096,
        "Temperature": 0.7
      }
    }
  }
}

Usage

Registration

// In Startup.cs or Program.cs
services.AddAI(configuration);

Consuming the Service

public class MyCommandHandler(IAIService ai) : IRequestHandler<MyCommand>
{
    public async Task Handle(MyCommand request, CancellationToken cancellationToken)
    {
        var response = await ai.ChatAsync("EmailDesigner", "Create a welcome email template", cancellationToken);

        if (response.Success)
        {
            // Use response.Content (the AI-generated text/HTML)
        }
    }
}

Multi-turn Conversations

var messages = new List<ChatMessage>
{
    new(ChatRole.User, "Create a purchase receipt email"),
    new(ChatRole.Assistant, "<html>...</html>"),
    new(ChatRole.User, "Change the header color to blue"),
};

var response = await ai.ChatAsync("EmailDesigner", messages, cancellationToken);

Architecture

IAIService (main entry point)
    ↓
AIService (orchestrator - resolves agent config + provider)
    ├── ClaudeProvider (Anthropic SDK)
    ├── OpenAIProvider (OpenAI SDK)
    └── AzureOpenAIProvider (Azure.AI.OpenAI SDK)

Documentation

For more information, visit https://doc.codedesignplus.com

License

This project is licensed under the GNU Lesser General Public License v3.0. See LICENSE.md for details.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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.

Version Downloads Last Updated
1.0.0-beta.14164 68 11/26/2026
1.0.0-beta.14161 89 11/26/2026
1.0.0-beta.14158 66 11/26/2026
1.0.0-beta.14150 77 11/26/2026
1.0.0-beta.14143 66 11/26/2026
1.0.0-beta.14138 69 11/26/2026
1.0.0-beta.14123 63 11/26/2026
1.0.0-beta.14114 76 11/26/2026
1.0.0-beta.14108 61 11/26/2026
1.0.0-beta.14100 61 11/26/2026
1.0.0-beta.14088 73 11/25/2026
1.0.0-beta.14085 67 11/25/2026
1.0.0-beta.14066 68 11/25/2026
1.0.0-beta.14055 68 11/24/2026
1.0.0-beta.14051 62 11/24/2026
1.0.0-beta.14047 61 11/24/2026
1.0.0-beta.14037 66 11/24/2026
1.0.0-beta.14032 69 11/24/2026
1.0.0-beta.14025 88 11/19/2026
1.0.0-beta.14017 71 11/11/2026
Loading failed