GitHub

API reference for schema.

OpenRouter's alpha Decisions API wire format (Effect's OpenRouterSchema): the questions of a decisions request and the answers of its response, as TypedDict types with their schemas. Instructions and descriptions are strings, JSON objects or JSON arrays (a choice's description may also be None); an answer's probabilities and confidence are optional.

Values

AttributeTypeDescription
ENTRYUnionSchema[str | dict[str, bool | int | float | str | Sequence[JsonValue] | Mapping[str, JsonValue] | None] | tuple[bool | int | float | str | Sequence[JsonValue] | Mapping[str, JsonValue] | None, ...], str | Mapping[str, bool | int | float | str | Sequence[JsonValue] | Mapping[str, JsonValue] | None] | Sequence[bool | int | float | str | Sequence[JsonValue] | Mapping[str, JsonValue] | None], Never, Never]
CHOICE_QUESTIONStructSchema[ChoiceQuestion, Never, Never]
SCORE_QUESTIONStructSchema[ScoreQuestion, Never, Never]
NOUL_QUESTIONStructSchema[NoulQuestion, Never, Never]
DECISIONS_QUESTIONUnionSchema[ChoiceQuestion | ScoreQuestion | NoulQuestion, Mapping[str, object], Never, Never]
CHOICE_ANSWERStructSchema[ChoiceAnswer, Never, Never]
SCORE_ANSWERStructSchema[ScoreAnswer, Never, Never]
NOUL_ANSWERStructSchema[NoulAnswer, Never, Never]
ANSWERUnionSchema[ChoiceAnswer | ScoreAnswer | NoulAnswer, Mapping[str, object], Never, Never]
DECISIONS_REQUESTStructSchema[DecisionsRequest, Never, Never]
DECISIONS_RESPONSEStructSchema[DecisionsResponse, Never, Never]

Types

TypeDefinitionDescription
Entrytype Entry = str | Mapping[str, JsonValue] | Sequence[JsonValue]

Instructions or a description: a string, a JSON object or a JSON array.

DecisionsQuestiontype DecisionsQuestion = ChoiceQuestion | ScoreQuestion | NoulQuestion
Answertype Answer = ChoiceAnswer | ScoreAnswer | NoulAnswer

Classes