Handler
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β
Dβ
Fβ
Rβ
Propertiesβ
typeβ
type:
string
Defined in: packages/stentor-models/src/Handler/Handler.ts:20
content?β
optionalcontent:C
Defined in: packages/stentor-models/src/Handler/Handler.ts:21
data?β
optionaldata:D
Defined in: packages/stentor-models/src/Handler/Handler.ts:22
forward?β
optionalforward:F
Defined in: packages/stentor-models/src/Handler/Handler.ts:23
redirect?β
optionalredirect:R
Defined in: packages/stentor-models/src/Handler/Handler.ts:24
permissions?β
optionalpermissions: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β
appIdβ
appId:
string
Defined in: packages/stentor-models/src/Intent/Intent.ts:30
The ID for the app the intent belongs to.
Inherited fromβ
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β
dialogflowId?β
optionaldialogflowId: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β
name?β
optionalname:string
Defined in: packages/stentor-models/src/Intent/Intent.ts:45
The human readable name of the intent.
Inherited fromβ
createdAt?β
optionalcreatedAt:string
Defined in: packages/stentor-models/src/Intent/Intent.ts:49
ISO-8601 string of when the intent was created.
Inherited fromβ
slots?β
optionalslots:Slot[]
Defined in: packages/stentor-models/src/Intent/Intent.ts:54
The slots defined within the utterance patterns and their Entity types.
Inherited fromβ
slotTypes?β
optionalslotTypes:SlotTypeMap
Defined in: packages/stentor-models/src/Intent/Intent.ts:60
A map of the slot type definition.
Deprecatedβ
Use Entities
Inherited fromβ
substitutions?β
optionalsubstitutions: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β
utterancePatterns?β
optionalutterancePatterns: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β
langCode?β
optionallangCode:"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β
graphCoords?β
optionalgraphCoords:GraphCoords
Defined in: packages/stentor-models/src/Intent/Intent.ts:102
UI position coordinates for graphing.
Inherited fromβ
defaultLocale?β
optionaldefaultLocale: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β
contexts?β
optionalcontexts: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β
nlu?β
optionalnlu: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β
locales?β
optionallocales: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.