Class: Google::Apis::DialogflowV2::GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer

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

An answer from Knowledge Connector.

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) ⇒ GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer

Returns a new instance of GoogleCloudDialogflowV2beta1KnowledgeAnswersAnswer



3756
3757
3758
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3756

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

Instance Attribute Details

#answerString

The piece of text from the source knowledge base document that answers this conversational query. Corresponds to the JSON property answer

Returns:

  • (String)


3719
3720
3721
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3719

def answer
  @answer
end

#faq_questionString

The corresponding FAQ question if the answer was extracted from a FAQ Document, empty otherwise. Corresponds to the JSON property faqQuestion

Returns:

  • (String)


3725
3726
3727
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3725

def faq_question
  @faq_question
end

#match_confidenceFloat

The system's confidence score that this Knowledge answer is a good match for this converstational query, range from 0.0 (completely uncertain) to 1.0 (completely certain). Note: The confidence score is likely to vary somewhat (possibly even for identical requests), as the underlying model is under constant improvement, we may deprecate it in the future. We recommend using match_confidence_level which should be generally more stable. Corresponds to the JSON property matchConfidence

Returns:

  • (Float)


3736
3737
3738
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3736

def match_confidence
  @match_confidence
end

#match_confidence_levelString

The system's confidence level that this knowledge answer is a good match for this conversational query. NOTE: The confidence level for a given <query, answer> pair may change without notice, as it depends on models that are constantly being improved. However, it will change less frequently than the confidence score below, and should be preferred for referencing the quality of an answer. Corresponds to the JSON property matchConfidenceLevel

Returns:

  • (String)


3747
3748
3749
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3747

def match_confidence_level
  @match_confidence_level
end

#sourceString

Indicates which Knowledge Document this answer was extracted from. Format: projects/<Project ID>/knowledgeBases/<Knowledge Base ID>/documents/<Document ID>. Corresponds to the JSON property source

Returns:

  • (String)


3754
3755
3756
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3754

def source
  @source
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



3761
3762
3763
3764
3765
3766
3767
# File 'generated/google/apis/dialogflow_v2/classes.rb', line 3761

def update!(**args)
  @answer = args[:answer] if args.key?(:answer)
  @faq_question = args[:faq_question] if args.key?(:faq_question)
  @match_confidence = args[:match_confidence] if args.key?(:match_confidence)
  @match_confidence_level = args[:match_confidence_level] if args.key?(:match_confidence_level)
  @source = args[:source] if args.key?(:source)
end