TypesafeSdk 1.0.2
See the version list below for details.
dotnet add package TypesafeSdk --version 1.0.2
NuGet\Install-Package TypesafeSdk -Version 1.0.2
<PackageReference Include="TypesafeSdk" Version="1.0.2" />
<PackageVersion Include="TypesafeSdk" Version="1.0.2" />
<PackageReference Include="TypesafeSdk" />
paket add TypesafeSdk --version 1.0.2
#r "nuget: TypesafeSdk, 1.0.2"
#:package TypesafeSdk@1.0.2
#addin nuget:?package=TypesafeSdk&version=1.0.2
#tool nuget:?package=TypesafeSdk&version=1.0.2
Dotnet Typesafe SDK
.NET client for the TypeSafe API.
Please report all issues and feature requests on the GitHub issue tracker.
Install
dotnet add package TypesafeSdk
Quickstart
Set TYPESAFE_API_KEY in your environment, then:
using TypesafeSdk;
using TypesafeSdk.Models;
using var client = new TypeSafeClient();
var response = await client.SystemOneAsync(
state: "I was charged twice. Please help ASAP.",
questions: new Dictionary<string, Question>
{
["billing"] = new NoulQuestion { Instructions = "Is this about billing?" },
["tone"] = new ChoiceQuestion
{
Instructions = "What is the tone?",
Criteria = new Dictionary<string, object?> { ["calm"] = null, ["angry"] = null },
},
["urgency"] = new ScoreQuestion
{
Instructions = "How urgent is this?",
Criteria = ["low", "medium", "high"],
},
});
Console.WriteLine(response.Nouls["billing"].Noul);
Console.WriteLine(response.Choices["tone"].Choice);
Console.WriteLine(response.Scores["urgency"].Score);
Listing models
ListModelsAsync calls GET /v1/models and returns the names your account can send in the model field, each with a description and release date. It currently lists aliases; versioned IDs such as jev-1.13.0 are accepted whether or not they appear in the list.
var models = await client.ListModelsAsync();
foreach (var model in models.Models)
{
Console.WriteLine($"{model.Name} ({model.ReleaseDate}): {model.Description}");
}
Configuration
Pass TypeSafeClientOptions to override defaults: ApiKey, BaseUrl, Model, Retry, Timeout, HttpClient, LogLevel and Logger. Unset values fall back to TYPESAFE_API_KEY, TYPESAFE_BASE_URL, TYPESAFE_DEFAULT_MODEL and TYPESAFE_LOG_LEVEL.
License
MIT
| Product | Versions 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. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.