Totoy 0.0.6

dotnet add package Totoy --version 0.0.6                
NuGet\Install-Package Totoy -Version 0.0.6                
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="Totoy" Version="0.0.6" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Totoy --version 0.0.6                
#r "nuget: Totoy, 0.0.6"                
#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.
// Install Totoy as a Cake Addin
#addin nuget:?package=Totoy&version=0.0.6

// Install Totoy as a Cake Tool
#tool nuget:?package=Totoy&version=0.0.6                

Totoy .NET API library

The official C# library for the Totoy API.

Error Handling

Handling errors in this SDK should largely match your expectations. All operations return a response object or thow an exception. If Error objects are specified in your OpenAPI Spec, the SDK will raise the appropriate type.

Error Object Status Code Content Type
Totoy.Models.Errors.Problem 4XX,5XX application/problem+json
Totoy.Models.Errors.SDKException 4xx-5xx /

Example

using Totoy;
using Totoy.Models.Components;
using System.Collections.Generic;
using System;
using Totoy.Models.Errors;

var sdk = new TotoySDK(apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>");

ExplanationRequest req = new ExplanationRequest() {
    OutputLanguage = Totoy.Models.Components.OutputLanguage.En,
    SourceId = "<value>",
    Messages = new List<Message>() {
        new Message() {
            Role = Totoy.Models.Components.Role.User,
            Content = "<value>",
            References = new List<Reference>() {
                new Reference() {
                    Text = "[R1]",
                    SourceId = "{\"source-id-example\":{\"value\":\"src_dmZ7imKLaPcQnv5ckvGlOEAA7\"}}",
                    PageNumber = 5,
                    Backlink = "https://www.example.com/text.pdf",
                },
            },
        },
    },
};

try
{
    var res = await sdk.Explanation.CreateAsync(req);
    // handle response
}
catch (Exception ex)
{
    if (ex is Problem)
    {
        // handle exception
    }
    else if (ex is Totoy.Models.Errors.SDKException)
    {
        // handle exception
    }
}

Server Selection

Select Server by Index

You can override the default server globally by passing a server index to the serverIndex: number optional parameter when initializing the SDK client instance. The selected server will then be used as the default on the operations that use it. This table lists the indexes associated with the available servers:

# Server Variables
0 https://api.totoy.ai/v1 None
1 https://dev.api.totoy.ai/v1 None
2 https://0b3f7c7d-220a-4c12-9689-fa29bd0edd80.mock.pstmn.io None

Override Server URL Per-Client

The default server can also be overridden globally by passing a URL to the serverUrl: str optional parameter when initializing the SDK client instance. For example:

Authentication

Per-Client Security Schemes

This SDK supports the following security scheme globally:

Name Type Scheme
ApiKeyAuth http HTTP Bearer

To authenticate with the API the ApiKeyAuth parameter must be set when initializing the SDK client instance. For example:

using Totoy;
using Totoy.Models.Components;
using System.Collections.Generic;

var sdk = new TotoySDK(apiKeyAuth: "<YOUR_BEARER_TOKEN_HERE>");

ExplanationRequest req = new ExplanationRequest() {
    OutputLanguage = Totoy.Models.Components.OutputLanguage.En,
    SourceId = "<value>",
    Messages = new List<Message>() {
        new Message() {
            Role = Totoy.Models.Components.Role.User,
            Content = "<value>",
            References = new List<Reference>() {
                new Reference() {
                    Text = "[R1]",
                    SourceId = "{\"source-id-example\":{\"value\":\"src_dmZ7imKLaPcQnv5ckvGlOEAA7\"}}",
                    PageNumber = 5,
                    Backlink = "https://www.example.com/text.pdf",
                },
            },
        },
    },
};

var res = await sdk.Explanation.CreateAsync(req);

// handle response
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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.6 0 7/11/2024
0.0.1 0 7/8/2024
0.0.0-alpha.0.3 0 7/8/2024