Skip to content

NlpEngineOptions

type NlpEngineOptions = {
locale?: string;
logger?: Logger;
providers: NlpProviderActions[];
retrainDelay?: number;
services: Services;
threshold?: number;
};

Defined in: engine/engine.types.ts:9

optional locale?: string;

Defined in: engine/engine.types.ts:13

Language the corpus is trained in. Defaults to 'en'.


optional logger?: Logger;

Defined in: engine/engine.types.ts:32


providers: NlpProviderActions[];

Defined in: engine/engine.types.ts:11


optional retrainDelay?: number;

Defined in: engine/engine.types.ts:31

How long to wait after a slot reports a change before retraining, in milliseconds. Defaults to 250.

Coalescing matters more than latency here: a provider reconnecting can mark a dozen slots stale in the same tick, and each one triggering its own retrain would rebuild the whole corpus a dozen times.


services: Services;

Defined in: engine/engine.types.ts:10


optional threshold?: number;

Defined in: engine/engine.types.ts:22

Score below which a phrase is treated as matching nothing. Defaults to 0.8, and overridable per call.

This is the engine’s own floor, not a decision about whether to act. A caller about to execute a match rather than display it should apply a higher bar — the cost of a false positive there is a wrong action taken silently.