|
| 1 | +// Copyright 2022 Google LLC |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +syntax = "proto3"; |
| 16 | + |
| 17 | +package google.cloud.discoveryengine.v1; |
| 18 | + |
| 19 | +import "google/api/annotations.proto"; |
| 20 | +import "google/api/client.proto"; |
| 21 | +import "google/api/field_behavior.proto"; |
| 22 | +import "google/api/resource.proto"; |
| 23 | + |
| 24 | +option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1"; |
| 25 | +option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb"; |
| 26 | +option java_multiple_files = true; |
| 27 | +option java_outer_classname = "CompletionServiceProto"; |
| 28 | +option java_package = "com.google.cloud.discoveryengine.v1"; |
| 29 | +option objc_class_prefix = "DISCOVERYENGINE"; |
| 30 | +option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1"; |
| 31 | +option ruby_package = "Google::Cloud::DiscoveryEngine::V1"; |
| 32 | + |
| 33 | +// Service for Auto-Completion. |
| 34 | +service CompletionService { |
| 35 | + option (google.api.default_host) = "discoveryengine.googleapis.com"; |
| 36 | + option (google.api.oauth_scopes) = |
| 37 | + "https://www.googleapis.com/auth/cloud-platform"; |
| 38 | + |
| 39 | + // Completes the specified user input with keyword suggestions. |
| 40 | + rpc CompleteQuery(CompleteQueryRequest) returns (CompleteQueryResponse) { |
| 41 | + option (google.api.http) = { |
| 42 | + get: "/v1/{data_store=projects/*/locations/*/dataStores/*}:completeQuery" |
| 43 | + additional_bindings { |
| 44 | + get: "/v1/{data_store=projects/*/locations/*/collections/*/dataStores/*}:completeQuery" |
| 45 | + } |
| 46 | + }; |
| 47 | + } |
| 48 | +} |
| 49 | + |
| 50 | +// Request message for |
| 51 | +// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery] |
| 52 | +// method. |
| 53 | +message CompleteQueryRequest { |
| 54 | + // Required. The parent data store resource name for which the completion is |
| 55 | + // performed, such as |
| 56 | + // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`. |
| 57 | + string data_store = 1 [ |
| 58 | + (google.api.field_behavior) = REQUIRED, |
| 59 | + (google.api.resource_reference) = { |
| 60 | + type: "discoveryengine.googleapis.com/DataStore" |
| 61 | + } |
| 62 | + ]; |
| 63 | + |
| 64 | + // Required. The typeahead input used to fetch suggestions. Maximum length is |
| 65 | + // 128 characters. |
| 66 | + string query = 2 [(google.api.field_behavior) = REQUIRED]; |
| 67 | + |
| 68 | + // Selects data model of query suggestions for serving. Currently supported |
| 69 | + // values: |
| 70 | + // |
| 71 | + // * `document` - Using suggestions generated from user-imported documents. |
| 72 | + // * `search-history` - Using suggestions generated from the past history of |
| 73 | + // [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search] |
| 74 | + // API calls. Do not use it when there is no traffic for Search API. |
| 75 | + // * `user-event` - Using suggestions generated from user-imported search |
| 76 | + // events. |
| 77 | + // |
| 78 | + // Default values: |
| 79 | + // |
| 80 | + // * `document` is the default model for regular dataStores. |
| 81 | + // * `search-history` is the default model for |
| 82 | + // [IndustryVertical.SITE_SEARCH][google.cloud.discoveryengine.v1.IndustryVertical.SITE_SEARCH] |
| 83 | + // dataStores. |
| 84 | + string query_model = 3; |
| 85 | + |
| 86 | + // A unique identifier for tracking visitors. For example, this could be |
| 87 | + // implemented with an HTTP cookie, which should be able to uniquely identify |
| 88 | + // a visitor on a single device. This unique identifier should not change if |
| 89 | + // the visitor logs in or out of the website. |
| 90 | + // |
| 91 | + // This field should NOT have a fixed value such as `unknown_visitor`. |
| 92 | + // |
| 93 | + // This should be the same identifier as |
| 94 | + // [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id] |
| 95 | + // and |
| 96 | + // [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1.SearchRequest.user_pseudo_id]. |
| 97 | + // |
| 98 | + // The field must be a UTF-8 encoded string with a length limit of 128 |
| 99 | + // characters. Otherwise, an `INVALID_ARGUMENT` error is returned. |
| 100 | + string user_pseudo_id = 4; |
| 101 | +} |
| 102 | + |
| 103 | +// Response message for |
| 104 | +// [CompletionService.CompleteQuery][google.cloud.discoveryengine.v1.CompletionService.CompleteQuery] |
| 105 | +// method. |
| 106 | +message CompleteQueryResponse { |
| 107 | + // Suggestions as search queries. |
| 108 | + message QuerySuggestion { |
| 109 | + // The suggestion for the query. |
| 110 | + string suggestion = 1; |
| 111 | + } |
| 112 | + |
| 113 | + // Results of the matched query suggestions. The result list is ordered and |
| 114 | + // the first result is a top suggestion. |
| 115 | + repeated QuerySuggestion query_suggestions = 1; |
| 116 | +} |
0 commit comments