API reference

WitIntValue Class

ScriptableObject asset that extracts integer values from Wit.ai JSON responses. Useful for counts, indices, numerical identifiers, and other integer data.
Usage example:
// Create in Unity Editor or via script
var countExtractor = ScriptableObject.CreateInstance<WitIntValue>();
countExtractor.path = "entities.number[0].value";

// Extract int value from response
var response = WitResponseNode.Parse("{\"entities\":{\"number\":[{\"value\":42}]}}");
int count = countExtractor.GetIntValue(response);

// Compare values
bool isFortyTwo = countExtractor.Equals(response, 42); // true
bool fromString = countExtractor.Equals(response, "42"); // also true (parsed)

Methods

Equals ( response , value )
Compares the integer value in the response with a target value. Supports comparing with int values or parsable strings.
Signature
override bool Meta.WitAi.Data.WitIntValue.Equals(WitResponseNode response, object value)
Parameters
response: WitResponseNode  The Wit.ai JSON response node
value: object  The value to compare (can be int or parsable string)
Returns
override bool  True if values are equal
GetIntValue ( response )
Extracts the integer value from the response at the configured path.
Signature
int Meta.WitAi.Data.WitIntValue.GetIntValue(WitResponseNode response)
Parameters
response: WitResponseNode  The Wit.ai JSON response node
Returns
int  The extracted integer value
GetValue ( response )
Extracts the integer value from the response at the configured path.
Signature
override object Meta.WitAi.Data.WitIntValue.GetValue(WitResponseNode response)
Parameters
response: WitResponseNode  The Wit.ai JSON response node
Returns
override object  The extracted integer value as an object