Skip to main content

Handler

Stentor API Reference


Stentor API Reference / stentor-models/src / Handler

Interface: Handler\<C, D, F, R>

Defined in: packages/stentor-models/src/Handler/Handler.ts:14

A handler defines the necessary information to handle incoming requests and return a response.

Extends​

Type Parameters​

C​

C extends Content = Content

D​

D extends Data = Data

F​

F extends Forward = Forward

R​

R extends Redirect = Redirect

Properties​

type​

type: string

Defined in: packages/stentor-models/src/Handler/Handler.ts:20


content?​

optional content: C

Defined in: packages/stentor-models/src/Handler/Handler.ts:21


data?​

optional data: D

Defined in: packages/stentor-models/src/Handler/Handler.ts:22


forward?​

optional forward: F

Defined in: packages/stentor-models/src/Handler/Handler.ts:23


redirect?​

optional redirect: R

Defined in: packages/stentor-models/src/Handler/Handler.ts:24


permissions?​

optional permissions: UserDataType[]

Defined in: packages/stentor-models/src/Handler/Handler.ts:25


organizationId​

organizationId: string

Defined in: packages/stentor-models/src/Intent/Intent.ts:26

The organization ID for the app of which this intent belongs.

Inherited from​

Intent.organizationId


appId​

appId: string

Defined in: packages/stentor-models/src/Intent/Intent.ts:30

The ID for the app the intent belongs to.

Inherited from​

Intent.appId


intentId​

intentId: string

Defined in: packages/stentor-models/src/Intent/Intent.ts:35

The ID of the intent, typically a combination of the name and a random string.

Inherited from​

Intent.intentId


dialogflowId?​

optional dialogflowId: string

Defined in: packages/stentor-models/src/Intent/Intent.ts:41

Dialogflow keeps track of individual intents by a unique ID.

Deprecated​

This field is being phased out.

Inherited from​

Intent.dialogflowId


name?​

optional name: string

Defined in: packages/stentor-models/src/Intent/Intent.ts:45

The human readable name of the intent.

Inherited from​

Intent.name


createdAt?​

optional createdAt: string

Defined in: packages/stentor-models/src/Intent/Intent.ts:49

ISO-8601 string of when the intent was created.

Inherited from​

Intent.createdAt


slots?​

optional slots: Slot[]

Defined in: packages/stentor-models/src/Intent/Intent.ts:54

The slots defined within the utterance patterns and their Entity types.

Inherited from​

Intent.slots


slotTypes?​

optional slotTypes: SlotTypeMap

Defined in: packages/stentor-models/src/Intent/Intent.ts:60

A map of the slot type definition.

Deprecated​

Use Entities

Inherited from​

Intent.slotTypes


substitutions?​

optional substitutions: object

Defined in: packages/stentor-models/src/Intent/Intent.ts:84

Substitutions can be used to clean up your utterance pattern to make it more readable.

For example, you may often have a lot of slots at the beginning of every pattern:

\{$\{acknowledge\}|$\{yes_no\}|\}$\{prefix\} the rest of the utterance

This then moves the actual meat of the pattern to the right when really you don't care about the above except that it is there.

Substitutions will allow you to replace these, just at the local intent level, to make it easier to read.

{ ["PREFIX"]}: "{${acknowledge}|${yes_no}|}${prefix}" }

So it then becomes:

$\{_PREFIX_\} the rest of the utterance

It also allows you to change the substitution value and have it updated across all the utterance patterns where the substitution exists.

When compiling the patterns, the substitution is applied first before expanding.

Index Signature​

[pattern: string]: string

Inherited from​

Intent.substitutions


utterancePatterns?​

optional utterancePatterns: string[]

Defined in: packages/stentor-models/src/Intent/Intent.ts:90

An array of utterance patterns.

For more information on syntax see https://github.com/alexa-js/alexa-utterances

Inherited from​

Intent.utterancePatterns


langCode?​

optional langCode: "en-US"

Defined in: packages/stentor-models/src/Intent/Intent.ts:97

The language code. Defaults to "en-US".

Default Value​

"en-US"

Deprecated​

This is no longer in use (it was in fact, never used). Favor Intent.defaultLocale and Intent.locales instead.

Inherited from​

Intent.langCode


graphCoords?​

optional graphCoords: GraphCoords

Defined in: packages/stentor-models/src/Intent/Intent.ts:102

UI position coordinates for graphing.

Inherited from​

Intent.graphCoords


defaultLocale?​

optional defaultLocale: Locale

Defined in: packages/stentor-models/src/Intent/Intent.ts:109

This is the locale in which the app is primarily focused on. The intent will publish to this locale with the data provided. Items which can be overwritten can be placed in the "locale" section with the locale necessary.

Default Value​

"en"

Inherited from​

Intent.defaultLocale


contexts?​

optional contexts: object[]

Defined in: packages/stentor-models/src/Intent/Intent.ts:122

Contexts the must be active to have this intent be weighted more heavily or selected.

For Amazon Lex, the contexts are required to be selected.

https://docs.aws.amazon.com/lex/latest/dg/API_PutIntent.html#lex-PutIntent-request-inputContexts

For Dialogflow ES, these are more heavily weighted towards matching.

https://cloud.google.com/dialogflow/es/docs/contexts-input-output#input_contexts https://cloud.google.com/dialogflow/es/docs/reference/rest/v2/projects.agent.intents#Intent

name​

name: string

Inherited from​

Intent.contexts


nlu?​

optional nlu: object

Defined in: packages/stentor-models/src/Intent/Intent.ts:130

NLU specific metadata used when translating the intentId to a NLU specific type.

Use to override the type for a specific NLU.

Additional metadata can be appended that can be used for translating the type.

Index Signature​

[nlu: string]: object

Inherited from​

Intent.nlu


locales?​

optional locales: Partial\<Record\<Locale, LocaleSpecificIntent>>

Defined in: packages/stentor-models/src/Intent/Intent.ts:139

This is a series of locales that the apps supports. These can override the items that are in the original Intent. The items in the main intent are used as defaults if they are not provided by this locale.

Locales are hierarchical. Languages will override the default attributes. Dialects will override the languages.

Inherited from​

Intent.locales