jev_dart library
Dart client for TypeSafe AI (Jev / System One).
Classes
- Answer
- Answer for a named question.
- ChoiceAnswer
- ChoiceQuestion
- Selects among named labels.
- Env
- Environment variable names. Explicit constructor values take precedence.
- 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
typefield. - RetryPolicy
- Retry configuration. Unset override fields inherit client / SDK defaults.
- ScoreAnswer
- ScoreQuestion
- Ordered rubric; scores are indices from zero.
- SystemOneResult
- Answers keyed by question name, plus model and usage.
- TypeSafeClient
- Client for the TypeSafe AI API (Jev / System One).
- TypeSafeLogger
-
Log sink compatible with
print-style logging. - Usage
- Token usage for a request.
Enums
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
-
choice(
Object? instructions, Map< String, Object?> criteria) → ChoiceQuestion -
Create a choice question.
criteriamust be a map of labels. -
describeValidationErrors(
List< Object?> errors) → String? -
extractMessage(
Object? body) → String? -
isRetryableStatus(
int status, [RetryPolicy? policy]) → bool -
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-msorRetry-Afterinto 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
nullwhen missing/blank (web: alwaysnull). -
redactHeaders(
Map< String, String> headers) → Map<String, String> -
requestIdFrom(
BaseResponse response) → String? -
resolveApiKey(
String? fromCode) → String? -
API key from code,
TYPESAFE_API_KEY, thenJEV_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.
criteriamust have at least two entries. -
validateQuestions(
Map< String, Question> questions) → void - Reject empty question sets and invalid score criteria.
Exceptions / Errors
- ApiAbortException
- ApiConnectionException
- ApiException
- Unsuccessful HTTP response from the API.
- ApiTimeoutException
- AuthenticationException
- BadRequestException
- InternalServerException
- NotFoundException
- PermissionDeniedException
- RateLimitException
- TypeSafeException
- Base class for SDK errors.
- UnprocessableEntityException