Types in the Alexa Conversations Core Library (ACCL)

The Alexa Conversations Core Library (ACCL) provides a list of built-in types and actions that you use in Alexa Conversations Description Language (ACDL) files.

The ACCL is in the com.amazon.alexa.ask.conversations namespace, which the ACDL compiler automatically imports into each ACDL file. You therefore don't need to manually import the library or declare these types when you use them in dialog samples.

Overview

The ACCL provides the following types.

Type Description
Action Represents a particular behavior of the skill, such as a verbal or visual response to the user, an AWS Lambda invocation, or a dialog management instruction (for example, to end the dialog).
Affirm Represents an Affirm request act, which conveys that Alexa Conversations should treat the event as an affirmation.
APL Represents a reference to visual content that's displayed on Alexa devices with a screen, in the form of an Alexa Presentation Language (APL) document.
APLA Represents a reference to the speech that Alexa says to the user, in the form of an APL for Audio (APLA) document.
Args Represents a variable list of arguments in an action.
Argument Represents an argument of an action.
Arguments Represents the arguments of an action.
Bye Represents a Bye response act, which you use to end the conversation.
CarryOverArgument Represents an argument that's passed from the previous action to the offered action.
ConfirmAction Represents a ConfirmAction response act, which you use before an action invocation to confirm that the user wants to invoke the action.
ConfirmArgs Represents a ConfirmArgs response act, which you use to confirm a list of action arguments that the user provided.
ConfirmArguments Represents arguments to ask the user to confirm by using the confirmArgs action.
Deny Represents a Deny request act, which conveys that Alexa Conversations should treat the event as a denial.
Event Represents a trigger, such as something the user says.
Inform Represents an Inform request act, which conveys that Alexa Conversations should treat the event as information.
Invoke Represents an Invoke request act, which conveys that Alexa Conversations should treat the event as a user-initiated request to start the conversation flow.
List Represents a list of items.
MultiModalResponse Represents a reference to an APL document and, optionally, to an APLA document.
Nothing Represents the equivalent of null from many programming languages.
Notify Represents a Notify response act, which you use to inform the user of the result of an action, which is typically an API call.
Offer Represents an Offer response act, which you use to offer a related action when the user has achieved their initial goal.
ReqAlt Represents a ReqAlt response act, which you use to request an alternative response to continue the conversational flow.
ReqMore Represents a ReqMore response act, which you use to request to continue the conversational flow.
Request Represents a Request response act, which you use to request information from the user.
RequestAct Conveys to Alexa Conversations some additional information about an event, such as whether the event represents the initiation of a conversational flow, an affirmation to a previously returned question, a denial, and so on. The request act can be of type Affirm, Deny, Inform, or Invoke.
RequestArguments Represents missing arguments to request.
Response Represents a prompt from the skill to the user. Responses can be of type APL, APLA, or MultiModalResponse.
ResponseAct Conveys to Alexa Conversations some additional information about a response, such as whether the response represents a request for the user to confirm an action, a suggestion to call a new action, and so on. The response act can be of type Bye, ConfirmAction, ConfirmArgs, Notify, Offer, ReqAlt, ReqMore, or Request.
Type Represents a type.
UtteranceEvent Represents an utterance event, which you define by using the utterances action.

For details about actions that use these types, see Actions in the ACCL.

Action

Represents a particular behavior of the skill, such as a verbal or visual response to the user, an AWS Lambda invocation, or a dialog management instruction (for example, to end the dialog).

For details about how to declare and use actions, see Using Actions in ACDL.

type Action {
  Arguments arguments
  Type returnType
}
Field Description Type
arguments The arguments of the action. Arguments
returnType The return type of the action. Type

Affirm

Represents an Affirm request act, which conveys that Alexa Conversations should treat the event as an affirmation. Extends RequestAct.

type Affirm : RequestAct {}

APL

Represents a reference to visual content that's displayed on Alexa devices with a screen, in the form of an Alexa Presentation Language (APL) document. APL documents are imported from the <skill-directory>/skill-package/response/displays/ folder in the skill package. For details, see Create APLA and APL files. Extends Response.

type APL : Response {}

APLA

Represents a reference to the speech that Alexa says to the user, in the form of an APL for Audio (APLA) document. APLA documents are imported from the <skill-directory>/skill-package/response/prompts/ folder in the skill package. For details, see Create APLA and APL files. Extends Response.

type APLA : Response {}

Args

Represents a variable list of arguments in an action.

type Args<T> : List<T> {
}
Field Description Type
T The type of each argument. Type

Example

In the following example, anAction() accepts a variable set of arguments of type Number.

action Nothing anAction(Args<Number> numbers)
...
dialog ... {
  sample {
    ...

    anAction(1, 2, 3, 4)
  }
}

Argument

Represents an argument of an action.

type Argument {
  Type argumentType
  Boolean isOptional
}

Field Description Type
argumentType The type of argument. Type
isOptional Boolean that indicates whether the argument is optional. Boolean

Arguments

Represents the arguments of an action.

type Arguments {}

Bye

Represents a Bye response act, which you use to end the conversation. For details, see Bye. Extends ResponseAct.

type Bye : ResponseAct {
}

CarryOverArgument

Represents an argument that's passed from the previous action to the offered action. You offer an action by using the Offer response act.

type CarryOverArgument {
  Argument argument
  Thing source
}
Field Description Type
argument An argument that's passed from the previous action to the offered action. Argument
source The source of the carry-over argument. Thing

ConfirmAction

Represents a ConfirmAction response act, which you use before an action invocation to confirm that the user wants to invoke the action. For details, see ConfirmAction. Extends ResponseAct.

For an alternative way to use the ConfirmAction response act, you can use the confirmAction() action.

type ConfirmAction : ResponseAct {
  Action actionName
}
Field Description Type
actionName The action that Alexa requests the user to confirm. Action

ConfirmArgs

Represents a ConfirmArgs response act, which you use to confirm a list of action arguments that the user provided. For details, see ConfirmArgs. Extends ResponseAct.

For an alternative way to use the ConfirmArgs response act, see the confirmArgs() action.

type ConfirmArgs : ResponseAct {
  List<Argument> arguments
}
Field Description Type
arguments The arguments that Alexa asks the user to confirm. List<Argument>

ConfirmArguments

Represents arguments to ask the user to confirm by using the confirmArgs action.

type ConfirmArguments {
  Response response
  List<Argument> arguments
}
Field Description Type
response The response that asks the user to confirm the arguments. Response
arguments The arguments to ask the user to confirm. List<Argument>

Deny

Represents a Deny request act, which conveys that Alexa Conversations should treat the event as a denial. Extends RequestAct.

type Deny : RequestAct {}

Event

Represents a trigger, such as something the user says.

type Event<T> {
  T entities
}
Field Description Type
entities The entities associated with the event. T

Inform

Represents an Inform request act, which conveys that Alexa Conversations should treat the event as information. Extends RequestAct.

type Inform : RequestAct {}

Invoke

Represents an Invoke request act, which conveys that Alexa Conversations should treat the event as a user-initiated request to start the conversation flow. Extends RequestAct.

type Invoke : RequestAct {}

List

Represents a list of items. Alexa Conversations supports List expressions in actions and utterance sets.

type List<T> { }

MultiModalResponse

Represents a reference to an APL document and, optionally, to an APLA document. For details, see Create APLA and APL files. Extends Response.

type MultiModalResponse : Response {
  APLA apla
  optional APL apl
}
Field Description Type
apla The speech that Alexa says to the user, in the form of APLA. APLA
apl Optional visual content that Alexa displays on Alexa devices with a screen, in the form of APL. APL

Nothing

Represents the equivalent of null from many programming languages. It is a bottom type – a subtype of everything. Nothing is a reserved keyword in ACDL.

type Nothing { }

Notify

Represents a Notify response act, which you use to inform the user of the result of an action, which is typically an API call. For details, see Notify. Extends ResponseAct.

type Notify : ResponseAct {
  Action actionName
  optional Boolean success
}
Field Description Type
actionName The action for which to report the results. Action
success Optional Boolean value that indicates whether the action was a success. Use true to indicate that the given action completed successfully. Use false if the action didn't complete successfully. Default: true. Boolean

Offer

Represents an Offer response act, which you use to offer a related action when the user has achieved their initial goal. For details, see Offer. Extends ResponseAct.

type Offer : ResponseAct {
  Action actionName
  optional List<Argument> requestArgs
  optional List<CarryOverArgument> carryOverArguments
}
Field Description Type
actionName The action to offer to the user. Action
requestArgs Optional list of arguments to request from the user. These arguments belong to the action to offer. List<Argument>
carryOverArguments Optional list of arguments that pass from the previous action to the offered action. List<CarryOverArgument>

ReqAlt

Represents a ReqAlt response act, which you use to request an alternative response to continue the conversational flow. For details, see ReqAlt. Extends ResponseAct.

type ReqAlt : ResponseAct {
  List<Argument> arguments
}
Field Description Type
arguments The alternative arguments. List<Argument>

ReqMore

Represents a ReqMore response act, which you use to request to continue the conversational flow. For details, see ReqMore. Extends ResponseAct.

type ReqMore : ResponseAct {
}

Request

Represents a Request response act, which you use to request information from the user. For details, see Request. Extends ResponseAct.

type Request : ResponseAct {
  List<Argument> arguments
}
Field Description Type
arguments A list of arguments to request. List<Argument>

RequestAct

Conveys to Alexa Conversations some additional information about an event, such as whether the event represents the initiation of a conversational flow, an affirmation to a previously returned question, a denial, and so on.

For details about using request acts, see Request Acts in the ACCL.

You can't define your own request acts. Alexa Conversations rejects custom request acts that extend RequestAct.

type RequestAct { }

The request act can be one of the following types:

RequestArguments

Represents missing arguments to request.

type RequestArguments {
  List<Argument> arguments
  Response response
  optional Event informEvent
}

Field Description Type
arguments The missing arguments to request. List<Argument>
response The response that requests the missing arguments. Response
informEvent The optional event in which the user provides the missing arguments. Event

Response

Represents a prompt from the skill to the user. Responses can be of type APL, APLA, or MultiModalResponse. You provide APL, APLA, and MultiModalResponse expressions to response-related actions, such as response(). For details about using responses, see Using Responses in ACDL.

type Response {}

ResponseAct

Conveys to Alexa Conversations some additional information about a response, such as whether the response represents a request for the user to confirm an action, a suggestion to call a new action, and so on. You associate responses with response acts. To associate a response with a response act, you pass the response() action an expression that derives from ResponseAct.

For details, see Response Acts in the Alexa Conversations Core Library (ACCL).

type ResponseAct {}

The response act can be one of the following types:

Type

Represents a type.

type Type<T> {}

UtteranceEvent

Represents an utterance event, which you define by using the utterances action. Extends Event.

type UtteranceEvent<T> : Event<T> {
  String text
}
Field Description Type
text The utterances associated with the utterance event. String