Skip to main content

NLUService

Stentor API Reference


Stentor API Reference / stentor-models/src / NLUService

Interface: NLUService

Defined in: packages/stentor-models/src/NLU/NLUService.ts:70

Service which can turn raw text into an intent and slots (optional).

Methods​

query()​

query(q, props?): Promise\<NLUQueryResponse>

Defined in: packages/stentor-models/src/NLU/NLUService.ts:77

Query the NLU with the user's natural language input. A resolved intent will be returned from the NLU

Parameters​

q​

string

Natural language query from the user

props?​

NLURequestProps

Returns​

Promise\<NLUQueryResponse>


setContext()?​

optional setContext(props): Promise\<void>

Defined in: packages/stentor-models/src/NLU/NLUService.ts:85

Used to set context that will be used for the next query of the NLU.

This is used to set active contexts for example, which help prefer certain intents on the next query call.

Parameters​

props​

NLURequestProps

Returns​

Promise\<void>