public static class DialogueManager.Builder extends Object
| Constructor and Description |
|---|
Builder()
Create a new dialogue manager builder with a default configuration.
|
Builder(SpeechConfig speechConfig)
Create a new dialogue manager builder with the supplied
configuration.
|
| Modifier and Type | Method and Description |
|---|---|
DialogueManager.Builder |
addListener(DialogueListener listener)
Add a listener to receive dialogue events and related log messages.
|
DialogueManager |
build()
Build a dialogue manager that reflects the current builder state.
|
boolean |
hasPolicy() |
DialogueManager.Builder |
setProperty(String key,
Object value)
Sets a configuration value.
|
DialogueManager.Builder |
withDataStore(ConversationData dataStore)
Specify the data store to use for conversation data.
|
DialogueManager.Builder |
withDialoguePolicy(String policyClass)
Specify the dialogue policy for the manager to use.
|
DialogueManager.Builder |
withPolicyFile(String file)
Specify the path to the JSON file containing a Spokestack dialogue
policy for the manager to use.
|
DialogueManager.Builder |
withTraceLevel(int level)
Specify the maximum level of log messages to be delivered to
listeners.
|
public Builder()
public Builder(SpeechConfig speechConfig)
speechConfig - The configuration to use for dialogue
management.public DialogueManager.Builder setProperty(String key, Object value)
key - configuration property namevalue - property valuepublic DialogueManager.Builder withPolicyFile(String file)
This is a convenience method for setProperty("dialogue-policy-file", file).
file - Path to a dialogue configuration file.public DialogueManager.Builder withDialoguePolicy(String policyClass)
This is a convenience method for setProperty("dialogue-policy-class", policyClass).
policyClass - The name of the class containing the dialogue
policy to use.public boolean hasPolicy()
public DialogueManager.Builder withDataStore(ConversationData dataStore)
dataStore - The data store to use for the conversation.public DialogueManager.Builder withTraceLevel(int level)
level - The maximum log level to deliver.public DialogueManager.Builder addListener(DialogueListener listener)
listener - A dialogue listener.public DialogueManager build() throws Exception
Exception - if there is an error building the manager.Copyright © 2021. All rights reserved.