// 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 comparisonEquals
(
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 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 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 Returns override object
The extracted string value as an object
|