Service Client: Google::Cloud::Discoveryengine::V1::CompletionService::CompletionServiceClient

Client stub representing the remote CompletionService gRPC service. Delegates call dispatching to Google::gRPC::Client.

target

The endpoint target address. Defaults to discoveryengine.googleapis.com:443.

credentials

The authentication credentials provider. Defaults to application default credentials via Google::Auth.

NAME

Google::Cloud::Discoveryengine::V1::CompletionService - Compiled Protocol Buffers messages for google/cloud/discoveryengine/v1/completion_service.proto

SYNOPSIS

use Google::Cloud::Discoveryengine::V1::CompletionService;

my $msg = Google::Cloud::Discoveryengine::V1::CompletionService::CompleteQueryRequest->new({
    data_store => $data_store,
    query => $query,
    query_model => $query_model,
    user_pseudo_id => $user_pseudo_id,
});

# Read or update a field
my $val = $msg->data_store();

# Binary wire-format roundtrip
my $bytes   = $msg->serialize();
my $decoded = Google::Cloud::Discoveryengine::V1::CompletionService::CompleteQueryRequest->parse($bytes);

# Canonical ProtoJSON
my $json = $msg->to_json();

DESCRIPTION

Auto-generated Protobuf message classes compiled from google/cloud/discoveryengine/v1/completion_service.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().

MESSAGES

Google::Cloud::Discoveryengine::V1::CompletionService::CompleteQueryRequest

Request message for [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery] method.

Inherits from Protobuf::Message.

Accessors

  • $msg->data_store() / $msg->data_store($value)

    Type: String

    Required. The parent data store resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.

  • $msg->query() / $msg->query($value)

    Type: String

    Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.

  • $msg->query_model() / $msg->query_model($value)

    Type: String

    Specifies the autocomplete data model. This overrides any model specified in the Configuration > Autocomplete section of the Cloud console. Currently supported values:

    * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable.

    Default values:

    * `document` is the default model for regular dataStores. * `search-history` is the default model for site search dataStores.

  • $msg->user_pseudo_id() / $msg->user_pseudo_id($value)

    Type: String

    Optional. 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`.

    This should be the same identifier as [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id] and [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1.SearchRequest.user_pseudo_id].

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

  • $msg->include_tail_suggestions() / $msg->include_tail_suggestions($value)

    Type: Bool

    Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.

Google::Cloud::Discoveryengine::V1::CompletionService::CompleteQueryResponse

Response message for [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery] method.

Inherits from Protobuf::Message.

Accessors

  • $msg->query_suggestions() / $msg->query_suggestions($value)

    Type: Message (Google::Cloud::Discoveryengine::V1::CompletionService::CompleteQueryResponse::QuerySuggestion)

    Results of the matched query suggestions. The result list is ordered and the first result is a top suggestion.

  • $msg->tail_match_triggered() / $msg->tail_match_triggered($value)

    Type: Bool

    True if the returned suggestions are all tail suggestions.

    For tail matching to be triggered, include_tail_suggestions in the request must be true and there must be no suggestions that match the full query.

Google::Cloud::Discoveryengine::V1::CompletionService::AdvancedCompleteQueryRequest

Request message for [CompletionService.AdvancedCompleteQuery][google.cloud.discoveryengine.v1.CompletionService.AdvancedCompleteQuery] method. .

Inherits from Protobuf::Message.

Accessors

  • $msg->completion_config() / $msg->completion_config($value)

    Type: String

    Required. The completion_config of the parent dataStore or engine resource name for which the completion is performed, such as `projects/*/locations/global/collections/default_collection/dataStores/*/completionConfig` `projects/*/locations/global/collections/default_collection/engines/*/completionConfig`.

  • $msg->query() / $msg->query($value)

    Type: String

    Required. The typeahead input used to fetch suggestions. Maximum length is 128 characters.

    The query can not be empty for most of the suggestion types. If it is empty, an `INVALID_ARGUMENT` error is returned. The exception is when the suggestion_types contains only the type `RECENT_SEARCH`, the query can be an empty string. The is called "zero prefix" feature, which returns user's recently searched queries given the empty query.

  • $msg->query_model() / $msg->query_model($value)

    Type: String

    Specifies the autocomplete query model, which only applies to the QUERY SuggestionType. This overrides any model specified in the Configuration > Autocomplete section of the Cloud console. Currently supported values:

    * `document` - Using suggestions generated from user-imported documents. * `search-history` - Using suggestions generated from the past history of [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] API calls. Do not use it when there is no traffic for Search API. * `user-event` - Using suggestions generated from user-imported search events. * `document-completable` - Using suggestions taken directly from user-imported document fields marked as completable.

    Default values:

    * `document` is the default model for regular dataStores. * `search-history` is the default model for site search dataStores.

  • $msg->user_pseudo_id() / $msg->user_pseudo_id($value)

    Type: String

    Optional. 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`.

    This should be the same identifier as [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id] and [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1.SearchRequest.user_pseudo_id].

    The field must be a UTF-8 encoded string with a length limit of 128

  • $msg->user_info() / $msg->user_info($value)

    Type: Message (Google::Cloud::Discoveryengine::V1::Common::UserInfo)

    Optional. Information about the end user.

    This should be the same identifier information as [UserEvent.user_info][google.cloud.discoveryengine.v1.UserEvent.user_info] and [SearchRequest.user_info][google.cloud.discoveryengine.v1.SearchRequest.user_info].

  • $msg->include_tail_suggestions() / $msg->include_tail_suggestions($value)

    Type: Bool

    Indicates if tail suggestions should be returned if there are no suggestions that match the full query. Even if set to true, if there are suggestions that match the full query, those are returned and no tail suggestions are returned.

  • $msg->boost_spec() / $msg->boost_spec($value)

    Type: Message (Google::Cloud::Discoveryengine::V1::CompletionService::AdvancedCompleteQueryRequest::BoostSpec)

    Optional. Specification to boost suggestions matching the condition.

  • $msg->suggestion_types() / $msg->suggestion_types($value)

    Type: Enum (Google::Cloud::Discoveryengine::V1::AdvancedCompleteQueryRequest::SuggestionType)

    Optional. Suggestion types to return. If empty or unspecified, query suggestions are returned. Only one suggestion type is supported at the moment.

  • $msg->suggestion_type_specs() / $msg->suggestion_type_specs($value)

    Type: Message (Google::Cloud::Discoveryengine::V1::CompletionService::AdvancedCompleteQueryRequest::SuggestionTypeSpec)

    Optional. Specification of each suggestion type.

  • $msg->experiment_ids() / $msg->experiment_ids($value)

    Type: String

    Optional. Experiment ids for this request.

Enum: AdvancedCompleteQueryRequest::SuggestionType

  • SUGGESTION_TYPE_UNSPECIFIED => 0

  • QUERY => 1

  • PEOPLE => 2

  • CONTENT => 3

  • RECENT_SEARCH => 4

  • GOOGLE_WORKSPACE => 5

Google::Cloud::Discoveryengine::V1::CompletionService::AdvancedCompleteQueryResponse

Response message for [CompletionService.AdvancedCompleteQuery][google.cloud.discoveryengine.v1.CompletionService.AdvancedCompleteQuery] method.

Inherits from Protobuf::Message.

Accessors

SEE ALSO

Protobuf, Protobuf::Message, Google::Cloud::Discoveryengine::V1::CompletionService::Types, https://protobuf.dev/

LICENSE AND COPYRIGHT

Copyright (C) 2026 Google LLC

This program is released under the Apache 2.0 license.