public class NLSlotPlugin extends java.lang.Object implements Plugin
| Constructor and Description |
|---|
NLSlotPlugin(com.speechstorm.fish.runtime.VuiContext vuiContext_p) |
| Modifier and Type | Method and Description |
|---|---|
void |
addSlot(java.lang.String sSlotName_p,
java.lang.String sSlotValue_p)
Adds a slot name and value to the slots bucket in no particular order
|
void |
addSlot(java.lang.String sSlotName_p,
java.lang.String sSlotValue_p,
float fConfidence_p)
Adds a slot name, value and confidence to the slots bucket in no particular order
|
void |
clearSlot(java.lang.String sName_p)
Clears a slot _internally_ in the DialogEngine object.
|
java.lang.String |
getName() |
java.util.Map<java.lang.String,java.util.Map<com.speechstorm.fish.ai.dialogcommons.SlotValue,java.lang.Float>> |
getSlots()
Returns a read-only map where each key is the name of a slot, and the
content is a mapping of values to confidence scores (0.0-1.0).
|
java.lang.String |
getSlotValue(java.lang.String sSlotName_p)
Gets the value of the first slot it encounters matching the given name.
|
void |
saveSlotToVariable(java.lang.String sSlotName_p,
java.lang.String sVariableName_p)
DialogFlowV2DialogEnginePlugin stores slot values in 2 string formats:
a) JSON String.
|
public NLSlotPlugin(com.speechstorm.fish.runtime.VuiContext vuiContext_p)
public java.lang.String getName()
public java.util.Map<java.lang.String,java.util.Map<com.speechstorm.fish.ai.dialogcommons.SlotValue,java.lang.Float>> getSlots()
{
"Vegetable" : {
"Aubergine" : 0.7,
"Carrot" : 0.13
},
"Fruit" : {
"Tomato" : 0.8
}
}
public void clearSlot(java.lang.String sName_p)
public void addSlot(java.lang.String sSlotName_p,
java.lang.String sSlotValue_p)
sSlotName_p - String name of the slot (if it's not already in the bucket)sSlotValue_p - String valuepublic void addSlot(java.lang.String sSlotName_p,
java.lang.String sSlotValue_p,
float fConfidence_p)
sSlotName_p - String name of the slot (if it's not already in the bucket)sSlotValue_p - String valuefConfidence_p - float confidence between 0 and 1public java.lang.String getSlotValue(java.lang.String sSlotName_p)
sSlotName_p - public void saveSlotToVariable(java.lang.String sSlotName_p,
java.lang.String sVariableName_p)
throws java.lang.Exception
sSlotName_p - String name of the slot to be found in the bucketsVariableName_p - String name of the variable to assign the value of the slotjava.lang.Exception