Class: Google::Apis::DiscoveryengineV1alpha::GoogleCloudDiscoveryengineV1alphaAnswerQueryRequestAnswerGenerationSpec

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

Overview

Answer generation specification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDiscoveryengineV1alphaAnswerQueryRequestAnswerGenerationSpec

Returns a new instance of GoogleCloudDiscoveryengineV1alphaAnswerQueryRequestAnswerGenerationSpec.



2817
2818
2819
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2817

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

Instance Attribute Details

#answer_language_codeString

Language code for Answer. Use language tags defined by BCP47. Note: This is an experimental feature. Corresponds to the JSON property answerLanguageCode

Returns:

  • (String)


2766
2767
2768
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2766

def answer_language_code
  @answer_language_code
end

#ignore_adversarial_queryBoolean Also known as: ignore_adversarial_query?

Specifies whether to filter out adversarial queries. The default value is false. Google employs search-query classification to detect adversarial queries. No answer is returned if the search query is classified as an adversarial query. For example, a user might ask a question regarding negative comments about the company or submit a query designed to generate unsafe, policy-violating output. If this field is set to true, we skip generating answers for adversarial queries and return fallback messages instead. Corresponds to the JSON property ignoreAdversarialQuery

Returns:

  • (Boolean)


2777
2778
2779
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2777

def ignore_adversarial_query
  @ignore_adversarial_query
end

#ignore_low_relevant_contentBoolean Also known as: ignore_low_relevant_content?

Specifies whether to filter out queries that have low relevance. If this field is set to false, all search results are used regardless of relevance to generate answers. If set to true or unset, the behavior will be determined automatically by the service. Corresponds to the JSON property ignoreLowRelevantContent

Returns:

  • (Boolean)


2786
2787
2788
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2786

def ignore_low_relevant_content
  @ignore_low_relevant_content
end

#ignore_non_answer_seeking_queryBoolean Also known as: ignore_non_answer_seeking_query?

Specifies whether to filter out queries that are not answer-seeking. The default value is false. Google employs search-query classification to detect answer-seeking queries. No answer is returned if the search query is classified as a non-answer seeking query. If this field is set to true, we skip generating answers for non-answer seeking queries and return fallback messages instead. Corresponds to the JSON property ignoreNonAnswerSeekingQuery

Returns:

  • (Boolean)


2797
2798
2799
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2797

def ignore_non_answer_seeking_query
  @ignore_non_answer_seeking_query
end

#include_citationsBoolean Also known as: include_citations?

Specifies whether to include citation metadata in the answer. The default value is false. Corresponds to the JSON property includeCitations

Returns:

  • (Boolean)


2804
2805
2806
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2804

def include_citations
  @include_citations
end

#model_specGoogle::Apis::DiscoveryengineV1alpha::GoogleCloudDiscoveryengineV1alphaAnswerQueryRequestAnswerGenerationSpecModelSpec

Answer Generation Model specification. Corresponds to the JSON property modelSpec



2810
2811
2812
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2810

def model_spec
  @model_spec
end

#prompt_specGoogle::Apis::DiscoveryengineV1alpha::GoogleCloudDiscoveryengineV1alphaAnswerQueryRequestAnswerGenerationSpecPromptSpec

Answer generation prompt specification. Corresponds to the JSON property promptSpec



2815
2816
2817
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2815

def prompt_spec
  @prompt_spec
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



2822
2823
2824
2825
2826
2827
2828
2829
2830
# File 'lib/google/apis/discoveryengine_v1alpha/classes.rb', line 2822

def update!(**args)
  @answer_language_code = args[:answer_language_code] if args.key?(:answer_language_code)
  @ignore_adversarial_query = args[:ignore_adversarial_query] if args.key?(:ignore_adversarial_query)
  @ignore_low_relevant_content = args[:ignore_low_relevant_content] if args.key?(:ignore_low_relevant_content)
  @ignore_non_answer_seeking_query = args[:ignore_non_answer_seeking_query] if args.key?(:ignore_non_answer_seeking_query)
  @include_citations = args[:include_citations] if args.key?(:include_citations)
  @model_spec = args[:model_spec] if args.key?(:model_spec)
  @prompt_spec = args[:prompt_spec] if args.key?(:prompt_spec)
end