QueryResult class

Represents the result of conversational query or event processing.

Constructors

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})

Properties

action String
The action name from the matched intent.
final
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.
final
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.
final
fulfillmentMessages List<Message>
The collection of rich messages to present to the user.
final
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.
final
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.
final
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.
final
languageCode String
The language that was triggered during intent detection. See Language Support for a list of the currently supported language codes.
final
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.
final
parameters Map<String, dynamic>
The collection of extracted parameters.
final
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.
final
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. [...]
final
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.
final
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.
final

Methods

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

Operators

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

Static Methods

fromJson(Map<String, dynamic> json) QueryResult