API reference

WitStringValue Class

ScriptableObject asset that extracts string values from Wit.ai JSON responses. Useful for intent names, entity values, text transcriptions, and other string data.
Usage example:
// Create in Unity Editor or via script
var intentExtractor = ScriptableObject.CreateInstance<WitStringValue>();
intentExtractor.path = "intents[0].name";

// Extract string value from response
var response = WitResponseNode.Parse("{\"intents\":[{\"name\":\"play_music\"}]}");
string intentName = intentExtractor.GetStringValue(response);

// Compare values (case-sensitive)
bool isPlayMusic = intentExtractor.Equals(response, "play_music"); // true
bool fromInt = intentExtractor.Equals(response, 42); // converts to "42" for comparison

Methods

Equals ( response , value )
Compares the string value in the response with a target value. Performs case-sensitive string comparison. Non-string values are converted to strings.
Signature
override bool Meta.WitAi.Data.WitStringValue.Equals(WitResponseNode response, object value)
Parameters
response: WitResponseNode  The Wit.ai JSON response node
value: object  The value to compare (strings compared directly, other types converted)
Returns
override bool  True if values are equal (case-sensitive)
GetStringValue ( response )
Extracts the string value from the response at the configured path.
Signature
string Meta.WitAi.Data.WitStringValue.GetStringValue(WitResponseNode response)
Parameters
response: WitResponseNode  The Wit.ai JSON response node
Returns
string  The extracted string value
GetValue ( response )
Extracts the string value from the response at the configured path.
Signature
override object Meta.WitAi.Data.WitStringValue.GetValue(WitResponseNode response)
Parameters
response: WitResponseNode  The Wit.ai JSON response node
Returns
override object  The extracted string value as an object