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

WitStringValue Class

Extends WitValue
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

Member Functions

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