mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-17 05:26:47 +03:00
docs(ai): note integer-like decision question names sort first
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user