function choice<TOptions>(options): object;Defined in: packages/ai/src/activities/evaluate/index.ts:361
Build a choice question. The model picks one key from options.
Option keys become the union on .value. Use null when a key needs no extra description. On the wire, options is sent as TypeSafe criteria.
TOptions extends Record<string, string | null>
EvaluateJsonValue
What the model should decide.
TOptions
Map of option key to description, or null.
object
criteria: TOptions = options.options;instructions: EvaluateJsonValue = options.instructions;type: "choice";const queue = choice({
instructions: 'Which team should handle this ticket?',
options: {
billing: 'Payments, invoices, refunds',
tech: 'Bugs, outages, integrations',
sales: 'Pricing, upgrades, new accounts',
},
})