Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

TypeSafeSchema unstable

Codecs for the TypeSafe System One API.

11 exports Since v4.0.0 Source

Schemas

Answer

unstable
Since v4.0.0

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, String>>;
readonly probabilities: $Record<String, Number>;
readonly score: Number;
readonly type: Literal<"score">;
}>, Struct<{
readonly noul: Number;
readonly type: Literal<"noul">;
}>]>
Since v4.0.0

A classification distribution.

Signature

declare const ChoiceAnswer: Struct<{
readonly choice: String;
readonly confidence: Number;
readonly probabilities: $Record<String, Number>;
readonly type: Literal<"choice">;
}>
Since v4.0.0

A classification question.

Signature

declare const ChoiceQuestion: Struct<{
readonly criteria: $Record<String, String>;
readonly instructions: String;
readonly type: Literal<"choice">;
}>
Since v4.0.0

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

A Bernoulli probability.

Signature

declare const NoulAnswer: Struct<{
readonly noul: Number;
readonly type: Literal<"noul">;
}>
Since v4.0.0

A probability question.

Signature

declare const NoulQuestion: Struct<{
readonly criteria: optional<Struct<{
readonly false: String;
readonly true: String;
}>>;
readonly instructions: String;
readonly type: Literal<"noul">;
}>

Question

unstable
Since v4.0.0

A System One question.

Signature

declare const Question: Union<readonly [Struct<{
readonly criteria: $Record<String, String>;
readonly instructions: String;
readonly type: Literal<"choice">;
}>, Struct<{
readonly criteria: $Array<String>;
readonly instructions: String;
readonly type: Literal<"score">;
}>, Struct<{
readonly criteria: optional<Struct<{
readonly false: String;
readonly true: String;
}>>;
readonly instructions: String;
readonly type: Literal<"noul">;
}>]>

ScoreAnswer

unstable
Since v4.0.0

A zero-based rating and index-keyed distribution.

Signature

declare const ScoreAnswer: Struct<{
readonly confidence: Number;
readonly legend: optional<$Record<String, String>>;
readonly probabilities: $Record<String, Number>;
readonly score: Number;
readonly type: Literal<"score">;
}>
Since v4.0.0

An ordered rating question.

Signature

declare const ScoreQuestion: Struct<{
readonly criteria: $Array<String>;
readonly instructions: String;
readonly type: Literal<"score">;
}>
Since v4.0.0

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, String>;
readonly instructions: String;
readonly type: Literal<"choice">;
}>, Struct<{
readonly criteria: $Array<String>;
readonly instructions: String;
readonly type: Literal<"score">;
}>, Struct<{
readonly criteria: optional<Struct<{
readonly false: String;
readonly true: String;
}>>;
readonly instructions: String;
readonly type: Literal<"noul">;
}>]>>;
readonly state: Codec<Json, Json, never, never>;
}>
Since v4.0.0

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, String>>;
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>;
}>>;
}>