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#
| Attribute | Type | Description |
|---|---|---|
ENTRY | UnionSchema[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_QUESTION | StructSchema[ChoiceQuestion, Never, Never] | |
SCORE_QUESTION | StructSchema[ScoreQuestion, Never, Never] | |
NOUL_QUESTION | StructSchema[NoulQuestion, Never, Never] | |
DECISIONS_QUESTION | UnionSchema[ChoiceQuestion | ScoreQuestion | NoulQuestion, Mapping[str, object], Never, Never] | |
CHOICE_ANSWER | StructSchema[ChoiceAnswer, Never, Never] | |
SCORE_ANSWER | StructSchema[ScoreAnswer, Never, Never] | |
NOUL_ANSWER | StructSchema[NoulAnswer, Never, Never] | |
ANSWER | UnionSchema[ChoiceAnswer | ScoreAnswer | NoulAnswer, Mapping[str, object], Never, Never] | |
DECISIONS_REQUEST | StructSchema[DecisionsRequest, Never, Never] | |
DECISIONS_RESPONSE | StructSchema[DecisionsResponse, Never, Never] |
Types#
| Type | Definition | Description |
|---|---|---|
Entry | type Entry = str | Mapping[str, JsonValue] | Sequence[JsonValue] | Instructions or a description: a string, a JSON object or a JSON array. |
DecisionsQuestion | type DecisionsQuestion = ChoiceQuestion | ScoreQuestion | NoulQuestion | |
Answer | type Answer = ChoiceAnswer | ScoreAnswer | NoulAnswer |