public class DialogSystem
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DialogSystem.DynamicEditAction |
Modifier and Type | Field and Description |
---|---|
static int |
LANGUAGE_ID_EN_US |
static int |
LANGUAGE_ID_ZH_TW |
Modifier and Type | Method and Description |
---|---|
int |
clearAppContext(java.lang.String domain)
Clear specific domain UUID in current dialog system stack.
|
int |
clearBackgroundContext(java.lang.String domain)
Clear background context
|
int |
dynamicEditInstance(java.lang.String domain,
DialogSystem.DynamicEditAction action,
java.lang.String entity,
org.json.JSONArray instances)
Add/Delete/Update user defined instances of an specific Entity.
|
int |
jumpToPlan(java.lang.String domain,
java.lang.String plan)
Let dialog state switch to specific plan, and
set output context of this plan on top of the context stack.
|
int |
jumpToPlan(java.lang.String domain,
java.lang.String plan,
boolean crossIntent)
Let dialog state switch to specific plan, and
set output context of this plan on top of the context stack.
|
int |
queryExpressionStatus()
Query expression status
return result in onResult callback, result bundle will have an JSON string,
key is result.
|
int |
registerListenCallback(RobotCallback.Listen listen)
Register the listen callback functions for Dialog System.
|
int |
setBackgroundContext(java.lang.String domain,
java.lang.String plan)
Set background context
|
int |
setExpression(RobotFace face)
Set the robot expression.
|
int |
setExpression(RobotFace face,
java.lang.String sentence)
Make robot expression and speak.
|
int |
setExpression(RobotFace face,
java.lang.String sentence,
ExpressionConfig config)
Make robot expression and speak.
|
int |
setListenContext(java.lang.String domain,
java.lang.String context)
Force Dialog System to listen specific context in the DS Editor
|
int |
setPressOnHeadAction(boolean enable)
Set press on head action.
|
int |
setTouchOnlySignal(java.lang.Boolean setting)
Touch only signal
It will show "touch only" on top of screen if user trigger by "Hey Zenbo".
|
int |
setVoiceTrigger(boolean enable)
Set dialog system voice trigger.
|
int |
speak(java.lang.String sentence)
Start speaking.
|
int |
speak(java.lang.String sentence,
int languageType)
Deprecated.
|
int |
speak(java.lang.String sentence,
SpeakConfig config)
Start speaking.
|
int |
speakAndListen(java.lang.String sentence,
float timeout)
Deprecated.
|
int |
speakAndListen(java.lang.String sentence,
float timeout,
int retry)
Deprecated.
|
int |
speakAndListen(java.lang.String sentence,
SpeakConfig config)
Start speaking and listening
If sentence is an empty string (""), Zenbo will listen directly.
|
int |
stopSpeak()
Stop TTS
|
int |
stopSpeakAndListen()
Stop speak and listen
|
int |
unregisterListenCallback()
Unregister listen callback
|
public static final int LANGUAGE_ID_EN_US
public static final int LANGUAGE_ID_ZH_TW
public int clearAppContext(java.lang.String domain)
domain
- domain UUIDpublic int clearBackgroundContext(java.lang.String domain)
domain
- domain UUIDpublic int dynamicEditInstance(java.lang.String domain, DialogSystem.DynamicEditAction action, java.lang.String entity, org.json.JSONArray instances)
domain
- domain UUIDaction
- types of actionentity
- the existed entity added on the Concept page of DS Editorinstances
- the instances to be modifiedpublic int jumpToPlan(java.lang.String domain, java.lang.String plan)
domain
- domain UUIDplan
- Plan ID to be switched topublic int jumpToPlan(java.lang.String domain, java.lang.String plan, boolean crossIntent)
domain
- domain UUIDplan
- Plan ID to be switched tocrossIntent
- true
enable cross intentpublic int queryExpressionStatus()
Example: {"FaceID":"1","FaceExit":"false"}
public int registerListenCallback(RobotCallback.Listen listen)
listen
- listen callback functionsRobotCallback.Listen
public int setBackgroundContext(java.lang.String domain, java.lang.String plan)
domain
- domain UUIDplan
- Plan IDpublic int setExpression(RobotFace face)
face
- robot face expression IDpublic int setExpression(RobotFace face, java.lang.String sentence)
face
- robot face expression IDsentence
- sentence of text to speechpublic int setExpression(RobotFace face, java.lang.String sentence, ExpressionConfig config)
face
- robot face expression IDsentence
- sentence of text to speechconfig
- configuration for expression enginepublic int setListenContext(java.lang.String domain, java.lang.String context)
domain
- domain UUIDcontext
- context to listen topublic int setPressOnHeadAction(boolean enable)
enable
- flag to enable/disable press on head action.public int setTouchOnlySignal(java.lang.Boolean setting)
setting
- enable/disable this functionpublic int setVoiceTrigger(boolean enable)
enable
- flag to enable/disable dialog system voice triggerpublic int speak(java.lang.String sentence)
sentence
- sentence of text to speech@Deprecated public int speak(java.lang.String sentence, int languageType)
sentence
- sentence of text to speechlanguageType
- LANGUAGE_ID_ZH_TW or LANGUAGE_ID_EN_USpublic int speak(java.lang.String sentence, SpeakConfig config)
sentence
- sentence of text to speechconfig
- configuration for speak engine@Deprecated public int speakAndListen(java.lang.String sentence, float timeout)
sentence
- sentence of text to speechtimeout
- CSR listening timeout setting (sec)@Deprecated public int speakAndListen(java.lang.String sentence, float timeout, int retry)
sentence
- sentence of text to speechtimeout
- CSR listening timeout setting (sec)retry
- max retry times to ask user to speak againpublic int speakAndListen(java.lang.String sentence, SpeakConfig config)
sentence
- sentence sentence of text to speechconfig
- configuration for speak enginepublic int stopSpeak()
public int stopSpeakAndListen()
public int unregisterListenCallback()