TypeSafeSchema unstable
Codecs for the TypeSafe System One API.
Schemas
A System One answer.
Signature
declare const Answer: Union<readonly [Struct<{ readonly choice: String; readonly confidence: Number; readonly probabilities: $Record<String, Number>; readonly type: Literal<"choice">;}>, Struct<{ readonly confidence: Number; readonly legend: optional<$Record<String, Codec<Json, Json, never, never>>>; readonly probabilities: $Record<String, Number>; readonly score: Number; readonly type: Literal<"score">;}>, Struct<{ readonly noul: Number; readonly type: Literal<"noul">;}>]>ChoiceAnswer
unstable Since v4.0.0 Source
A classification distribution.
Signature
declare const ChoiceAnswer: Struct<{ readonly choice: String; readonly confidence: Number; readonly probabilities: $Record<String, Number>; readonly type: Literal<"choice">;}>ChoiceQuestion
unstable Since v4.0.0 Source
A classification question.
Signature
declare const ChoiceQuestion: Struct<{ readonly criteria: $Record<String, NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>>; readonly instructions: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; readonly type: Literal<"choice">;}>ListModelsResponse
unstable Since v4.0.0 Source
Available TypeSafe models.
Signature
declare const ListModelsResponse: Struct<{ readonly models: $Array<Struct<{ readonly description: optional<String>; readonly name: String; readonly release_date: optional<String>; }>>;}>NoulAnswer
unstable Since v4.0.0 Source
A Bernoulli probability.
Signature
declare const NoulAnswer: Struct<{ readonly noul: Number; readonly type: Literal<"noul">;}>NoulQuestion
unstable Since v4.0.0 Source
A probability question.
Signature
declare const NoulQuestion: Struct<{ readonly criteria: optional<Struct<{ readonly false: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; readonly true: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; }>>; readonly instructions: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; readonly type: Literal<"noul">;}>A System One question with string, JSON object, JSON array, or null instructions and descriptions.
Signature
declare const Question: Union<readonly [Struct<{ readonly criteria: $Record<String, NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>>; readonly instructions: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; readonly type: Literal<"choice">;}>, Struct<{ readonly criteria: $Array<NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>>; readonly instructions: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; readonly type: Literal<"score">;}>, Struct<{ readonly criteria: optional<Struct<{ readonly false: NullOr<Union<readonly [String, $Record<..., ...>, $Array<...>]>>; readonly true: NullOr<Union<readonly [String, $Record<..., ...>, $Array<...>]>>; }>>; readonly instructions: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; readonly type: Literal<"noul">;}>]>ScoreAnswer
unstable Since v4.0.0 Source
A zero-based rating and index-keyed distribution. legend maps indices to descriptions.
Signature
declare const ScoreAnswer: Struct<{ readonly confidence: Number; readonly legend: optional<$Record<String, Codec<Json, Json, never, never>>>; readonly probabilities: $Record<String, Number>; readonly score: Number; readonly type: Literal<"score">;}>ScoreQuestion
unstable Since v4.0.0 Source
An ordered rating question.
Signature
declare const ScoreQuestion: Struct<{ readonly criteria: $Array<NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>>; readonly instructions: NullOr<Union<readonly [String, $Record<String, Codec<Json, Json, never, never>>, $Array<Codec<Json, Json, never, never>>]>>; readonly type: Literal<"score">;}>SystemOneRequest
unstable Since v4.0.0 Source
A batch of questions against encoded state.
Signature
declare const SystemOneRequest: Struct<{ readonly model: String; readonly questions: $Record<String, Union<readonly [Struct<{ readonly criteria: $Record<String, NullOr<Union<readonly [..., ..., ...]>>>; readonly instructions: NullOr<Union<readonly [String, $Record<..., ...>, $Array<...>]>>; readonly type: Literal<"choice">; }>, Struct<{ readonly criteria: $Array<NullOr<Union<readonly [..., ..., ...]>>>; readonly instructions: NullOr<Union<readonly [String, $Record<..., ...>, $Array<...>]>>; readonly type: Literal<"score">; }>, Struct<{ readonly criteria: optional<Struct<{ readonly false: NullOr<...>; readonly true: NullOr<...>; }>>; readonly instructions: NullOr<Union<readonly [String, $Record<..., ...>, $Array<...>]>>; readonly type: Literal<"noul">; }>]>>; readonly state: Codec<Json, Json, never, never>;}>SystemOneResponse
unstable Since v4.0.0 Source
Answers and token usage for a batch.
Signature
declare const SystemOneResponse: Struct<{ readonly answers: $Record<String, Union<readonly [Struct<{ readonly choice: String; readonly confidence: Number; readonly probabilities: $Record<String, Number>; readonly type: Literal<"choice">; }>, Struct<{ readonly confidence: Number; readonly legend: optional<$Record<String, Codec<Json, Json, never, never>>>; readonly probabilities: $Record<String, Number>; readonly score: Number; readonly type: Literal<"score">; }>, Struct<{ readonly noul: Number; readonly type: Literal<"noul">; }>]>>; readonly model: String; readonly usage: optional<Struct<{ readonly input_tokens: optional<Number>; readonly output_tokens: optional<Number>; }>>;}>