function score<TLevels>(options): object;Defined in: packages/ai/src/activities/evaluate/index.ts:389
Build a score question. The model rates state on ordered levels.
You must pass at least two levels. .value is the nearest level label. The raw fraction stays on .score. On the wire, levels is sent as TypeSafe criteria.
TLevels extends readonly string[]
EvaluateJsonValue
What the model should rate.
TLevels
Ordered labels, lowest first. At least two.
object
criteria: TLevels = options.levels;instructions: EvaluateJsonValue = options.instructions;type: "score";const urgency = score({
instructions: 'How urgent is this ticket?',
levels: ['low', 'medium', 'high'],
})