Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2QueryResult

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
generated/google/apis/dialogflow_v2/classes.rb,
generated/google/apis/dialogflow_v2/representations.rb,
generated/google/apis/dialogflow_v2/representations.rb

Overview

Represents the result of conversational query or event processing.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Core::JsonObjectSupport

#to_json

Methods included from Core::Hashable

process_value, #to_h

Constructor Details

#initialize(**args) ⇒ GoogleCloudDialogflowV2QueryResult

Returns a new instance of GoogleCloudDialogflowV2QueryResult



2378
2379
2380
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2378

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#actionString

The action name from the matched intent. Corresponds to the JSON property action

Returns:

  • (String)


2266
2267
2268
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2266

def action
  @action
end

#all_required_params_presentBoolean Also known as: all_required_params_present?

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. Corresponds to the JSON property allRequiredParamsPresent

Returns:

  • (Boolean)


2275
2276
2277
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2275

def all_required_params_present
  @all_required_params_present
end

#diagnostic_infoHash<String,Object>

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. Corresponds to the JSON property diagnosticInfo

Returns:

  • (Hash<String,Object>)


2283
2284
2285
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2283

def diagnostic_info
  @diagnostic_info
end

#fulfillment_messagesArray<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2IntentMessage>

The collection of rich messages to present to the user. Corresponds to the JSON property fulfillmentMessages



2288
2289
2290
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2288

def fulfillment_messages
  @fulfillment_messages
end

#fulfillment_textString

The text to be pronounced to the user or shown on the screen. Note: This is a legacy field, fulfillment_messages should be preferred. Corresponds to the JSON property fulfillmentText

Returns:

  • (String)


2294
2295
2296
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2294

def fulfillment_text
  @fulfillment_text
end

#intentGoogle::Apis::DialogflowV2::GoogleCloudDialogflowV2Intent

Represents an intent. Intents convert a number of user expressions or patterns into an action. An action is an extraction of a user command or sentence semantics. Corresponds to the JSON property intent



2301
2302
2303
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2301

def intent
  @intent
end

#intent_detection_confidenceFloat

The intent detection confidence. Values range from 0.0 (completely uncertain) to 1.0 (completely certain). This value is for informational purpose only and is only used to help match the best intent within the classification threshold. This value may change for the same end-user expression at any time due to a model retraining or change in implementation. If there are multiple knowledge_answers messages, this value is set to the greatest knowledgeAnswers.match_confidence value in the list. Corresponds to the JSON property intentDetectionConfidence

Returns:

  • (Float)


2313
2314
2315
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2313

def intent_detection_confidence
  @intent_detection_confidence
end

#language_codeString

The language that was triggered during intent detection. See Language Support for a list of the currently supported language codes. Corresponds to the JSON property languageCode

Returns:

  • (String)


2321
2322
2323
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2321

def language_code
  @language_code
end

#output_contextsArray<Google::Apis::DialogflowV2::GoogleCloudDialogflowV2Context>

The collection of output contexts. If applicable, output_contexts.parameters contains entries with name <parameter name>.original containing the original parameter values before the query. Corresponds to the JSON property outputContexts



2329
2330
2331
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2329

def output_contexts
  @output_contexts
end

#parametersHash<String,Object>

The collection of extracted parameters. Corresponds to the JSON property parameters

Returns:

  • (Hash<String,Object>)


2334
2335
2336
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2334

def parameters
  @parameters
end

#query_textString

The original conversational query text:

  • If natural language text was provided as input, query_text contains a copy of the input.
  • If natural language speech audio was provided as input, query_text contains the speech recognition result. If speech recognizer produced multiple alternatives, a particular one is picked.
  • If automatic spell correction is enabled, query_text will contain the corrected user input. Corresponds to the JSON property queryText

Returns:

  • (String)


2346
2347
2348
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2346

def query_text
  @query_text
end

#sentiment_analysis_resultGoogle::Apis::DialogflowV2::GoogleCloudDialogflowV2SentimentAnalysisResult

The result of sentiment analysis as configured by sentiment_analysis_request_config. Corresponds to the JSON property sentimentAnalysisResult



2352
2353
2354
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2352

def sentiment_analysis_result
  @sentiment_analysis_result
end

#speech_recognition_confidenceFloat

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. This field is not guaranteed to be accurate or set. In particular this field isn't set for StreamingDetectIntent since the streaming endpoint has separate confidence estimates per portion of the audio in StreamingRecognitionResult. Corresponds to the JSON property speechRecognitionConfidence

Returns:

  • (Float)


2364
2365
2366
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2364

def speech_recognition_confidence
  @speech_recognition_confidence
end

#webhook_payloadHash<String,Object>

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. Corresponds to the JSON property webhookPayload

Returns:

  • (Hash<String,Object>)


2370
2371
2372
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2370

def webhook_payload
  @webhook_payload
end

#webhook_sourceString

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. Corresponds to the JSON property webhookSource

Returns:

  • (String)


2376
2377
2378
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2376

def webhook_source
  @webhook_source
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 2383

def update!(**args)
  @action = args[:action] if args.key?(:action)
  @all_required_params_present = args[:all_required_params_present] if args.key?(:all_required_params_present)
  @diagnostic_info = args[:diagnostic_info] if args.key?(:diagnostic_info)
  @fulfillment_messages = args[:fulfillment_messages] if args.key?(:fulfillment_messages)
  @fulfillment_text = args[:fulfillment_text] if args.key?(:fulfillment_text)
  @intent = args[:intent] if args.key?(:intent)
  @intent_detection_confidence = args[:intent_detection_confidence] if args.key?(:intent_detection_confidence)
  @language_code = args[:language_code] if args.key?(:language_code)
  @output_contexts = args[:output_contexts] if args.key?(:output_contexts)
  @parameters = args[:parameters] if args.key?(:parameters)
  @query_text = args[:query_text] if args.key?(:query_text)
  @sentiment_analysis_result = args[:sentiment_analysis_result] if args.key?(:sentiment_analysis_result)
  @speech_recognition_confidence = args[:speech_recognition_confidence] if args.key?(:speech_recognition_confidence)
  @webhook_payload = args[:webhook_payload] if args.key?(:webhook_payload)
  @webhook_source = args[:webhook_source] if args.key?(:webhook_source)
end