@google-cloud/discoveryengine 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +38 -22
- package/build/protos/google/cloud/discoveryengine/v1/common.proto +100 -0
- package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +116 -0
- package/build/protos/google/cloud/discoveryengine/v1/document.proto +118 -0
- package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +313 -0
- package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +334 -0
- package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +86 -0
- package/build/protos/google/cloud/discoveryengine/v1/schema.proto +58 -0
- package/build/protos/google/cloud/discoveryengine/v1/schema_service.proto +256 -0
- package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +289 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +458 -0
- package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +133 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +54 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +29 -4
- package/build/protos/protos.d.ts +6589 -0
- package/build/protos/protos.js +16050 -1
- package/build/protos/protos.json +1807 -0
- package/build/src/index.d.ts +18 -19
- package/build/src/index.js +9 -9
- package/build/src/v1/completion_service_client.d.ts +455 -0
- package/build/src/v1/completion_service_client.js +659 -0
- package/build/src/v1/completion_service_client_config.json +43 -0
- package/build/src/v1/document_service_client.d.ts +995 -0
- package/build/src/v1/document_service_client.js +1191 -0
- package/build/src/v1/document_service_client_config.json +82 -0
- package/build/src/v1/index.d.ts +5 -0
- package/build/src/v1/index.js +31 -0
- package/build/src/v1/schema_service_client.d.ts +795 -0
- package/build/src/v1/schema_service_client.js +1129 -0
- package/build/src/v1/schema_service_client_config.json +63 -0
- package/build/src/v1/search_service_client.d.ts +857 -0
- package/build/src/v1/search_service_client.js +1073 -0
- package/build/src/v1/search_service_client_config.json +43 -0
- package/build/src/v1/user_event_service_client.d.ts +638 -0
- package/build/src/v1/user_event_service_client.js +933 -0
- package/build/src/v1/user_event_service_client_config.json +62 -0
- package/build/src/v1beta/document_service_client.d.ts +52 -0
- package/build/src/v1beta/document_service_client.js +6 -0
- package/build/src/v1beta/schema_service_client.js +6 -0
- package/build/src/v1beta/search_service_client.d.ts +78 -12
- package/build/src/v1beta/search_service_client.js +52 -8
- package/build/src/v1beta/user_event_service_client.js +6 -0
- package/package.json +2 -2
@@ -0,0 +1,289 @@
|
|
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
|
+
import "google/cloud/discoveryengine/v1/common.proto";
|
24
|
+
import "google/cloud/discoveryengine/v1/document.proto";
|
25
|
+
import "google/protobuf/struct.proto";
|
26
|
+
|
27
|
+
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
|
28
|
+
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
|
29
|
+
option java_multiple_files = true;
|
30
|
+
option java_outer_classname = "SearchServiceProto";
|
31
|
+
option java_package = "com.google.cloud.discoveryengine.v1";
|
32
|
+
option objc_class_prefix = "DISCOVERYENGINE";
|
33
|
+
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
|
34
|
+
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";
|
35
|
+
|
36
|
+
// Service for search.
|
37
|
+
service SearchService {
|
38
|
+
option (google.api.default_host) = "discoveryengine.googleapis.com";
|
39
|
+
option (google.api.oauth_scopes) =
|
40
|
+
"https://www.googleapis.com/auth/cloud-platform";
|
41
|
+
|
42
|
+
// Performs a search.
|
43
|
+
rpc Search(SearchRequest) returns (SearchResponse) {
|
44
|
+
option (google.api.http) = {
|
45
|
+
post: "/v1/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:search"
|
46
|
+
body: "*"
|
47
|
+
additional_bindings {
|
48
|
+
post: "/v1/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search"
|
49
|
+
body: "*"
|
50
|
+
}
|
51
|
+
};
|
52
|
+
}
|
53
|
+
}
|
54
|
+
|
55
|
+
// Request message for
|
56
|
+
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
|
57
|
+
// method.
|
58
|
+
message SearchRequest {
|
59
|
+
// Specification to determine under which conditions query expansion should
|
60
|
+
// occur.
|
61
|
+
message QueryExpansionSpec {
|
62
|
+
// Enum describing under which condition query expansion should occur.
|
63
|
+
enum Condition {
|
64
|
+
// Unspecified query expansion condition. In this case, server behavior
|
65
|
+
// defaults to
|
66
|
+
// [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
|
67
|
+
CONDITION_UNSPECIFIED = 0;
|
68
|
+
|
69
|
+
// Disabled query expansion. Only the exact search query is used, even if
|
70
|
+
// [SearchResponse.total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
|
71
|
+
// is zero.
|
72
|
+
DISABLED = 1;
|
73
|
+
|
74
|
+
// Automatic query expansion built by the Search API.
|
75
|
+
AUTO = 2;
|
76
|
+
}
|
77
|
+
|
78
|
+
// The condition under which query expansion should occur. Default to
|
79
|
+
// [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
|
80
|
+
Condition condition = 1;
|
81
|
+
}
|
82
|
+
|
83
|
+
// The specification for query spell correction.
|
84
|
+
message SpellCorrectionSpec {
|
85
|
+
// Enum describing under which mode spell correction should occur.
|
86
|
+
enum Mode {
|
87
|
+
// Unspecified spell correction mode. In this case, server behavior
|
88
|
+
// defaults to
|
89
|
+
// [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
|
90
|
+
MODE_UNSPECIFIED = 0;
|
91
|
+
|
92
|
+
// Search API will try to find a spell suggestion if there
|
93
|
+
// is any and put in the
|
94
|
+
// [SearchResponse.corrected_query][google.cloud.discoveryengine.v1.SearchResponse.corrected_query].
|
95
|
+
// The spell suggestion will not be used as the search query.
|
96
|
+
SUGGESTION_ONLY = 1;
|
97
|
+
|
98
|
+
// Automatic spell correction built by the Search API. Search will
|
99
|
+
// be based on the corrected query if found.
|
100
|
+
AUTO = 2;
|
101
|
+
}
|
102
|
+
|
103
|
+
// The mode under which spell correction should take effect to
|
104
|
+
// replace the original search query. Default to
|
105
|
+
// [Mode.AUTO][google.cloud.discoveryengine.v1.SearchRequest.SpellCorrectionSpec.Mode.AUTO].
|
106
|
+
Mode mode = 1;
|
107
|
+
}
|
108
|
+
|
109
|
+
// The specification that configs the desired behavior of the UCS content
|
110
|
+
// search.
|
111
|
+
message ContentSearchSpec {
|
112
|
+
// The specification that configs the snippet in the search results.
|
113
|
+
message SnippetSpec {
|
114
|
+
// Max number of snippets returned in each search result.
|
115
|
+
// If the matching snippets is less than the max_snippet_count, return all
|
116
|
+
// of the snippets; otherwise, return the max_snippet_count.
|
117
|
+
//
|
118
|
+
// At most 5 snippets will be returned for each SearchResult.
|
119
|
+
int32 max_snippet_count = 1;
|
120
|
+
|
121
|
+
// if true, only snippet reference is returned.
|
122
|
+
bool reference_only = 2;
|
123
|
+
}
|
124
|
+
|
125
|
+
// If there is no snippet spec provided, there will be no snippet in the
|
126
|
+
// search result.
|
127
|
+
SnippetSpec snippet_spec = 1;
|
128
|
+
}
|
129
|
+
|
130
|
+
// Required. The resource name of the Search serving config, such as
|
131
|
+
// `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
|
132
|
+
// This field is used to identify the serving configuration name, set
|
133
|
+
// of models used to make the search.
|
134
|
+
string serving_config = 1 [
|
135
|
+
(google.api.field_behavior) = REQUIRED,
|
136
|
+
(google.api.resource_reference) = {
|
137
|
+
type: "discoveryengine.googleapis.com/ServingConfig"
|
138
|
+
}
|
139
|
+
];
|
140
|
+
|
141
|
+
// The branch resource name, such as
|
142
|
+
// `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/branches/0`.
|
143
|
+
//
|
144
|
+
// Use `default_branch` as the branch ID or leave this field empty, to search
|
145
|
+
// documents under the default branch.
|
146
|
+
string branch = 2 [(google.api.resource_reference) = {
|
147
|
+
type: "discoveryengine.googleapis.com/Branch"
|
148
|
+
}];
|
149
|
+
|
150
|
+
// Raw search query.
|
151
|
+
string query = 3;
|
152
|
+
|
153
|
+
// Maximum number of [Document][google.cloud.discoveryengine.v1.Document]s to
|
154
|
+
// return. If unspecified, defaults to a reasonable value. The maximum allowed
|
155
|
+
// value is 100. Values above 100 will be coerced to 100.
|
156
|
+
//
|
157
|
+
// If this field is negative, an `INVALID_ARGUMENT` is returned.
|
158
|
+
int32 page_size = 4;
|
159
|
+
|
160
|
+
// A page token received from a previous
|
161
|
+
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
|
162
|
+
// call. Provide this to retrieve the subsequent page.
|
163
|
+
//
|
164
|
+
// When paginating, all other parameters provided to
|
165
|
+
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
|
166
|
+
// must match the call that provided the page token. Otherwise, an
|
167
|
+
// `INVALID_ARGUMENT` error is returned.
|
168
|
+
string page_token = 5;
|
169
|
+
|
170
|
+
// A 0-indexed integer that specifies the current offset (that is, starting
|
171
|
+
// result location, amongst the
|
172
|
+
// [Document][google.cloud.discoveryengine.v1.Document]s deemed by the API as
|
173
|
+
// relevant) in search results. This field is only considered if
|
174
|
+
// [page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token] is
|
175
|
+
// unset.
|
176
|
+
//
|
177
|
+
// If this field is negative, an `INVALID_ARGUMENT` is returned.
|
178
|
+
int32 offset = 6;
|
179
|
+
|
180
|
+
// Information about the end user.
|
181
|
+
// Highly recommended for analytics. The user_agent string in UserInfo will
|
182
|
+
// be used to deduce device_type for analytics.
|
183
|
+
UserInfo user_info = 21;
|
184
|
+
|
185
|
+
// Additional search parameters.
|
186
|
+
//
|
187
|
+
// For public website search only, supported values are:
|
188
|
+
//
|
189
|
+
// * `user_country_code`: string. Default empty. If set to non-empty, results
|
190
|
+
// are restricted or boosted based on the location provided.
|
191
|
+
// * `search_type`: double. Default empty. Enables non-webpage searching
|
192
|
+
// depending on the value. The only valid non-default value is 1,
|
193
|
+
// which enables image searching.
|
194
|
+
map<string, google.protobuf.Value> params = 11;
|
195
|
+
|
196
|
+
// The query expansion specification that specifies the conditions under which
|
197
|
+
// query expansion will occur.
|
198
|
+
QueryExpansionSpec query_expansion_spec = 13;
|
199
|
+
|
200
|
+
// The spell correction specification that specifies the mode under
|
201
|
+
// which spell correction will take effect.
|
202
|
+
SpellCorrectionSpec spell_correction_spec = 14;
|
203
|
+
|
204
|
+
// A unique identifier for tracking visitors. For example, this could be
|
205
|
+
// implemented with an HTTP cookie, which should be able to uniquely identify
|
206
|
+
// a visitor on a single device. This unique identifier should not change if
|
207
|
+
// the visitor logs in or out of the website.
|
208
|
+
//
|
209
|
+
// This field should NOT have a fixed value such as `unknown_visitor`.
|
210
|
+
//
|
211
|
+
// This should be the same identifier as
|
212
|
+
// [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1.UserEvent.user_pseudo_id]
|
213
|
+
// and
|
214
|
+
// [CompleteQueryRequest.user_pseudo_id][google.cloud.discoveryengine.v1.CompleteQueryRequest.user_pseudo_id]
|
215
|
+
//
|
216
|
+
// The field must be a UTF-8 encoded string with a length limit of 128
|
217
|
+
// characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
218
|
+
string user_pseudo_id = 15;
|
219
|
+
|
220
|
+
// The content search spec that configs the desired behavior of content
|
221
|
+
// search.
|
222
|
+
ContentSearchSpec content_search_spec = 24;
|
223
|
+
|
224
|
+
// Whether to turn on safe search. This is only supported for
|
225
|
+
// [ContentConfig.PUBLIC_WEBSITE][].
|
226
|
+
bool safe_search = 20;
|
227
|
+
|
228
|
+
// The user labels applied to a resource must meet the following requirements:
|
229
|
+
//
|
230
|
+
// * Each resource can have multiple labels, up to a maximum of 64.
|
231
|
+
// * Each label must be a key-value pair.
|
232
|
+
// * Keys have a minimum length of 1 character and a maximum length of 63
|
233
|
+
// characters and cannot be empty. Values can be empty and have a maximum
|
234
|
+
// length of 63 characters.
|
235
|
+
// * Keys and values can contain only lowercase letters, numeric characters,
|
236
|
+
// underscores, and dashes. All characters must use UTF-8 encoding, and
|
237
|
+
// international characters are allowed.
|
238
|
+
// * The key portion of a label must be unique. However, you can use the same
|
239
|
+
// key with multiple resources.
|
240
|
+
// * Keys must start with a lowercase letter or international character.
|
241
|
+
//
|
242
|
+
// See [Google Cloud
|
243
|
+
// Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
244
|
+
// for more details.
|
245
|
+
map<string, string> user_labels = 22;
|
246
|
+
}
|
247
|
+
|
248
|
+
// Response message for
|
249
|
+
// [SearchService.Search][google.cloud.discoveryengine.v1.SearchService.Search]
|
250
|
+
// method.
|
251
|
+
message SearchResponse {
|
252
|
+
// Represents the search results.
|
253
|
+
message SearchResult {
|
254
|
+
// [Document.id][google.cloud.discoveryengine.v1.Document.id] of the
|
255
|
+
// searched [Document][google.cloud.discoveryengine.v1.Document].
|
256
|
+
string id = 1;
|
257
|
+
|
258
|
+
// The document data snippet in the search response. Only fields that are
|
259
|
+
// marked as retrievable are populated.
|
260
|
+
Document document = 2;
|
261
|
+
}
|
262
|
+
|
263
|
+
// A list of matched documents. The order represents the ranking.
|
264
|
+
repeated SearchResult results = 1;
|
265
|
+
|
266
|
+
// The estimated total count of matched items irrespective of pagination. The
|
267
|
+
// count of [results][google.cloud.discoveryengine.v1.SearchResponse.results]
|
268
|
+
// returned by pagination may be less than the
|
269
|
+
// [total_size][google.cloud.discoveryengine.v1.SearchResponse.total_size]
|
270
|
+
// that matches.
|
271
|
+
int32 total_size = 3;
|
272
|
+
|
273
|
+
// A unique search token. This should be included in the
|
274
|
+
// [UserEvent][google.cloud.discoveryengine.v1.UserEvent] logs resulting from
|
275
|
+
// this search, which enables accurate attribution of search model
|
276
|
+
// performance.
|
277
|
+
string attribution_token = 4;
|
278
|
+
|
279
|
+
// A token that can be sent as
|
280
|
+
// [SearchRequest.page_token][google.cloud.discoveryengine.v1.SearchRequest.page_token]
|
281
|
+
// to retrieve the next page. If this field is omitted, there are no
|
282
|
+
// subsequent pages.
|
283
|
+
string next_page_token = 5;
|
284
|
+
|
285
|
+
// Contains the spell corrected query, if found. If the spell correction type
|
286
|
+
// is AUTOMATIC, then the search results are based on corrected_query.
|
287
|
+
// Otherwise the original query is used for search.
|
288
|
+
string corrected_query = 7;
|
289
|
+
}
|