public interface DialoguePolicy
The API for dialogue policies used by Spokestack's DialogueManager
component.
A dialogue policy must have a constructor that accepts a SpeechConfig
instance to be used by the dialogue
management system.
Modifier and Type | Method and Description |
---|---|
void |
completeTurn(boolean success,
ConversationData conversationData,
DialogueDispatcher eventDispatcher)
Complete the pending user turn.
|
String |
dump(ConversationData conversationData)
Store the internal state of the dialogue policy in the specified data
store for cross-session persistence.
|
void |
handleTurn(NLUResult userTurn,
ConversationData conversationData,
DialogueDispatcher eventDispatcher)
Process a user turn and return a relevant response.
|
void |
load(String state,
ConversationData conversationData)
Load previously serialized internal state.
|
String dump(ConversationData conversationData)
conversationData
- The data store where policy state should be
saved.void load(String state, ConversationData conversationData) throws Exception
void handleTurn(NLUResult userTurn, ConversationData conversationData, DialogueDispatcher eventDispatcher)
userTurn
- The user input as determined by the NLU
component.conversationData
- Conversation data used to resolve and prepare a
response.eventDispatcher
- Dispatcher used to notify listeners of dialogue
events.void completeTurn(boolean success, ConversationData conversationData, DialogueDispatcher eventDispatcher)
This method should be called after any actions or data retrieval pending in the app are completed.
success
- true
if the user's request/desired action
was fulfilled successfully; false
otherwise.conversationData
- Conversation data used to resolve and prepare a
response.eventDispatcher
- Dispatcher used to notify listeners of dialogueCopyright © 2021. All rights reserved.