Class: Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb

Overview

Request message for ConversationalSearchService.AnswerQuery method.

Defined Under Namespace

Classes: AnswerGenerationSpec, QueryUnderstandingSpec, RelatedQuestionsSpec, SafetySpec, SearchSpec, UserLabelsEntry

Instance Attribute Summary collapse

Instance Attribute Details

#answer_generation_spec::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec

Returns Answer generation specification.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#asynchronous_mode::Boolean

Deprecated.

This field is deprecated and may be removed in the next major version update.

Returns Deprecated: This field is deprecated. Streaming Answer API will be supported.

Asynchronous mode control.

If enabled, the response will be returned with answer/session resource name without final answer. The API users need to do the polling to get the latest status of answer/session by calling ConversationalSearchService.GetAnswer or ConversationalSearchService.GetSession method.

Returns:

  • (::Boolean)

    Deprecated: This field is deprecated. Streaming Answer API will be supported.

    Asynchronous mode control.

    If enabled, the response will be returned with answer/session resource name without final answer. The API users need to do the polling to get the latest status of answer/session by calling ConversationalSearchService.GetAnswer or ConversationalSearchService.GetSession method.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#query::Google::Cloud::DiscoveryEngine::V1::Query

Returns Required. Current user query.

Returns:



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#query_understanding_spec::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec

Returns Query understanding specification.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

Returns Related questions specification.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#safety_spec::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec

Returns Model specification.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#search_spec::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec

Returns Search specification.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#serving_config::String

Returns Required. The resource name of the Search serving config, such as projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config, or projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config. This field is used to identify the serving configuration name, set of models used to make the search.

Returns:

  • (::String)

    Required. The resource name of the Search serving config, such as projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config, or projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config. This field is used to identify the serving configuration name, set of models used to make the search.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#session::String

Returns The session resource name. Not required.

When session field is not set, the API is in sessionless mode.

We support auto session mode: users can use the wildcard symbol - as session ID. A new ID will be automatically generated and assigned.

Returns:

  • (::String)

    The session resource name. Not required.

    When session field is not set, the API is in sessionless mode.

    We support auto session mode: users can use the wildcard symbol - as session ID. A new ID will be automatically generated and assigned.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#user_labels::Google::Protobuf::Map{::String => ::String}

Returns The user labels applied to a resource must meet the following requirements:

  • Each resource can have multiple labels, up to a maximum of 64.
  • Each label must be a key-value pair.
  • Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
  • Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
  • The key portion of a label must be unique. However, you can use the same key with multiple resources.
  • Keys must start with a lowercase letter or international character.

See Google Cloud Document for more details.

Returns:

  • (::Google::Protobuf::Map{::String => ::String})

    The user labels applied to a resource must meet the following requirements:

    • Each resource can have multiple labels, up to a maximum of 64.
    • Each label must be a key-value pair.
    • Keys have a minimum length of 1 character and a maximum length of 63 characters and cannot be empty. Values can be empty and have a maximum length of 63 characters.
    • Keys and values can contain only lowercase letters, numeric characters, underscores, and dashes. All characters must use UTF-8 encoding, and international characters are allowed.
    • The key portion of a label must be unique. However, you can use the same key with multiple resources.
    • Keys must start with a lowercase letter or international character.

    See Google Cloud Document for more details.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end

#user_pseudo_id::String

Returns A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.

This field should NOT have a fixed value such as unknown_visitor.

The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.

Returns:

  • (::String)

    A unique identifier for tracking visitors. For example, this could be implemented with an HTTP cookie, which should be able to uniquely identify a visitor on a single device. This unique identifier should not change if the visitor logs in or out of the website.

    This field should NOT have a fixed value such as unknown_visitor.

    The field must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned.



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
# File 'proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb', line 309

class AnswerQueryRequest
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # Safety specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable the safety filtering on the answer response. It is false by
  #     default.
  class SafetySpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Related questions specification.
  # @!attribute [rw] enable
  #   @return [::Boolean]
  #     Enable related questions feature if true.
  class RelatedQuestionsSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Answer generation specification.
  # @!attribute [rw] model_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::ModelSpec]
  #     Answer generation model specification.
  # @!attribute [rw] prompt_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec::PromptSpec]
  #     Answer generation prompt specification.
  # @!attribute [rw] include_citations
  #   @return [::Boolean]
  #     Specifies whether to include citation metadata in the answer. The default
  #     value is `false`.
  # @!attribute [rw] answer_language_code
  #   @return [::String]
  #     Language code for Answer. Use language tags defined by
  #     [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
  #     Note: This is an experimental feature.
  # @!attribute [rw] ignore_adversarial_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_non_answer_seeking_query
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_low_relevant_content
  #   @return [::Boolean]
  #     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.
  # @!attribute [rw] ignore_jail_breaking_query
  #   @return [::Boolean]
  #     Optional. Specifies whether to filter out jail-breaking queries. The
  #     default value is `false`.
  #
  #     Google employs search-query classification to detect jail-breaking
  #     queries. No summary is returned if the search query is classified as a
  #     jail-breaking query. A user might add instructions to the query to
  #     change the tone, style, language, content of the answer, or ask the
  #     model to act as a different entity, e.g. "Reply in the tone of a
  #     competing company's CEO". If this field is set to `true`, we skip
  #     generating summaries for jail-breaking queries and return fallback
  #     messages instead.
  class AnswerGenerationSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Answer Generation Model specification.
    # @!attribute [rw] model_version
    #   @return [::String]
    #     Model version. If not set, it will use the default stable model.
    #     Allowed values are: stable, preview.
    class ModelSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Answer generation prompt specification.
    # @!attribute [rw] preamble
    #   @return [::String]
    #     Customized preamble.
    class PromptSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # Search specification.
  # @!attribute [rw] search_params
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchParams]
  #     Search parameters.
  # @!attribute [rw] search_result_list
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList]
  #     Search result list.
  class SearchSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Search parameters.
    # @!attribute [rw] max_return_results
    #   @return [::Integer]
    #     Number of search results to return.
    #     The default value is 10.
    # @!attribute [rw] filter
    #   @return [::String]
    #     The filter syntax consists of an expression language for constructing
    #     a predicate from one or more fields of the documents being filtered.
    #     Filter expression is case-sensitive. This will be used to filter
    #     search results which may affect the Answer response.
    #
    #     If this field is unrecognizable, an  `INVALID_ARGUMENT`  is returned.
    #
    #     Filtering in Vertex AI Search is done by mapping the LHS filter key
    #     to a key property defined in the Vertex AI Search backend -- this
    #     mapping is defined by the customer in their schema. For example a
    #     media customers might have a field 'name' in their schema. In this
    #     case the filter would look like this: filter --> name:'ANY("king
    #     kong")'
    #
    #     For more information about filtering including syntax and filter
    #     operators, see
    #     [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
    # @!attribute [rw] boost_spec
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::BoostSpec]
    #     Boost specification to boost certain documents in search results which
    #     may affect the answer query response. For more information on boosting,
    #     see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
    # @!attribute [rw] order_by
    #   @return [::String]
    #     The order in which documents are returned. Documents can be ordered
    #     by a field in an {::Google::Cloud::DiscoveryEngine::V1::Document Document}
    #     object. Leave it unset if ordered by relevance. `order_by` expression
    #     is case-sensitive. For more information on ordering, see
    #     [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
    #
    #     If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
    # @!attribute [rw] search_result_mode
    #   @return [::Google::Cloud::DiscoveryEngine::V1::SearchRequest::ContentSearchSpec::SearchResultMode]
    #     Specifies the search result mode. If unspecified, the
    #     search result mode defaults to `DOCUMENTS`.
    #     See [parse and chunk
    #     documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
    # @!attribute [rw] data_store_specs
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::SearchRequest::DataStoreSpec>]
    #     Specs defining dataStores to filter on in a search call and
    #     configurations for those dataStores. This is only considered for
    #     engines with multiple dataStores use case. For single dataStore within
    #     an engine, they should use the specs at the top level.
    class SearchParams
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end

    # Search result list.
    # @!attribute [rw] search_results
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult>]
    #     Search results.
    class SearchResultList
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Search result.
      # @!attribute [rw] unstructured_document_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo]
      #     Unstructured document information.
      # @!attribute [rw] chunk_info
      #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo]
      #     Chunk information.
      class SearchResult
        include ::Google::Protobuf::MessageExts
        extend ::Google::Protobuf::MessageExts::ClassMethods

        # Unstructured document information.
        # @!attribute [rw] document
        #   @return [::String]
        #     Document resource name.
        # @!attribute [rw] uri
        #   @return [::String]
        #     URI for the document.
        # @!attribute [rw] title
        #   @return [::String]
        #     Title.
        # @!attribute [rw] document_contexts
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::DocumentContext>]
        #     List of document contexts. The content will be used for Answer
        #     Generation. This is supposed to be the main content of the document
        #     that can be long and comprehensive.
        # @!attribute [rw] extractive_segments
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveSegment>]
        #     List of extractive segments.
        # @!attribute [rw] extractive_answers
        #   @deprecated This field is deprecated and may be removed in the next major version update.
        #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::UnstructuredDocumentInfo::ExtractiveAnswer>]
        #     Deprecated: This field is deprecated and will have no effect on
        #     the Answer generation.
        #     Please use document_contexts and extractive_segments fields.
        #     List of extractive answers.
        class UnstructuredDocumentInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document context.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Document content to be used for answer generation.
          class DocumentContext
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive segment.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
          # Answer generation will only use it if document_contexts is empty.
          # This is supposed to be shorter snippets.
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive segment content.
          class ExtractiveSegment
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Extractive answer.
          # [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
          # @!attribute [rw] page_identifier
          #   @return [::String]
          #     Page identifier.
          # @!attribute [rw] content
          #   @return [::String]
          #     Extractive answer content.
          class ExtractiveAnswer
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end

        # Chunk information.
        # @!attribute [rw] chunk
        #   @return [::String]
        #     Chunk resource name.
        # @!attribute [rw] content
        #   @return [::String]
        #     Chunk textual content.
        # @!attribute [rw] document_metadata
        #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec::SearchResultList::SearchResult::ChunkInfo::DocumentMetadata]
        #     Metadata of the document from the current chunk.
        class ChunkInfo
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # Document metadata contains the information of the document of the
          # current chunk.
          # @!attribute [rw] uri
          #   @return [::String]
          #     Uri of the document.
          # @!attribute [rw] title
          #   @return [::String]
          #     Title of the document.
          class DocumentMetadata
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end

  # Query understanding specification.
  # @!attribute [rw] query_classification_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec]
  #     Query classification specification.
  # @!attribute [rw] query_rephraser_spec
  #   @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryRephraserSpec]
  #     Query rephraser specification.
  class QueryUnderstandingSpec
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods

    # Query classification specification.
    # @!attribute [rw] types
    #   @return [::Array<::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec::QueryClassificationSpec::Type>]
    #     Enabled query classification types.
    class QueryClassificationSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods

      # Query classification types.
      module Type
        # Unspecified query classification type.
        TYPE_UNSPECIFIED = 0

        # Adversarial query classification type.
        ADVERSARIAL_QUERY = 1

        # Non-answer-seeking query classification type, for chit chat.
        NON_ANSWER_SEEKING_QUERY = 2

        # Jail-breaking query classification type.
        JAIL_BREAKING_QUERY = 3

        # Non-answer-seeking query classification type, for no clear intent.
        NON_ANSWER_SEEKING_QUERY_V2 = 4
      end
    end

    # Query rephraser specification.
    # @!attribute [rw] disable
    #   @return [::Boolean]
    #     Disable query rephraser.
    # @!attribute [rw] max_rephrase_steps
    #   @return [::Integer]
    #     Max rephrase steps.
    #     The max number is 5 steps.
    #     If not set or set to < 1, it will be set to 1 by default.
    class QueryRephraserSpec
      include ::Google::Protobuf::MessageExts
      extend ::Google::Protobuf::MessageExts::ClassMethods
    end
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class UserLabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end
end