function boolean(options):
| {
criteria?: undefined;
instructions: EvaluateJsonValue;
type: "noul";
}
| {
criteria: {
false?: string;
true?: string;
};
instructions: EvaluateJsonValue;
type: "noul";
};Defined in: packages/ai/src/activities/evaluate/index.ts:419
Build a yes/no question.
.value is true when P(true) is 0.5 or more. There is no .confidence. On the wire, the type is TypeSafe noul.
{ false?: string; true?: string; }
Optional descriptions of yes and no.
string
string
EvaluateJsonValue
The yes/no question to judge.
| { criteria?: undefined; instructions: EvaluateJsonValue; type: "noul"; } | { criteria: { false?: string; true?: string; }; instructions: EvaluateJsonValue; type: "noul"; }
const refund = boolean({
instructions: 'Is the customer asking for a refund?',
})