ConversationHandler
Stentor API Reference / stentor-handler/src / ConversationHandler
Class: ConversationHandler
Defined in: packages/stentor-handler/src/ConversationHandler.ts:11
The most basic implementation of an abstract handler, the conversation handler facilitates basic back and forth, request & response, with users.
Extendsβ
Constructorsβ
Constructorβ
new ConversationHandler(
props):ConversationHandler
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:63
Parametersβ
propsβ
Handler\<Content, Data, Forward, Redirect>
Returnsβ
ConversationHandler
Inherited fromβ
Propertiesβ
typeβ
readonlytype:string
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:37
Inherited fromβ
intentIdβ
readonlyintentId:string
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:39
The ID of the intent, typically a combination of the name and a random string.
Inherited fromβ
appIdβ
readonlyappId:string
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:41
The ID for the app the intent belongs to.
Inherited fromβ
organizationIdβ
readonlyorganizationId:string
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:43
The organization ID for the app of which this intent belongs.
Inherited fromβ
AbstractHandler.organizationId
createdAtβ
readonlycreatedAt:string
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:45
ISO-8601 string of when the intent was created.
Inherited fromβ
contentβ
readonlycontent:Content
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:47
Inherited fromβ
dataβ
data:
Data
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:49
Inherited fromβ
forwardβ
readonlyforward:Forward
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:51
Inherited fromβ
redirectβ
readonlyredirect:Redirect
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:53
Inherited fromβ
name?β
readonlyoptionalname:string
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:55
The human readable name of the intent.
Inherited fromβ
slots?β
readonlyoptionalslots:Slot[]
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:57
The slots defined within the utterance patterns and their Entity types.
Inherited fromβ
slotTypes?β
readonlyoptionalslotTypes:SlotTypeMap
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:59
A map of the slot type definition.
Deprecatedβ
Use Entities
Inherited fromβ
permissions?β
readonlyoptionalpermissions:UserDataType[]
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:61
Inherited fromβ
Methodsβ
isOwnRequest()β
isOwnRequest(
request):boolean
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:86
Determines if the request is for itself.
Parametersβ
requestβ
Returnsβ
boolean
Inherited fromβ
canHandleRequest()β
canHandleRequest(
request,context):boolean
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:97
In order to determine if another handler needs to be requested, we need to see if the current handler can handle the request.
Parametersβ
requestβ
contextβ
Returnsβ
boolean
Inherited fromβ
AbstractHandler.canHandleRequest
forwardingPathForRequest()β
forwardingPathForRequest(
request,context):Promise\<ExecutablePath>
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:126
Get the forwarding path for the provided request.
Returns undefined if a path could not be found.
Parametersβ
requestβ
contextβ
Returnsβ
Promise\<ExecutablePath>
Inherited fromβ
AbstractHandler.forwardingPathForRequest
redirectingPathForRequest()β
redirectingPathForRequest(
request,context):Promise\<ExecutablePath>
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:139
Check if we have redirects (applied before handling the request). Usually some gate condition.
Returns undefined if a path could not be found.
Parametersβ
requestβ
contextβ
Returnsβ
Promise\<ExecutablePath>
Inherited fromβ
AbstractHandler.redirectingPathForRequest
canHandleInputUnknown()β
canHandleInputUnknown(
request,context):boolean
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:151
Can handle InputUnknown
Parametersβ
requestβ
contextβ
Returnsβ
boolean
Inherited fromβ
AbstractHandler.canHandleInputUnknown
repeat()β
protectedrepeat(request,context):Promise\<void>
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:176
Repeats the last uttered response.
Parametersβ
requestβ
contextβ
Returnsβ
Promise\<void>
Inherited fromβ
inputUnknown()β
protectedinputUnknown(request,context):Promise\<void>
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:197
Handles the situation where the handler
Parametersβ
requestβ
contextβ
Returnsβ
Promise\<void>
Inherited fromβ
start()β
start(
request,context):Promise\<void>
Defined in: packages/stentor-handler/src/AbstractHandler/Handler.ts:269
Kicks off the handler, typically called when the intent associated with the handler is requested.
Parametersβ
requestβ
contextβ
Returnsβ
Promise\<void>
Deprecatedβ
- Use handleRequest(), this is now just a wrapper that calls handleRequest()
Inherited fromβ
handleRequest()β
handleRequest(
request,context):Promise\<void>
Defined in: packages/stentor-handler/src/ConversationHandler.ts:12
Handles the incoming request. Sets the necessary responses and saves the necessary items to storage.
Parametersβ
requestβ
contextβ
Returnsβ
Promise\<void>