public final class DialogueEvent extends Object
Dialogue events come in three types, each signifying which part of the ConversationState
in the event may have changed:
This event indicates a likely update to the data being displayed to
the user, often signalling a scene transition. A prompt
event will often be dispatched along with state change events.
This event indicates that the user has requested the app to
perform some action. It may be accompanied by a prompt
event containing a system prompt to be read while the action is
occurring, but such prompts are not guaranteed to exist.
When the action (including any network requests for data, storing
retrieved data in the conversation data store, etc.) is
complete, completeTurn()
should be called on the dialogue
manager referenced by the event. This will allow any returned data
to be validated against dialogue rules to determine the proper
system reply, at which point a navigation
and/or
prompt
event will be dispatched.
This event indicates that a system prompt should be displayed and/or read to the user.
This event indicates an error during dialogue turn processing.
Modifier and Type | Class and Description |
---|---|
static class |
DialogueEvent.Type
The type of event being dispatched.
|
Modifier and Type | Field and Description |
---|---|
ConversationState |
state
The state of the conversation at the time of the event.
|
DialogueEvent.Type |
type
The event's type.
|
Constructor and Description |
---|
DialogueEvent(DialogueEvent.Type eventType,
ConversationState newState)
Create a new dialogue event.
|
public final DialogueEvent.Type type
public final ConversationState state
Note that ACTION
events may be dispatched with
prospective destination nodes that might not be valid until the action in
question is complete.
public DialogueEvent(DialogueEvent.Type eventType, ConversationState newState)
eventType
- The event's type.newState
- The state of the conversation at the time of the event.Copyright © 2021. All rights reserved.