Class: Google::Apis::DiscoveryengineV1::GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpec

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

Overview

Answer generation specification.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpec

Returns a new instance of GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpec.



541
542
543
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 541

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)


499
500
501
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 499

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)


510
511
512
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 510

def ignore_adversarial_query
  @ignore_adversarial_query
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)


521
522
523
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 521

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)


528
529
530
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 528

def include_citations
  @include_citations
end

#model_specGoogle::Apis::DiscoveryengineV1::GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpecModelSpec

Answer Generation Model specification. Corresponds to the JSON property modelSpec



534
535
536
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 534

def model_spec
  @model_spec
end

#prompt_specGoogle::Apis::DiscoveryengineV1::GoogleCloudDiscoveryengineV1AnswerQueryRequestAnswerGenerationSpecPromptSpec

Answer generation prompt specification. Corresponds to the JSON property promptSpec



539
540
541
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 539

def prompt_spec
  @prompt_spec
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



546
547
548
549
550
551
552
553
# File 'lib/google/apis/discoveryengine_v1/classes.rb', line 546

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_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