Interface: IOutputRule
Defined in: internal/guardrails/types.ts:248
One rule on the answer, after the model call.
Properties
name
name:
string
Defined in: internal/guardrails/types.ts:250
Machine name, e.g. "invoice_sum"; stamped on its issues as ruleName.
timeoutMs?
optionaltimeoutMs?:number
Defined in: internal/guardrails/types.ts:252
Overrides IGuardrailsConfig.ruleTimeoutMs for this rule.
Methods
check()
check(
args):Promise<IIssue[]>
Defined in: internal/guardrails/types.ts:258
Returns issues; empty array = pass. The app's rules run in parallel. A throw, or no answer within the timeout, becomes
the ERROR issue rule_error (the error is logged on the server and reported to IGuardrailsConfig.onRuleError).
abortSignal is aborted at the timeout.
Parameters
args
abortSignal
AbortSignal
evidence
judge
Asks a model, for rules that classify (moderation, grounding).
Returns
Promise<IIssue[]>