API reference

VoiceServiceRequest Class

Constructors

VoiceServiceRequest ( newInputType , newOptions , newEvents )
Constructor for Voice Service requests
Signature
Meta.WitAi.Requests.VoiceServiceRequest.VoiceServiceRequest(NLPRequestInputType newInputType, WitRequestOptions newOptions, VoiceServiceRequestEvents newEvents)
Parameters
newInputType: NLPRequestInputType  The request input type (text/audio) to be used
newOptions: WitRequestOptions  The request parameters to be used
newEvents: VoiceServiceRequestEvents  The request events to be called throughout it's lifecycle

Protected Fields

ResponseDecoder : override INLPRequestResponseDecoder< WitResponseNode >
Signature
override INLPRequestResponseDecoder<WitResponseNode> Meta.WitAi.Requests.VoiceServiceRequest.ResponseDecoder

Fields

IsLocalRequest : bool
Check if request is local
Signature
bool Meta.WitAi.Requests.VoiceServiceRequest.IsLocalRequest
StatusCode : int
The status code returned from the last request
Signature
int Meta.WitAi.Requests.VoiceServiceRequest.StatusCode

Protected Methods

ApplyResponseData ( responseData , isFinal )
Signature
override void Meta.WitAi.Requests.VoiceServiceRequest.ApplyResponseData(WitResponseNode responseData, bool isFinal)
Parameters
responseData: WitResponseNode
isFinal: bool
Returns
override void
OnSimulateResponse ()
Signature
override bool Meta.WitAi.Requests.VoiceServiceRequest.OnSimulateResponse()
Returns
override bool
RaiseEvent ( eventCallback )
Performs an event callback with this request as the parameter
Signature
override void Meta.WitAi.Requests.VoiceServiceRequest.RaiseEvent(VoiceServiceRequestEvent eventCallback)
Parameters
eventCallback: VoiceServiceRequestEvent  The voice service request event to be called
Returns
override void
SetEventListeners ( newEvents , add )
Subscribes or unsubscribes all provided VoiceServiceRequestEvents from this request's VoiceServiceRequestEvents callbacks.
Signature
override void Meta.WitAi.Requests.VoiceServiceRequest.SetEventListeners(VoiceServiceRequestEvents newEvents, bool add)
Parameters
newEvents: VoiceServiceRequestEvents  The events to subscribe or unsubscribe to the request.Events
add: bool  Whether to add listeners or remove listeners
Returns
override void
ShouldIgnoreError ( errorStatusCode , errorMessage )
Check for ignored error status codes & messages.
Signature
override bool Meta.WitAi.Requests.VoiceServiceRequest.ShouldIgnoreError(int errorStatusCode, string errorMessage)
Parameters
errorStatusCode: int  The error status code if applicable
errorMessage: string  The error to be returned
Returns
override bool

Internal Methods

SimulateError ( errorType )
Simulates a specific error
Signature
virtual void Meta.WitAi.Requests.VoiceServiceRequest.SimulateError(VoiceErrorSimulationType errorType)
Parameters
Returns
void