public class ActionsSdkApp
extends DefaultApp
Implementation of App for ActionsSDK based webhook. Developers must extend this class if they are using the ActionsSDK (as against Dialogflow) to handle requests.
Note that the value of the @ForIntent annotation must match (case-sensitive) the name of the intent.
Usage:
class MyActionsApp extends ActionsSdkApp {
@ForIntent("welcome")
public CompletableFuture showWelcomeMessage(
ActionRequest request) {
// Intent handler implementation here.
}
Modifier and Type | Field and Description |
---|---|
static com.google.actions.api.ActionsSdkApp.Companion |
Companion
Deprecated.
|
Constructor and Description |
---|
ActionsSdkApp()
Implementation of App for ActionsSDK based webhook. Developers must extend
this class if they are using the ActionsSDK (as against Dialogflow) to handle
requests.
|
Modifier and Type | Method and Description |
---|---|
ActionRequest |
createRequest(java.lang.String inputJson,
java.util.Map<?,?> headers)
Creates an ActionRequest for the specified JSON and metadata.
|
ResponseBuilder |
getResponseBuilder(ActionRequest request) |
createRequest, getErrorMsg_badReturnValue, getResponseBuilder, handleError, handleRequest, routeRequest
handleRequest
public static com.google.actions.api.ActionsSdkApp.Companion Companion
public ActionsSdkApp()
Implementation of App for ActionsSDK based webhook. Developers must extend this class if they are using the ActionsSDK (as against Dialogflow) to handle requests.
Note that the value of the @ForIntent annotation must match (case-sensitive) the name of the intent.
Usage:
class MyActionsApp extends ActionsSdkApp {
@ForIntent("welcome")
public CompletableFuture showWelcomeMessage(
ActionRequest request) {
// Intent handler implementation here.
}
public ActionRequest createRequest(java.lang.String inputJson, java.util.Map<?,?> headers)
Creates an ActionRequest for the specified JSON and metadata.
inputJson
- The input JSON.headers
- Map containing metadata, usually from the HTTP request
headers.public ResponseBuilder getResponseBuilder(ActionRequest request)