// Create a float value extractor in the Unity Editor
var confidenceValue = ScriptableObject.CreateInstance<WitFloatValue>();
confidenceValue.path = "intents[0].confidence";
// Use it to extract values from responses
var response = WitResponseNode.Parse("{\"intents\":[{\"confidence\":0.95}]}");
float confidence = (float)confidenceValue.GetValue(response);
bool isHighConfidence = confidenceValue.Equals(response, 0.9f);path
: string |
JSON path to the value in the Wit.ai response (e.g., "intents[0].name", "entities.location[0].value").
Signature
string Meta.WitAi.Data.WitValue.path |
Reference
: WitResponseReference
[Get] |
Gets the response reference object used to navigate the JSON path. Lazily initialized on first access and cached for subsequent calls.
Signature
WitResponseReference Meta.WitAi.Data.WitValue.Reference |
Equals
(
response
, value
)
|
Compares the value at the configured path in the response with a target value.
Signature
abstract bool Meta.WitAi.Data.WitValue.Equals(WitResponseNode response, object value) Parameters value: object
The value to compare against
Returns abstract bool
True if the values match according to the subclass's equality logic
|
GetValue
(
response
)
|
Extracts the typed value from the Wit.ai response at the configured path.
Signature
abstract object Meta.WitAi.Data.WitValue.GetValue(WitResponseNode response) Parameters Returns abstract object
The extracted value as an object (actual type depends on subclass)
|
ToString
(
response
)
|
Gets the string representation of the value at the configured path.
Signature
string Meta.WitAi.Data.WitValue.ToString(WitResponseNode response) Parameters Returns string
String representation of the value
|