API reference
API reference
Select your platform
No SDKs available
No versions available

WitRequest Class

Manages a single request lifecycle when sending/receiving data from Wit.ai.
Meta::WitAi::WitRequest extends Meta.WitAi.Requests.VoiceServiceRequest.

Overview

Properties

The wit Configuration to be used with this request
int
The request timeout in ms
Encoding settings for audio based requests
string
Path[Get]
Endpoint to be used for this request
string
Command[Get]
Final portion of the endpoint Path
bool
IsPost[Get]
Whether a post command should be called
Key value pair that is sent as a query param in the Wit.ai uri
bool
Returns true if the response had begun
bool
Returns true if the response had begun

Data Fields

byte []
string
string
const int
bool
Returns true if the request is being performed
Action< string >
Returns the raw string response that was received before converting it to a JSON object.
Provides an opportunity to customize the url just before a request executed

Object Data

override bool

Events

Provides an opportunity to provide custom headers for the request just before it is executed.
Action< WitRequest >
Callback called when the server is ready to receive data from the WitRequest's input stream. See WitRequest.Write()
Action< string >
Returns a partial utterance from an in process request
Action< string >
Returns a full utterance from a completed request
Action< WitRequest >
Callback called when a response is received from the server off a partial transcription
Action< WitRequest >
Callback called when a response is received from the server

Static Fields

Allows customization of the request before it is sent out.

Public Member Functions

override string
Simply return the Path to be called
delegate Dictionary< string, string >
delegate Uri
OnCustomizeUriEvent
( UriBuilder uriBuilder )
delegate void
PreSendRequestDelegate
( ref Uri src_uri,
out Dictionary< string, string > headers )
WitRequest
( WitConfiguration newConfiguration,
string newPath,
WitRequestOptions newOptions,
Initialize wit request with configuration & path to endpoint
void
Write
( byte [] data,
int offset,
int length )
Write request data to the Wit.ai post's body input stream

Object Data

override void
override void
OnInit ( )
Finalize initialization
override void
override void
override string
override void
Start the async request for data from the Wit.ai servers
override void
OnRawResponse
( string rawResponse )
Called when raw response data has been received
override void
ApplyDecodedResponseData
( WitResponseNode responseData,
bool final )
override void
override void
override void
Called when response data has been updated
override bool
override void
override void

Details

Detailed Description

Note: This is not intended to be instantiated directly. Requests should be created with the WitRequestFactory

Properties

WitConfiguration Meta.WitAi.WitRequest.Configuration
The wit Configuration to be used with this request
int Meta.WitAi.WitRequest.TimeoutMs
The request timeout in ms
AudioEncoding Meta.WitAi.WitRequest.AudioEncoding
Encoding settings for audio based requests
AudioEncoding Meta.WitAi.WitRequest.audioEncoding
No description available.
string Meta.WitAi.WitRequest.Path
Endpoint to be used for this request
string Meta.WitAi.WitRequest.Command
Final portion of the endpoint Path
bool Meta.WitAi.WitRequest.IsPost
Whether a post command should be called
VoiceServiceRequestOptions.QueryParam [] Meta.WitAi.WitRequest.queryParams
Key value pair that is sent as a query param in the Wit.ai uri
bool Meta.WitAi.WitRequest.HasResponseStarted
Returns true if the response had begun
bool Meta.WitAi.WitRequest.IsInputStreamReady
Returns true if the response had begun

Fields

byte [] Meta.WitAi.WitRequest.postData
No description available.
string Meta.WitAi.WitRequest.postContentType
No description available.
string Meta.WitAi.WitRequest.forcedHttpMethodType
No description available.
const int Meta.WitAi.WitRequest.ASYNC_DELAY
No description available.
bool Meta.WitAi.WitRequest.IsRequestStreamActive
Returns true if the request is being performed
AudioDurationTracker Meta.WitAi.WitRequest.audioDurationTracker
No description available.
Action<string> Meta.WitAi.WitRequest.onRawResponse
Returns the raw string response that was received before converting it to a JSON object.
NOTE: This response comes back on a different thread. Do not attempt ot set UI control values or other interactions from this callback. This is intended to be used for demo and test UI, not for regular use.
OnCustomizeUriEvent Meta.WitAi.WitRequest.onCustomizeUri
Provides an opportunity to customize the url just before a request executed

Object Data

override bool Meta.WitAi.WitRequest.DecodeRawResponses
No description available.

Events

OnProvideCustomHeadersEvent Meta.WitAi.WitRequest.onProvideCustomHeaders ( )
Provides an opportunity to provide custom headers for the request just before it is executed.
Action<WitRequest> Meta.WitAi.WitRequest.onInputStreamReady ( )
Callback called when the server is ready to receive data from the WitRequest's input stream. See WitRequest.Write()
Action<string> Meta.WitAi.WitRequest.onPartialTranscription ( )
Returns a partial utterance from an in process request
NOTE: This response comes back on a different thread.
Action<string> Meta.WitAi.WitRequest.onFullTranscription ( )
Returns a full utterance from a completed request
NOTE: This response comes back on a different thread.
Action<WitRequest> Meta.WitAi.WitRequest.onPartialResponse ( )
Callback called when a response is received from the server off a partial transcription
Action<WitRequest> Meta.WitAi.WitRequest.onResponse ( )
Callback called when a response is received from the server

Public Statics

PreSendRequestDelegate Meta.WitAi.WitRequest.onPreSendRequest
Allows customization of the request before it is sent out.
Note: This is for devs who are routing requests to their servers before sending data to Wit.ai. This allows adding any additional headers, url modifications, or customization of the request.

Member Functions

override string Meta.WitAi.WitRequest.ToString ( )
Simply return the Path to be called
delegate Dictionary<string, string> Meta.WitAi.WitRequest.OnProvideCustomHeadersEvent ( )
No description available.
delegate Uri Meta.WitAi.WitRequest.OnCustomizeUriEvent
( UriBuilder uriBuilder )
No description available.
delegate void Meta.WitAi.WitRequest.PreSendRequestDelegate
( ref Uri src_uri,
out Dictionary< string, string > headers )
No description available.
Meta.WitAi.WitRequest.WitRequest
( WitConfiguration newConfiguration,
string newPath,
WitRequestOptions newOptions,
Initialize wit request with configuration & path to endpoint
Parameters
newConfigurationnewOptionsnewEvents
void Meta.WitAi.WitRequest.Write
( byte [] data,
int offset,
int length )
Write request data to the Wit.ai post's body input stream
Note: If the stream is not open (IsActive) this will throw an IOException. Data will be written synchronously. This should not be called from the main thread.
Parameters
dataoffsetlength

Object Data

override void Meta.WitAi.WitRequest.SetState
( VoiceRequestState newState )
No description available.
override void Meta.WitAi.WitRequest.OnInit ( )
Finalize initialization
override void Meta.WitAi.WitRequest.HandleAudioActivation ( )
No description available.
override void Meta.WitAi.WitRequest.HandleAudioDeactivation ( )
No description available.
override string Meta.WitAi.WitRequest.GetSendError ( )
No description available.
override void Meta.WitAi.WitRequest.HandleSend ( )
Start the async request for data from the Wit.ai servers
override void Meta.WitAi.WitRequest.OnRawResponse
( string rawResponse )
Called when raw response data has been received
override void Meta.WitAi.WitRequest.ApplyDecodedResponseData
( WitResponseNode responseData,
bool final )
No description available.
override void Meta.WitAi.WitRequest.OnPartialTranscription ( )
No description available.
override void Meta.WitAi.WitRequest.OnFullTranscription ( )
No description available.
override void Meta.WitAi.WitRequest.OnPartialResponse ( )
Called when response data has been updated
override bool Meta.WitAi.WitRequest.HasSentAudio ( )
No description available.
override void Meta.WitAi.WitRequest.HandleCancel ( )
No description available.
override void Meta.WitAi.WitRequest.OnComplete ( )
No description available.
Did you find this page helpful?
Thumbs up icon
Thumbs down icon