Skip to main content

Intent

Stentor API Reference


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?​

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.


name?​

optional name: string

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

The human readable name of the intent.


createdAt?​

optional createdAt: string

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

ISO-8601 string of when the intent was created.


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.


slotTypes?​

optional slotTypes: SlotTypeMap

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

A map of the slot type definition.

Deprecated​

Use Entities


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


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


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.


graphCoords?​

optional graphCoords: GraphCoords

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

UI position coordinates for graphing.


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"

Overrides​

Localizable.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


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


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.

Overrides​

Localizable.locales