Service Client: Google::Cloud::Discoveryengine::V1beta::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::V1beta::CompletionService - Compiled Protocol Buffers messages for google/cloud/discoveryengine/v1beta/completion_service.proto
SYNOPSIS
use Google::Cloud::Discoveryengine::V1beta::CompletionService;
my $msg = Google::Cloud::Discoveryengine::V1beta::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::V1beta::CompletionService::CompleteQueryRequest->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/discoveryengine/v1beta/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::V1beta::CompletionService::CompleteQueryRequest
Request message for [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.CompleteQuery] method.
Inherits from Protobuf::Message.
Accessors
$msg->data_store()/$msg->data_store($value)Type:
StringRequired. 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:
StringRequired. The typeahead input used to fetch suggestions. Maximum length is 128 characters.
$msg->query_model()/$msg->query_model($value)Type:
StringSpecifies 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.v1beta.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:
StringOptional. 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.v1beta.UserEvent.user_pseudo_id] and [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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:
BoolIndicates 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::V1beta::CompletionService::CompleteQueryResponse
Response message for [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.CompleteQuery] method.
Inherits from Protobuf::Message.
Accessors
$msg->query_suggestions()/$msg->query_suggestions($value)Type:
Message(Google::Cloud::Discoveryengine::V1beta::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:
BoolTrue 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::V1beta::CompletionService::AdvancedCompleteQueryRequest
Request message for [CompletionService.AdvancedCompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.AdvancedCompleteQuery] method. .
Inherits from Protobuf::Message.
Accessors
$msg->completion_config()/$msg->completion_config($value)Type:
StringRequired. 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:
StringRequired. 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:
StringSpecifies 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.v1beta.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:
StringOptional. 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.v1beta.UserEvent.user_pseudo_id] and [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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::V1beta::Common::UserInfo)Optional. Information about the end user.
This should be the same identifier information as [UserEvent.user_info][google.cloud.discoveryengine.v1beta.UserEvent.user_info] and [SearchRequest.user_info][google.cloud.discoveryengine.v1beta.SearchRequest.user_info].
$msg->include_tail_suggestions()/$msg->include_tail_suggestions($value)Type:
BoolIndicates 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::V1beta::CompletionService::AdvancedCompleteQueryRequest::BoostSpec)Optional. Specification to boost suggestions matching the condition.
$msg->suggestion_types()/$msg->suggestion_types($value)Type:
Enum(Google::Cloud::Discoveryengine::V1beta::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::V1beta::CompletionService::AdvancedCompleteQueryRequest::SuggestionTypeSpec)Optional. Specification of each suggestion type.
$msg->experiment_ids()/$msg->experiment_ids($value)Type:
StringOptional. Experiment ids for this request.
Enum: AdvancedCompleteQueryRequest::SuggestionType
SUGGESTION_TYPE_UNSPECIFIED=>0QUERY=>1PEOPLE=>2CONTENT=>3RECENT_SEARCH=>4GOOGLE_WORKSPACE=>5
Google::Cloud::Discoveryengine::V1beta::CompletionService::AdvancedCompleteQueryResponse
Response message for [CompletionService.AdvancedCompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.AdvancedCompleteQuery] method.
Inherits from Protobuf::Message.
Accessors
$msg->query_suggestions()/$msg->query_suggestions($value)Type:
Message(Google::Cloud::Discoveryengine::V1beta::CompletionService::AdvancedCompleteQueryResponse::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:
BoolTrue 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.
$msg->people_suggestions()/$msg->people_suggestions($value)Type:
Message(Google::Cloud::Discoveryengine::V1beta::CompletionService::AdvancedCompleteQueryResponse::PersonSuggestion)Results of the matched people suggestions. The result list is ordered and the first result is the top suggestion.
$msg->content_suggestions()/$msg->content_suggestions($value)Type:
Message(Google::Cloud::Discoveryengine::V1beta::CompletionService::AdvancedCompleteQueryResponse::ContentSuggestion)Results of the matched content suggestions. The result list is ordered and the first result is the top suggestion.
$msg->recent_search_suggestions()/$msg->recent_search_suggestions($value)Type:
Message(Google::Cloud::Discoveryengine::V1beta::CompletionService::AdvancedCompleteQueryResponse::RecentSearchSuggestion)Results of the matched "recent search" suggestions. The result list is ordered and the first result is the top suggestion.
Google::Cloud::Discoveryengine::V1beta::CompletionService::RemoveSuggestionRequest
Request message for [CompletionService.RemoveSuggestion][google.cloud.discoveryengine.v1beta.CompletionService.RemoveSuggestion] method.
Inherits from Protobuf::Message.
Accessors
$msg->search_history_suggestion()/$msg->search_history_suggestion($value)Type:
StringThe search history suggestion to be removed.
$msg->remove_all_search_history_suggestions()/$msg->remove_all_search_history_suggestions($value)Type:
BoolRemove all search history suggestions for the user.
$msg->completion_config()/$msg->completion_config($value)Type:
StringRequired. The completion_config of the parent engine resource name for which the search history suggestion is to be removed, such as `projects/*/locations/global/collections/default_collection/engines/*/completionConfig`.
$msg->user_pseudo_id()/$msg->user_pseudo_id($value)Type:
StringRequired. 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.v1beta.UserEvent.user_pseudo_id] and [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.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::V1beta::Common::UserInfo)Optional. Information about the end user.
This should be the same identifier information as [UserEvent.user_info][google.cloud.discoveryengine.v1beta.UserEvent.user_info] and [SearchRequest.user_info][google.cloud.discoveryengine.v1beta.SearchRequest.user_info].
$msg->remove_time()/$msg->remove_time($value)Type:
Message(Google::Protobuf::Timestamp::Timestamp)Required. Time at which the suggestion was removed. If not set, the current time will be used.
Google::Cloud::Discoveryengine::V1beta::CompletionService::RemoveSuggestionResponse
Response message for [CompletionService.RemoveSuggestion][google.cloud.discoveryengine.v1beta.CompletionService.RemoveSuggestion] method.
Inherits from Protobuf::Message.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Discoveryengine::V1beta::CompletionService::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.