core / org.rewedigital.dialog.handler / DialogflowHandler
class DialogflowHandler
Wrapper of WebhookRequest which provides utility functions for easier context access and other parameters. And also provides instance of DialogflowResponseBuilder.
Name | Summary |
---|---|
ContextWrapper | class ContextWrapper |
Name | Summary |
---|---|
<init> | DialogflowHandler(webhookRequest: WebhookRequest ) Wrapper of WebhookRequest which provides utility functions for easier context access and other parameters. And also provides instance of DialogflowResponseBuilder. |
Name | Summary |
---|---|
accessToken | val accessToken: String ? An OAuth2 token that identifies the user in your system. Only available if Account Linking configuration is defined in the action package and the user links their account. |
action | val action: String ? The action name defined in Dialogflow. |
arguments | val arguments: Map < String , Any > The collection of extracted entities. |
context | val context: ContextWrapper Holds context related information. |
intentName | val intentName: String ? The intent name defined in Dialogflow. |
isNewSession | val isNewSession: Boolean Indicates if the current session has type of Conversation.Type.NEW |
languageCode | val languageCode: String ? The language that was triggered during intent detection. |
originalRequest | val originalRequest: String ? Returns the original request string from Dialogflow. |
responseBuilder | val responseBuilder: DialogflowResponseBuilder Returns an DialogflowResponseBuilder which can be used to construct a complete webhook response containing speech and visual components. |
sessionId | val sessionId: String ? The unique identifier of detectIntent request session. Can be used to identify end-user inside webhook implementation. Format: projects//agent/sessions/, or projects//agent/environments//users//sessions/. |
userId | val userId: String ? An unique identifier of the users google account. |
Name | Summary |
---|---|
getArgument | fun getArgument(key: String ): Any ? Returns the value for the key from arguments. |
getContext | fun getContext(name: String ): OutputContext ? Returns the context for the given name. |
getContextList | fun getContextList(): List < OutputContext > Returns all contexts. |
getContextParam | fun getContextParam(name: String , key: String ): Any ? Returns the context parameter value for the given name and key |
hasSurfaceCapability | fun hasSurfaceCapability(capability: SurfaceCapabilities ): Boolean Returns true if the request has the given SurfaceCapabilities |
permissionGranted | fun permissionGranted(): Boolean Checks if on the last request a permission was successfully granted. |
selectedOption | fun selectedOption(): String ? Returns the selected option after a org.rewedigital.dialog.model.google.SystemIntents.OPTION |
setContext | fun setContext(name: String , lifespan: Int = 4, params: DialogflowParams ): Unit Set a context and overwrites the old one, with the same name, if present. |
setContextParam | fun setContextParam(name: String , key: String , value: Any ): Unit Set a context parameter. |
signInStatus | fun signInStatus(): String ? Returns the current sign in status. Status can be one of org.rewedigital.dialog.model.google.Status.SignIn. |