NTools.DTO 0.2.3

Suggested Alternatives

zTools

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package NTools.DTO --version 0.2.3
                    
NuGet\Install-Package NTools.DTO -Version 0.2.3
                    
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="NTools.DTO" Version="0.2.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NTools.DTO" Version="0.2.3" />
                    
Directory.Packages.props
<PackageReference Include="NTools.DTO" />
                    
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 NTools.DTO --version 0.2.3
                    
#r "nuget: NTools.DTO, 0.2.3"
                    
#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 NTools.DTO@0.2.3
                    
#: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=NTools.DTO&version=0.2.3
                    
Install as a Cake Addin
#tool nuget:?package=NTools.DTO&version=0.2.3
                    
Install as a Cake Tool

NTools.DTO

NuGet License: MIT

Overview

NTools.DTO is a comprehensive Data Transfer Objects (DTOs) library for the NTools utility services ecosystem. It provides strongly-typed models, settings, and request/response objects for various integrations and services.

Features

ChatGPT Integration DTOs

  • ChatGPTRequest - Request model for ChatGPT API calls
  • ChatGPTResponse - Response model with choices and usage statistics
  • ChatGPTMessageRequest - Simple message request wrapper
  • ChatGPTErrorResponse - Error handling models
  • ChatMessage - Individual conversation message

Email Service DTOs (MailerSend)

  • MailerInfo - Email composition and sending
  • MailerRecipientInfo - Recipient information
  • MailerErrorInfo - Email service error handling

Configuration Settings

  • ChatGPTSetting - OpenAI API configuration (ApiUrl, ApiKey, Model)
  • MailerSendSetting - Email service configuration
  • S3Setting - S3-compatible storage configuration
  • NToolSetting - General API settings

Installation

dotnet add package NTools.DTO

Usage

ChatGPT Models

using NTools.DTO.ChatGPT;

// Simple message request
var messageRequest = new ChatGPTMessageRequest
{
    Message = "What is the capital of France?"
};

// Full conversation request
var request = new ChatGPTRequest
{
    Model = "gpt-4o",
    Messages = new List<ChatMessage>
    {
        new ChatMessage { Role = "user", Content = "Hello" },
        new ChatMessage { Role = "assistant", Content = "Hi!" }
    },
    Temperature = 0.7,
    MaxCompletionTokens = 1000
};

// Handle response
var response = new ChatGPTResponse
{
    Id = "chatcmpl-123",
    Choices = new List<Choice>
    {
        new Choice
        {
            Message = new ChatMessage 
            { 
                Role = "assistant", 
                Content = "The capital of France is Paris." 
            }
        }
    }
};

Configuration Models

using NTools.DTO.Settings;

// ChatGPT configuration
var chatGPTSettings = new ChatGPTSetting
{
    ApiUrl = "https://api.openai.com/v1/chat/completions",
    ApiKey = "your-api-key",
    Model = "gpt-4o"
};

// Email service configuration
var mailSettings = new MailerSendSetting
{
    ApiUrl = "https://api.mailersend.com/v1/email",
    ApiToken = "your-token",
    MailSender = "noreply@example.com"
};

// S3 storage configuration
var s3Settings = new S3Setting
{
    AccessKey = "your-access-key",
    SecretKey = "your-secret-key",
    Endpoint = "https://your-bucket.s3.amazonaws.com"
};

Email Models

using NTools.DTO.MailerSend;

var email = new MailerInfo
{
    From = new MailerRecipientInfo 
    { 
        Email = "sender@example.com", 
        Name = "Sender Name" 
    },
    To = new List<MailerRecipientInfo>
    {
        new MailerRecipientInfo 
        { 
            Email = "recipient@example.com", 
            Name = "Recipient Name" 
        }
    },
    Subject = "Test Email",
    Html = "<h1>Hello World</h1>",
    Text = "Hello World"
};

Dependencies

  • Newtonsoft.Json (13.0.3) - JSON serialization/deserialization

Key Features

  • Strongly Typed - All models are type-safe with proper validation
  • JSON Annotations - Proper JsonProperty attributes for API compatibility
  • OpenAI Compatible - ChatGPT DTOs match OpenAI API specifications
  • Flexible Configuration - Settings models support IOptions pattern
  • Error Handling - Dedicated error response models
  • Well Documented - XML documentation on all public members

Compatible With

  • .NET 8.0
  • ASP.NET Core
  • OpenAI API
  • MailerSend API
  • AWS S3 / DigitalOcean Spaces
  • NTools.API - REST API implementation
  • NTools.Domain - Business logic and services
  • NTools.ACL - Anti-Corruption Layer clients

Repository

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Support

For questions, issues, or contributions, please visit the GitHub repository.

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