public final class Model extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
Model.Feature
A feature represents the app operating on data outside the control of the
dialogue policy.
|
static class |
Model.Frame
A conversation frame is roughly analogous to a screen/
Activity in an application. |
static class |
Model.Node
A node represents a specific conversational state within a broader
Model.Frame. |
static class |
Model.Rule
A rule alters the conversation flow based on the data available to the
policy at runtime.
|
| Constructor and Description |
|---|
Model()
No-arg constructor used by Gson deserialization.
|
| Modifier and Type | Method and Description |
|---|---|
String |
baseNode(String frameName)
Get the name of the base/main
Model.Node for a given frame. |
io.spokestack.spokestack.dialogue.policy.Model.AbstractNode |
fetchNode(String nodeId)
Fetch a node by ID.
|
Model.Node |
findErrorNode(io.spokestack.spokestack.dialogue.policy.UserTurn userTurn,
String nodeId)
Locate the most specific error node relevant to the user's request.
|
Model.Node |
findSpecialNode(io.spokestack.spokestack.dialogue.policy.UserTurn userTurn,
String nodeId)
Locate the most specific node relevant to the user's request.
|
Model.Feature |
lookupFeature(String featureName,
String currentNode)
Look up a feature given its name.
|
Model.Node |
lookupNode(String nodeName)
Look up a node given its name.
|
public Model.Node findSpecialNode(io.spokestack.spokestack.dialogue.policy.UserTurn userTurn, String nodeId)
Currently, help and inform dialogue acts route the user
to frames whose names match the act, looking for nodes within those
frames in the following descending order of specificity:
<frame>.<node_or_feature_name>.<slot_name><frame>.<node_or_feature_name><frame>.__base__
In the above examples, node_or_feature_name refers to the user's
conversation state at the time of userTurn. slot_name is
currently only relevant to the inform act but may be expanded
in the future.
userTurn - The user turn that calls for a special node.nodeId - The user's current node in the conversation.public Model.Node findErrorNode(io.spokestack.spokestack.dialogue.policy.UserTurn userTurn, String nodeId)
This method acts much like findSpecialNode, looking up nodes on the error frame in the
following descending order of specificity:
error.<intent_name>.<node_or_feature_name>error.<intent_name>error.__base__
In the above examples, node_or_feature_name refers to the user's
conversation state at the time of userTurn. intent_name
refers to the user's intent.
userTurn - The user turn that calls for a special node.nodeId - The user's current node in the conversation.public String baseNode(String frameName)
Model.Node for a given frame.frameName - The name of the frame.frameName's base node.public Model.Node lookupNode(@NonNull String nodeName)
nodeName - The name of the node to fetch. May be in frame.node format or frame format for a frame's
base node.null if no such node exists.public Model.Feature lookupFeature(String featureName, String currentNode)
featureName - The name of the feature to fetch.currentNode - The ID of the user's current node, to aid in
disambiguation.null if no such feature exists.public io.spokestack.spokestack.dialogue.policy.Model.AbstractNode fetchNode(String nodeId)
nodeId - The ID of the node to retrieve.Copyright © 2021. All rights reserved.