docs(ai): note integer-like decision question names sort first

This commit is contained in:
Aiden Cline
2026-10-31 17:29:08 -05:00
Unverified
parent 06f2715267
commit 7ab560de80
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -287,7 +287,8 @@ if (department.type === "choice") department.choice // "billing" | "technical"
```
`input` is a JSON object or an ordered list of `text`, `json` and `media` parts. Questions are keyed by name, and
answers come back under the same names; key order is the order sent to the host.
answers come back under the same names. Key order is the order sent to the host; as in any JavaScript object,
integer-like names such as `"1"` come first.
A question the host declines is `{ type: "error", reason, message? }`, with `reason` such as `"refusal"`; the other
answers still come back.
`response.usage` has `inputTokens`, `outputTokens`, `totalTokens` and the host's reported `cost` when it sends one;
+1 -1
View File
@@ -63,7 +63,7 @@ export const DecisionQuestion = Schema.Union([PredicateQuestion, ChoiceQuestion,
Schema.toTaggedUnion("type"),
)
export type DecisionQuestion = Schema.Schema.Type<typeof DecisionQuestion>
/** Questions keyed by name; key order is the order sent to the host. */
/** Questions keyed by name; key order is the order sent to the host, with integer-like names such as `"1"` first. */
export type DecisionQuestions = Readonly<Record<string, DecisionQuestion>>
// Only what makes a request meaningless is checked here; counts and sizes are the host's to enforce.