Skip to content

TypeSafe.AI.Sdk

API reference

Client, questions, responses, options, images, and errors.

Type Summary
Answer Base type for a typed System One answer.
ApiConnectionException The request or response-body delivery failed (DNS, TLS, connection closed, etc.). Mirrors JS APIConnectionError.
ApiException An unsuccessful HTTP response from the API. Mirrors JS APIError.
ApiTimeoutException The full response did not arrive within the timeout. A kind of ApiConnectionException. Mirrors JS APITimeoutError.
ApiUserAbortException The caller cancelled the request through a CancellationToken. Mirrors JS APIUserAbortError.
AuthenticationException HTTP 401: authentication failed.
BadRequestException HTTP 400: the request is invalid.
BoxAnswer The location of what a box question describes in the image.
BoxCoordinates A box’s edges as fractions of the image’s height (top, bottom) and width (left, right).
BoxQuestion A question that locates what its instructions describe in the request’s image.
ChoiceAnswer A selected label and its probabilities.
ChoiceQuestion A question that selects between named alternatives.
ConsoleTypeSafeLogger Default console logger with the [typesafe-sdk] prefix.
Env Environment variable names used when constructing TypeSafeClient. Explicit constructor options take precedence over these values. Empty or whitespace-only values are ignored.
Image A PNG or JPEG image for CancellationToken). Image support is experimental: send the TypeSafe-Danger-Zone-Images: true header to opt in.
InternalServerException HTTP 5xx: the server failed to handle the request.
LogLevels Supported log level names, from most to least verbose.
MicrosoftLoggingTypeSafeLogger Adapts ILogger to ITypeSafeLogger.
ModelCard Metadata for an available model.
ModelsResource Access to the Models API resource.
NotFoundException HTTP 404: the resource was not found.
NoulAnswer A yes/no answer. The value is the probability of yes, from 0 to 1.
NoulCriteria Optional descriptions of the yes and no outcomes for a Noul question.
NoulQuestion A yes/no question with optional descriptions for either outcome.
PermissionDeniedException HTTP 403: access is denied.
Question A TypeSafe question identified by its type field.
RateLimitException HTTP 429: the rate limit was exceeded.
RequestOptions Per-call options that override client settings.
RetryCalculator Retry delay calculation and cancellable waits. Mirrors JS retry.ts.
RetryPolicy Retry configuration. Partial overrides inherit unset fields from the client or SDK defaults. Defaults match the JavaScript SDK.
RuntimeInfo Runtime description written to the X-TypeSafe-Runtime header.
ScoreAnswer An expected score with its rubric and probabilities.
ScoreQuestion A question that assigns a score using an ordered rubric.
SdkVersion SDK version reported in User-Agent and X-TypeSafe-SDK.
SystemOneRequest State and named questions for CancellationToken).
SystemOneResult Answers keyed by question name, with model and usage metadata.
TextWithAssets Text with the images interpolated into it, sent together with the text.
TypeSafeClient Client for the TypeSafe AI API. Community .NET port of @typesafe-ai/sdk.
TypeSafeClientOptions Client options. Explicit values take precedence over environment variables, then SDK defaults.
TypeSafeException Base class for SDK errors. Mirrors JS TypeSafeError.
TypeSafeResponse<T> Parsed data with its HTTP response and request ID. Mirrors JS WithResponse.
UnprocessableEntityException HTTP 422: request validation failed.
Usage Token usage for a request.
Type Summary
ITypeSafeClient Client for the TypeSafe AI API.
ITypeSafeLogger Log methods accepting a message and structured values. Compatible with console in spirit.
Type Summary
TypeSafeLogLevel Log verbosity; Off disables logging. Mirrors JS LogLevel.

MIT · Copyright (c) Dario Kondratiuk. · not affiliated with TypeSafe beyond being a client of the public API