Intent
Stentor API Reference / stentor-models/src / Intent
Interface: Intent
Defined in: packages/stentor-models/src/Intent/Intent.ts:22
Intents represent the request of a user.
Extendsβ
Extended byβ
Propertiesβ
organizationIdβ
organizationId:
string
Defined in: packages/stentor-models/src/Intent/Intent.ts:26
The organization ID for the app of which this intent belongs.
appIdβ
appId:
string
Defined in: packages/stentor-models/src/Intent/Intent.ts:30
The ID for the app the intent belongs to.
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.
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.
name?β
optionalname:string
Defined in: packages/stentor-models/src/Intent/Intent.ts:45
The human readable name of the intent.
createdAt?β
optionalcreatedAt:string
Defined in: packages/stentor-models/src/Intent/Intent.ts:49
ISO-8601 string of when the intent was created.
slots?β
optionalslots:Slot[]
Defined in: packages/stentor-models/src/Intent/Intent.ts:54
The slots defined within the utterance patterns and their Entity types.
slotTypes?β
optionalslotTypes:SlotTypeMap
Defined in: packages/stentor-models/src/Intent/Intent.ts:60
A map of the slot type definition.
Deprecatedβ
Use Entities
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
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
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.
graphCoords?β
optionalgraphCoords:GraphCoords
Defined in: packages/stentor-models/src/Intent/Intent.ts:102
UI position coordinates for graphing.
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"
Overridesβ
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
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
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.