QueryResult class

Represents the result of conversational query or event processing.


QueryResult({String queryText, String languageCode, num speechRecognitionConfidence, String action, Map<String, dynamic> parameters, bool allRequiredParamsPresent, String fulfillmentText, List<Message> fulfillmentMessages, String webhookSource, Map<String, dynamic> webhookPayload, List<Context> outputContexts, Intent intent, num intentDetectionConfidence, Map<String, dynamic> diagnosticInfo})


action String
The action name from the matched intent.
allRequiredParamsPresent bool
This field is set to: - false if the matched intent has required parameters and not all of the required parameter values have been collected. - true if all required parameter values have been collected, or if the matched intent doesn't contain any required parameters.
diagnosticInfo Map<String, dynamic>
The free-form diagnostic info. For example, this field could contain webhook call latency. The string keys of the Struct's fields map can change without notice.
fulfillmentMessages List<Message>
The collection of rich messages to present to the user.
fulfillmentText String
The text to be pronounced to the user or shown on the screen. Note: This is a legacy field, fulfillmentMessages should be preferred.
hashCode int
The hash code for this object. [...]
read-only, inherited
intent Intent
The intent that matched the conversational query. Some, not all fields are filled in this message, including but not limited to: name, displayName and webhookState.
intentDetectionConfidence num
The intent detection confidence. Values range from 0.0 (completely uncertain) to 1.0 (completely certain). If there are multiple knowledgeAnswers messages, this value is set to the greatest knowledgeAnswers.match_confidence value in the list.
languageCode String
The language that was triggered during intent detection. See Language Support for a list of the currently supported language codes.
outputContexts List<Context>
The collection of output contexts. If applicable, outputContexts.parameters contains entries with name .original containing the original parameter values before the query.
parameters Map<String, dynamic>
The collection of extracted parameters.
queryText String
The original conversational query text: - If natural language text was provided as input, queryText contains a copy of the input. - If natural language speech audio was provided as input, queryText contains the speech recognition result. If speech recognizer produced multiple alternatives, a particular one is picked. - If an event was provided as input, queryText is not set.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
speechRecognitionConfidence num
The Speech recognition confidence between 0.0 and 1.0. A higher number indicates an estimated greater likelihood that the recognized words are correct. The default of 0.0 is a sentinel value indicating that confidence was not set. [...]
webhookPayload Map<String, dynamic>
If the query was fulfilled by a webhook call, this field is set to the value of the payload field returned in the webhook response.
webhookSource String
If the query was fulfilled by a webhook call, this field is set to the value of the source field returned in the webhook response.


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toJson() Map<String, dynamic>
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]

Static Methods

fromJson(Map<String, dynamic> json) QueryResult