public abstract class SpokestackAdapter extends Object implements Callback<NLUResult>, DialogueListener, OnSpeechEventListener, TraceListener, TTSListener
This class provides empty implementations of all Spokestack listener methods. It can be extended and individual methods overridden to receive only those events.
Constructor and Description |
---|
SpokestackAdapter() |
Modifier and Type | Method and Description |
---|---|
void |
call(NLUResult result)
Called when an NLU classification result is available if this class is
registered as a callback at classification time.
|
void |
error(SpokestackModule module,
Throwable err)
Receive notifications of errors from any module.
|
void |
eventReceived(TTSEvent event)
Receive events from the TTS module.
|
void |
nluResult(NLUResult result)
Called when an NLU classification result is available if this class is
registered as a callback at classification time.
|
void |
onDialogueEvent(DialogueEvent event)
Receive events from the dialogue management module.
|
void |
onError(Throwable err)
Receive notifications of errors that occur during NLU classification if
this class is registered as a callback at classification time.Adapters
added to a
Spokestack class at build time are automatically
registered for all classifications. |
void |
onEvent(SpeechContext.Event event,
SpeechContext context)
Receive events from the speech pipeline.
|
void |
onTrace(EventTracer.Level level,
String message)
Receive trace messages from the NLU module.
|
void |
speechEvent(SpeechContext.Event event,
SpeechContext context)
Receive events from the speech pipeline.
|
void |
trace(SpokestackModule module,
String message)
Receive trace messages from any module.
|
void |
ttsEvent(TTSEvent event)
Receive events from the TTS module.
|
public void onEvent(@NotNull SpeechContext.Event event, @NotNull SpeechContext context)
Clients should typically override speechEvent(SpeechContext.Event,
SpeechContext)
instead of this method.
onEvent
in interface OnSpeechEventListener
event
- The name of the event that was raised.context
- The current speech context.public void speechEvent(@NotNull SpeechContext.Event event, @NotNull SpeechContext context)
event
- The name of the event that was raised.context
- The current speech context.public void call(@NotNull NLUResult result)
Spokestack
class at build time are automatically registered for
all classifications.
Clients should typically override nluResult(NLUResult)
instead
of this method.
call
in interface Callback<NLUResult>
result
- The NLU result.TensorflowNLU.classify(String)
,
AsyncResult
public void nluResult(@NotNull NLUResult result)
Spokestack
class at build time are automatically registered for
all classifications.result
- The NLU result.TensorflowNLU.classify(String)
,
AsyncResult
public void onError(@NotNull Throwable err)
Spokestack
class at build time are automatically
registered for all classifications.
Clients should typically override error(SpokestackModule,
Throwable)
instead of this method.
onError
in interface Callback<NLUResult>
err
- An error generated during expected NLU classification.TensorflowNLU.classify(String)
,
AsyncResult
public void onTrace(@NotNull EventTracer.Level level, @NotNull String message)
Clients should typically override trace(SpokestackModule,
String)
instead of this method.
onTrace
in interface TraceListener
level
- The trace event's severity level.message
- the trace event's message.public void eventReceived(@NotNull TTSEvent event)
Clients should typically override ttsEvent(TTSEvent)
instead of
this method.
eventReceived
in interface TTSListener
event
- The event from the TTS module.public void ttsEvent(@NotNull TTSEvent event)
event
- The event from the TTS module.public void onDialogueEvent(@NotNull DialogueEvent event)
onDialogueEvent
in interface DialogueListener
event
- The dialogue event.public void trace(@NotNull SpokestackModule module, @NotNull String message)
module
- The module where the message originated.message
- the trace event's message.public void error(@NotNull SpokestackModule module, @NotNull Throwable err)
module
- The module where the error originated.err
- An error generated during Spokestack operation.Copyright © 2021. All rights reserved.