jev_dart library

Dart client for TypeSafe AI (Jev / System One).

Classes

Answer
Answer for a named question.
BoxAnswer
Experimental image localization answer.
BoxCoordinates
Edges as fractions of the image dimensions.
BoxQuestion
Experimental localization question. Requires an image, the images opt-in header, and a model supporting Box (upstream recommends jev-preview).
ChoiceAnswer
ChoiceQuestion
Selects among named labels.
Env
Environment variable names. Explicit constructor values take precedence.
Image
PNG/JPEG file bytes. The API validates image format, dimensions and limits. Bytes are copied on construction so later caller mutations cannot change a request.
ModelCard
Metadata for an available model.
Models
Access to GET /v1/models.
NoulAnswer
NoulQuestion
Yes/no question with optional outcome descriptions.
PrintLogger
Question
A question identified by its type field.
RetryOverrides
Per-call partial overrides. Omitted fields inherit the client's policy.
RetryPolicy
Complete retry configuration. Use RetryOverrides for partial per-call changes.
ScoreAnswer
ScoreQuestion
Ordered rubric; scores are indices from zero.
SystemOneResult
Answers keyed by question name, plus model and usage.
TextWithAssets
Text retaining the images that were inserted into it.
TypeSafeClient
Client for the TypeSafe AI API (Jev / System One).
TypeSafeLogger
Log sink compatible with print-style logging.
Usage
Token usage for a request.
WithResponse<T>
Parsed data plus the buffered response; obtaining it performs no second call.

Enums

AssetEncoding
Compression
Pure Dart zstd works on VM and Web; none sends the original bytes.
LogLevel

Constants

defaultTimeout → const Duration
kDefaultBaseUrl → const String
Default API root.
kDefaultModel → const String
Default System One model alias.
packageVersion → const String
Package version sent in User-Agent / X-TypeSafe-SDK.
requestIdHeader → const String

Properties

defaultRetryPolicy → RetryPolicy
final
defaultRetryStatuses → Set<int>
HTTP 408, 429, and 5xx.
final

Functions

box([Object? instructions]) → BoxQuestion
choice(Object? instructions, Map<String, Object?> criteria) → ChoiceQuestion
Create a choice question. criteria must be a map of labels.
describeValidationErrors(List<Object?> errors) → String?
extractMessage(Object? body) → String?
image(List<int> bytes) → Image
isRetryableStatus(int status, [RetryPolicy? policy]) → bool
joinAssets(Iterable<Object?> pieces, [String separator = ',']) → TextWithAssets
Dart equivalent of JS withAssets.join; supports nested TextWithAssets.
noul([Object? instructions, Map<String, Object?>? criteria]) → NoulQuestion
Create a yes/no question.
parseLogLevel(String value, String source) → LogLevel
parseRetryAfter(Map<String, String> headers, {DateTime? now}) → Duration?
Parse retry-after-ms or Retry-After into a Duration.
questionsToJson(Map<String, Question> questions) → Map<String, Object?>
Maps questions to JSON for POST /v1/systemone.
readEnv(String name) → String?
Trimmed environment value, or null when missing/blank (web: always null).
redactHeaders(Map<String, String> headers) → Map<String, String>
requestIdFrom(BaseResponse response) → String?
resolveApiKey(String? fromCode) → String?
API key from code, TYPESAFE_API_KEY, then JEV_API_KEY.
retryDelay(int attempt, {Map<String, String>? headers, RetryPolicy? policy, double random()?}) → Duration
score(Object? instructions, List<Object?> criteria) → ScoreQuestion
Create a score question. criteria must have at least two entries.
validateQuestions(Map<String, Question> questions) → void
Reject empty question sets and invalid score criteria.
withAssets(Iterable<Object?> pieces) → TextWithAssets
Compose text and assets: withAssets('Compare ', photo, ' with ', other).