CodeDesignPlus.Net.AI 1.0.0-beta.13574

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.13574
                    
NuGet\Install-Package CodeDesignPlus.Net.AI -Version 1.0.0-beta.13574
                    
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.13574" />
                    
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.13574" />
                    
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.13574
                    
#r "nuget: CodeDesignPlus.Net.AI, 1.0.0-beta.13574"
                    
#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.13574
                    
#: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.13574&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=CodeDesignPlus.Net.AI&version=1.0.0-beta.13574&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.13584 0 10/3/2026
1.0.0-beta.13582 38 10/2/2026
1.0.0-beta.13576 28 10/2/2026
1.0.0-beta.13574 35 10/2/2026
1.0.0-beta.13571 43 10/1/2026
1.0.0-beta.13563 37 10/1/2026
1.0.0-beta.13561 39 10/1/2026
1.0.0-beta.13557 26 10/1/2026
1.0.0-beta.13553 43 9/30/2026
1.0.0-beta.13545 33 9/30/2026
1.0.0-beta.13539 43 9/30/2026
1.0.0-beta.13532 43 9/29/2026
1.0.0-beta.13523 42 9/29/2026
1.0.0-beta.13515 49 9/28/2026
1.0.0-beta.13505 64 9/28/2026
1.0.0-beta.13499 56 9/28/2026
1.0.0-beta.13494 42 9/27/2026
1.0.0-beta.13488 54 9/27/2026
1.0.0-beta.13481 60 9/26/2026
1.0.0-beta.13476 57 9/26/2026
Loading failed