BlocklistOptions
Options for createBlocklistGuardrail.
Defined in: src/guardrails/blocklist.ts:20
Options for createBlocklistGuardrail.
Properties
| Property | Type | Default value | Description | Defined in |
|---|---|---|---|---|
action? | BlocklistAction | 'block' | What to do on a match. Remarks - 'block' (default) — suppress the text. At the 'final' stage nothing is spoken; at the 'chunk' stage the rest of the utterance is dropped. - 'redact' — replace each match with BlocklistOptions.replacement and speak the rest. | src/guardrails/blocklist.ts:50 |
caseSensitive? | boolean | false | Match terms case-sensitively. | src/guardrails/blocklist.ts:64 |
name? | string | 'blocklist' | Guardrail name reported in events. | src/guardrails/blocklist.ts:81 |
patterns? | readonly RegExp[] | undefined | Patterns to match, for anything literals cannot express. Remarks Applied as-is. Include the global flag when using action: 'redact' so every occurrence is replaced. | src/guardrails/blocklist.ts:37 |
replacement? | string | '[removed]' | Text substituted for each match when action is 'redact'. | src/guardrails/blocklist.ts:57 |
stages? | readonly GuardrailStage[] | both stages | Stages at which to run. | src/guardrails/blocklist.ts:88 |
terms? | readonly string[] | undefined | Literal terms to match. Remarks Matched case-insensitively on whole words by default; see BlocklistOptions.caseSensitive and BlocklistOptions.wholeWord. | src/guardrails/blocklist.ts:28 |
wholeWord? | boolean | true | Require terms to match whole words rather than substrings. Remarks On by default, so blocking ass does not also block assessment. | src/guardrails/blocklist.ts:74 |