@google-cloud/discoveryengine 1.4.0 → 1.5.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 +14 -0
- package/README.md +15 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/acl_config.proto +49 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/acl_config_service.proto +79 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/chunk.proto +106 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/chunk_service.proto +137 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +97 -4
- package/build/protos/google/cloud/discoveryengine/v1alpha/completion.proto +52 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +44 -2
- package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +6 -1
- package/build/protos/google/cloud/discoveryengine/v1alpha/data_store.proto +44 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/data_store_service.proto +80 -1
- package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +102 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/document_processing_config.proto +127 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +70 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/engine.proto +13 -8
- package/build/protos/google/cloud/discoveryengine/v1alpha/engine_service.proto +3 -2
- package/build/protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto +130 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +376 -21
- package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +66 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/rank_service.proto +115 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto +3 -1
- package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +3 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +221 -30
- package/build/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto +27 -20
- package/build/protos/google/cloud/discoveryengine/v1alpha/serving_config.proto +271 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto +148 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine.proto +9 -3
- package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +7 -4
- package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +4 -3
- package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +5 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/data_store.proto +22 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +9 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/document_processing_config.proto +94 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +3 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +19 -4
- package/build/protos/google/cloud/discoveryengine/v1beta/search_tuning_service.proto +151 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/serving_config.proto +4 -3
- package/build/protos/google/cloud/discoveryengine/v1beta/serving_config_service.proto +6 -5
- package/build/protos/protos.d.ts +18160 -8292
- package/build/protos/protos.js +50325 -25400
- package/build/protos/protos.json +4864 -2447
- package/build/src/v1/completion_service_client.js +10 -7
- package/build/src/v1/conversational_search_service_client.js +10 -7
- package/build/src/v1/data_store_service_client.js +10 -7
- package/build/src/v1/document_service_client.js +10 -7
- package/build/src/v1/engine_service_client.js +10 -7
- package/build/src/v1/schema_service_client.js +10 -7
- package/build/src/v1/search_service_client.js +10 -7
- package/build/src/v1/site_search_engine_service_client.js +10 -7
- package/build/src/v1/user_event_service_client.js +10 -7
- package/build/src/v1alpha/acl_config_service_client.d.ts +1233 -0
- package/build/src/v1alpha/acl_config_service_client.js +1768 -0
- package/build/src/v1alpha/acl_config_service_client_config.json +34 -0
- package/build/src/v1alpha/chunk_service_client.d.ts +1350 -0
- package/build/src/v1alpha/chunk_service_client.js +1889 -0
- package/build/src/v1alpha/chunk_service_client_config.json +34 -0
- package/build/src/v1alpha/completion_service_client.d.ts +588 -3
- package/build/src/v1alpha/completion_service_client.js +844 -9
- package/build/src/v1alpha/completion_service_client_config.json +10 -0
- package/build/src/v1alpha/conversational_search_service_client.d.ts +233 -1
- package/build/src/v1alpha/conversational_search_service_client.js +326 -7
- package/build/src/v1alpha/data_store_service_client.d.ts +451 -3
- package/build/src/v1alpha/data_store_service_client.js +575 -9
- package/build/src/v1alpha/data_store_service_client_config.json +8 -0
- package/build/src/v1alpha/document_service_client.d.ts +462 -21
- package/build/src/v1alpha/document_service_client.js +549 -7
- package/build/src/v1alpha/document_service_client_config.json +5 -0
- package/build/src/v1alpha/engine_service_client.d.ts +375 -2
- package/build/src/v1alpha/engine_service_client.js +527 -7
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +1367 -0
- package/build/src/v1alpha/estimate_billing_service_client.js +2034 -0
- package/build/src/v1alpha/estimate_billing_service_client_config.json +30 -0
- package/build/src/v1alpha/index.d.ts +5 -0
- package/build/src/v1alpha/index.js +11 -1
- package/build/src/v1alpha/rank_service_client.d.ts +1254 -0
- package/build/src/v1alpha/rank_service_client.js +1796 -0
- package/build/src/v1alpha/rank_service_client_config.json +30 -0
- package/build/src/v1alpha/recommendation_service_client.d.ts +231 -1
- package/build/src/v1alpha/recommendation_service_client.js +326 -7
- package/build/src/v1alpha/schema_service_client.d.ts +372 -0
- package/build/src/v1alpha/schema_service_client.js +527 -7
- package/build/src/v1alpha/search_service_client.d.ts +288 -30
- package/build/src/v1alpha/search_service_client.js +366 -27
- package/build/src/v1alpha/search_tuning_service_client.d.ts +373 -1
- package/build/src/v1alpha/search_tuning_service_client.js +527 -7
- package/build/src/v1alpha/serving_config_service_client.d.ts +1370 -0
- package/build/src/v1alpha/serving_config_service_client.js +1939 -0
- package/build/src/v1alpha/serving_config_service_client_config.json +38 -0
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +372 -0
- package/build/src/v1alpha/site_search_engine_service_client.js +527 -7
- package/build/src/v1alpha/user_event_service_client.d.ts +372 -0
- package/build/src/v1alpha/user_event_service_client.js +527 -7
- package/build/src/v1beta/completion_service_client.d.ts +75 -0
- package/build/src/v1beta/completion_service_client.js +114 -7
- package/build/src/v1beta/conversational_search_service_client.d.ts +79 -0
- package/build/src/v1beta/conversational_search_service_client.js +114 -7
- package/build/src/v1beta/data_store_service_client.d.ts +75 -0
- package/build/src/v1beta/data_store_service_client.js +114 -7
- package/build/src/v1beta/document_service_client.d.ts +75 -0
- package/build/src/v1beta/document_service_client.js +114 -7
- package/build/src/v1beta/engine_service_client.d.ts +75 -0
- package/build/src/v1beta/engine_service_client.js +114 -7
- package/build/src/v1beta/index.d.ts +1 -0
- package/build/src/v1beta/index.js +3 -1
- package/build/src/v1beta/recommendation_service_client.d.ts +75 -0
- package/build/src/v1beta/recommendation_service_client.js +114 -7
- package/build/src/v1beta/schema_service_client.d.ts +75 -0
- package/build/src/v1beta/schema_service_client.js +114 -7
- package/build/src/v1beta/search_service_client.d.ts +81 -0
- package/build/src/v1beta/search_service_client.js +118 -7
- package/build/src/v1beta/search_tuning_service_client.d.ts +1196 -0
- package/build/src/v1beta/search_tuning_service_client.js +1784 -0
- package/build/src/v1beta/search_tuning_service_client_config.json +30 -0
- package/build/src/v1beta/serving_config_service_client.d.ts +123 -8
- package/build/src/v1beta/serving_config_service_client.js +176 -12
- package/build/src/v1beta/site_search_engine_service_client.d.ts +75 -0
- package/build/src/v1beta/site_search_engine_service_client.js +114 -7
- package/build/src/v1beta/user_event_service_client.d.ts +75 -0
- package/build/src/v1beta/user_event_service_client.js +114 -7
- package/package.json +3 -3
@@ -18,7 +18,9 @@ package google.cloud.discoveryengine.v1alpha;
|
|
18
18
|
|
19
19
|
import "google/api/field_behavior.proto";
|
20
20
|
import "google/api/resource.proto";
|
21
|
+
import "google/cloud/discoveryengine/v1alpha/import_config.proto";
|
21
22
|
import "google/protobuf/timestamp.proto";
|
23
|
+
import "google/rpc/status.proto";
|
22
24
|
|
23
25
|
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Alpha";
|
24
26
|
option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
|
@@ -102,10 +104,31 @@ message PurgeUserEventsMetadata {
|
|
102
104
|
int64 failure_count = 4;
|
103
105
|
}
|
104
106
|
|
107
|
+
// Configuration of destination for Purge related errors.
|
108
|
+
message PurgeErrorConfig {
|
109
|
+
// Required. Errors destination.
|
110
|
+
oneof destination {
|
111
|
+
// Cloud Storage prefix for purge errors. This must be an empty,
|
112
|
+
// existing Cloud Storage directory. Purge errors are written to
|
113
|
+
// sharded files in this directory, one per line, as a JSON-encoded
|
114
|
+
// `google.rpc.Status` message.
|
115
|
+
string gcs_prefix = 1;
|
116
|
+
}
|
117
|
+
}
|
118
|
+
|
105
119
|
// Request message for
|
106
120
|
// [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
|
107
121
|
// method.
|
108
122
|
message PurgeDocumentsRequest {
|
123
|
+
// The desired input source for the purging documents based on document ids.
|
124
|
+
oneof source {
|
125
|
+
// Cloud Storage location for the input content.
|
126
|
+
// Supported `data_schema`:
|
127
|
+
// * `document_id`: One valid
|
128
|
+
// [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] per line.
|
129
|
+
GcsSource gcs_source = 5;
|
130
|
+
}
|
131
|
+
|
109
132
|
// Required. The parent resource name, such as
|
110
133
|
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}`.
|
111
134
|
string parent = 1 [
|
@@ -120,6 +143,9 @@ message PurgeDocumentsRequest {
|
|
120
143
|
// `*` (all items).
|
121
144
|
string filter = 2 [(google.api.field_behavior) = REQUIRED];
|
122
145
|
|
146
|
+
// The desired location of errors incurred during the purge.
|
147
|
+
PurgeErrorConfig error_config = 7;
|
148
|
+
|
123
149
|
// Actually performs the purge. If `force` is set to false, return the
|
124
150
|
// expected purge count without deleting any documents.
|
125
151
|
bool force = 3;
|
@@ -156,4 +182,44 @@ message PurgeDocumentsMetadata {
|
|
156
182
|
|
157
183
|
// Count of entries that encountered errors while processing.
|
158
184
|
int64 failure_count = 4;
|
185
|
+
|
186
|
+
// Count of entries that were ignored as entries were not found.
|
187
|
+
int64 ignored_count = 5;
|
188
|
+
}
|
189
|
+
|
190
|
+
// Request message for
|
191
|
+
// [CompletionService.PurgeSuggestionDenyListEntries][google.cloud.discoveryengine.v1alpha.CompletionService.PurgeSuggestionDenyListEntries]
|
192
|
+
// method.
|
193
|
+
message PurgeSuggestionDenyListEntriesRequest {
|
194
|
+
// Required. The parent data store resource name for which to import denylist
|
195
|
+
// entries. Follows pattern projects/*/locations/*/collections/*/dataStores/*.
|
196
|
+
string parent = 1 [
|
197
|
+
(google.api.field_behavior) = REQUIRED,
|
198
|
+
(google.api.resource_reference) = {
|
199
|
+
type: "discoveryengine.googleapis.com/DataStore"
|
200
|
+
}
|
201
|
+
];
|
202
|
+
}
|
203
|
+
|
204
|
+
// Response message for
|
205
|
+
// [CompletionService.PurgeSuggestionDenyListEntries][google.cloud.discoveryengine.v1alpha.CompletionService.PurgeSuggestionDenyListEntries]
|
206
|
+
// method.
|
207
|
+
message PurgeSuggestionDenyListEntriesResponse {
|
208
|
+
// Number of suggestion deny list entries purged.
|
209
|
+
int64 purge_count = 1;
|
210
|
+
|
211
|
+
// A sample of errors encountered while processing the request.
|
212
|
+
repeated google.rpc.Status error_samples = 2;
|
213
|
+
}
|
214
|
+
|
215
|
+
// Metadata related to the progress of the PurgeSuggestionDenyListEntries
|
216
|
+
// operation. This is returned by the google.longrunning.Operation.metadata
|
217
|
+
// field.
|
218
|
+
message PurgeSuggestionDenyListEntriesMetadata {
|
219
|
+
// Operation create time.
|
220
|
+
google.protobuf.Timestamp create_time = 1;
|
221
|
+
|
222
|
+
// Operation last update time. If the operation is done, this is also the
|
223
|
+
// finish time.
|
224
|
+
google.protobuf.Timestamp update_time = 2;
|
159
225
|
}
|
@@ -0,0 +1,115 @@
|
|
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.v1alpha;
|
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.V1Alpha";
|
25
|
+
option go_package = "cloud.google.com/go/discoveryengine/apiv1alpha/discoveryenginepb;discoveryenginepb";
|
26
|
+
option java_multiple_files = true;
|
27
|
+
option java_outer_classname = "RankServiceProto";
|
28
|
+
option java_package = "com.google.cloud.discoveryengine.v1alpha";
|
29
|
+
option objc_class_prefix = "DISCOVERYENGINE";
|
30
|
+
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1alpha";
|
31
|
+
option ruby_package = "Google::Cloud::DiscoveryEngine::V1alpha";
|
32
|
+
|
33
|
+
// Service for ranking text records.
|
34
|
+
service RankService {
|
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
|
+
// Ranks a list of text records based on the given input query.
|
40
|
+
rpc Rank(RankRequest) returns (RankResponse) {
|
41
|
+
option (google.api.http) = {
|
42
|
+
post: "/v1alpha/{ranking_config=projects/*/locations/*/rankingConfigs/*}:rank"
|
43
|
+
body: "*"
|
44
|
+
};
|
45
|
+
}
|
46
|
+
}
|
47
|
+
|
48
|
+
// Record message for
|
49
|
+
// [RankService.Rank][google.cloud.discoveryengine.v1alpha.RankService.Rank]
|
50
|
+
// method.
|
51
|
+
message RankingRecord {
|
52
|
+
// The unique ID to represent the record.
|
53
|
+
string id = 1;
|
54
|
+
|
55
|
+
// The title of the record. Empty by default.
|
56
|
+
// At least one of
|
57
|
+
// [title][google.cloud.discoveryengine.v1alpha.RankingRecord.title] or
|
58
|
+
// [content][google.cloud.discoveryengine.v1alpha.RankingRecord.content]
|
59
|
+
// should be set otherwise an INVALID_ARGUMENT error is thrown.
|
60
|
+
string title = 2;
|
61
|
+
|
62
|
+
// The content of the record. Empty by default.
|
63
|
+
// At least one of
|
64
|
+
// [title][google.cloud.discoveryengine.v1alpha.RankingRecord.title] or
|
65
|
+
// [content][google.cloud.discoveryengine.v1alpha.RankingRecord.content]
|
66
|
+
// should be set otherwise an INVALID_ARGUMENT error is thrown.
|
67
|
+
string content = 3;
|
68
|
+
|
69
|
+
// The score of this record based on the given query and selected model.
|
70
|
+
float score = 4;
|
71
|
+
}
|
72
|
+
|
73
|
+
// Request message for
|
74
|
+
// [RankService.Rank][google.cloud.discoveryengine.v1alpha.RankService.Rank]
|
75
|
+
// method.
|
76
|
+
message RankRequest {
|
77
|
+
// Required. The resource name of the rank service config, such as
|
78
|
+
// `projects/{project_num}/locations/{location_id}/rankingConfigs/default_ranking_config`.
|
79
|
+
string ranking_config = 1 [
|
80
|
+
(google.api.field_behavior) = REQUIRED,
|
81
|
+
(google.api.resource_reference) = {
|
82
|
+
type: "discoveryengine.googleapis.com/RankingConfig"
|
83
|
+
}
|
84
|
+
];
|
85
|
+
|
86
|
+
// The identifier of the model to use. It is one of:
|
87
|
+
//
|
88
|
+
// * `semantic-ranker-512@latest`: Semantic ranking model with maxiumn input
|
89
|
+
// token size 512.
|
90
|
+
//
|
91
|
+
// It is set to `semantic-ranker-512@latest` by default if unspecified.
|
92
|
+
string model = 2;
|
93
|
+
|
94
|
+
// The number of results to return. If this is unset or no bigger than zero,
|
95
|
+
// returns all results.
|
96
|
+
int32 top_n = 3;
|
97
|
+
|
98
|
+
// The query to use.
|
99
|
+
string query = 4;
|
100
|
+
|
101
|
+
// Required. A list of records to rank. At most 200 records to rank.
|
102
|
+
repeated RankingRecord records = 5 [(google.api.field_behavior) = REQUIRED];
|
103
|
+
|
104
|
+
// If true, the response will contain only record ID and score. By default, it
|
105
|
+
// is false, the response will contain record details.
|
106
|
+
bool ignore_record_details_in_response = 6;
|
107
|
+
}
|
108
|
+
|
109
|
+
// Response message for
|
110
|
+
// [RankService.Rank][google.cloud.discoveryengine.v1alpha.RankService.Rank]
|
111
|
+
// method.
|
112
|
+
message RankResponse {
|
113
|
+
// A list of records sorted by descending score.
|
114
|
+
repeated RankingRecord records = 5;
|
115
|
+
}
|
@@ -68,7 +68,9 @@ message RecommendRequest {
|
|
68
68
|
// config. For example, for Engine
|
69
69
|
// `projects/*/locations/global/collections/*/engines/my-engine`, you can use
|
70
70
|
// `projects/*/locations/global/collections/*/engines/my-engine/servingConfigs/my-engine`
|
71
|
-
// for your
|
71
|
+
// for your
|
72
|
+
// [RecommendationService.Recommend][google.cloud.discoveryengine.v1alpha.RecommendationService.Recommend]
|
73
|
+
// requests.
|
72
74
|
string serving_config = 1 [
|
73
75
|
(google.api.field_behavior) = REQUIRED,
|
74
76
|
(google.api.resource_reference) = {
|
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
|
|
20
20
|
import "google/api/client.proto";
|
21
21
|
import "google/api/field_behavior.proto";
|
22
22
|
import "google/api/resource.proto";
|
23
|
+
import "google/cloud/discoveryengine/v1alpha/chunk.proto";
|
23
24
|
import "google/cloud/discoveryengine/v1alpha/common.proto";
|
24
25
|
import "google/cloud/discoveryengine/v1alpha/document.proto";
|
25
26
|
import "google/protobuf/struct.proto";
|
@@ -69,6 +70,19 @@ message SearchRequest {
|
|
69
70
|
}
|
70
71
|
}
|
71
72
|
|
73
|
+
// A struct to define data stores to filter on in a search call.
|
74
|
+
message DataStoreSpec {
|
75
|
+
// Required. Full resource name of
|
76
|
+
// [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], such as
|
77
|
+
// `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
|
78
|
+
string data_store = 1 [
|
79
|
+
(google.api.field_behavior) = REQUIRED,
|
80
|
+
(google.api.resource_reference) = {
|
81
|
+
type: "discoveryengine.googleapis.com/DataStore"
|
82
|
+
}
|
83
|
+
];
|
84
|
+
}
|
85
|
+
|
72
86
|
// A facet specification to perform faceted search.
|
73
87
|
message FacetSpec {
|
74
88
|
// Specifies how a facet is computed.
|
@@ -204,6 +218,80 @@ message SearchRequest {
|
|
204
218
|
message BoostSpec {
|
205
219
|
// Boost applies to documents which match a condition.
|
206
220
|
message ConditionBoostSpec {
|
221
|
+
// Specification for custom ranking based on customer specified attribute
|
222
|
+
// value. It provides more controls for customized ranking than the simple
|
223
|
+
// (condition, boost) combination above.
|
224
|
+
message BoostControlSpec {
|
225
|
+
// The control points used to define the curve. The curve defined
|
226
|
+
// through these control points can only be monotonically increasing
|
227
|
+
// or decreasing(constant values are acceptable).
|
228
|
+
message ControlPoint {
|
229
|
+
// Can be one of:
|
230
|
+
// 1. The numerical field value.
|
231
|
+
// 2. The duration spec for freshness:
|
232
|
+
// The value must be formatted as an XSD `dayTimeDuration` value (a
|
233
|
+
// restricted subset of an ISO 8601 duration value). The pattern for
|
234
|
+
// this is: `[nD][T[nH][nM][nS]]`.
|
235
|
+
string attribute_value = 1;
|
236
|
+
|
237
|
+
// The value between -1 to 1 by which to boost the score if the
|
238
|
+
// attribute_value evaluates to the value specified above.
|
239
|
+
float boost_amount = 2;
|
240
|
+
}
|
241
|
+
|
242
|
+
// The attribute(or function) for which the custom ranking is to be
|
243
|
+
// applied.
|
244
|
+
enum AttributeType {
|
245
|
+
// Unspecified AttributeType.
|
246
|
+
ATTRIBUTE_TYPE_UNSPECIFIED = 0;
|
247
|
+
|
248
|
+
// The value of the numerical field will be used to dynamically update
|
249
|
+
// the boost amount. In this case, the attribute_value (the x value)
|
250
|
+
// of the control point will be the actual value of the numerical
|
251
|
+
// field for which the boost_amount is specified.
|
252
|
+
NUMERICAL = 1;
|
253
|
+
|
254
|
+
// For the freshness use case the attribute value will be the duration
|
255
|
+
// between the current time and the date in the datetime field
|
256
|
+
// specified. The value must be formatted as an XSD `dayTimeDuration`
|
257
|
+
// value (a restricted subset of an ISO 8601 duration value). The
|
258
|
+
// pattern for this is: `[nD][T[nH][nM][nS]]`.
|
259
|
+
// E.g. `5D`, `3DT12H30M`, `T24H`.
|
260
|
+
FRESHNESS = 2;
|
261
|
+
}
|
262
|
+
|
263
|
+
// The interpolation type to be applied. Default will be linear
|
264
|
+
// (Piecewise Linear).
|
265
|
+
enum InterpolationType {
|
266
|
+
// Interpolation type is unspecified. In this case, it defaults to
|
267
|
+
// Linear.
|
268
|
+
INTERPOLATION_TYPE_UNSPECIFIED = 0;
|
269
|
+
|
270
|
+
// Piecewise linear interpolation will be applied.
|
271
|
+
LINEAR = 1;
|
272
|
+
}
|
273
|
+
|
274
|
+
// The name of the field whose value will be used to determine the
|
275
|
+
// boost amount.
|
276
|
+
string field_name = 1;
|
277
|
+
|
278
|
+
// The attribute type to be used to determine the boost amount. The
|
279
|
+
// attribute value can be derived from the field value of the specified
|
280
|
+
// field_name. In the case of numerical it is straightforward i.e.
|
281
|
+
// attribute_value = numerical_field_value. In the case of freshness
|
282
|
+
// however, attribute_value = (time.now() - datetime_field_value).
|
283
|
+
AttributeType attribute_type = 2;
|
284
|
+
|
285
|
+
// The interpolation type to be applied to connect the control points
|
286
|
+
// listed below.
|
287
|
+
InterpolationType interpolation_type = 3;
|
288
|
+
|
289
|
+
// The control points used to define the curve. The monotonic function
|
290
|
+
// (defined through the interpolation_type above) passes through the
|
291
|
+
// control points listed here.
|
292
|
+
repeated ControlPoint control_points = 4;
|
293
|
+
}
|
294
|
+
|
207
295
|
// An expression which specifies a boost condition. The syntax and
|
208
296
|
// supported fields are the same as a filter expression. See
|
209
297
|
// [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter]
|
@@ -212,29 +300,34 @@ message SearchRequest {
|
|
212
300
|
// Examples:
|
213
301
|
//
|
214
302
|
// * To boost documents with document ID "doc_1" or "doc_2", and
|
215
|
-
// color
|
216
|
-
//
|
217
|
-
// * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
|
303
|
+
// color "Red" or "Blue":
|
304
|
+
// `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
|
218
305
|
string condition = 1;
|
219
306
|
|
220
307
|
// Strength of the condition boost, which should be in [-1, 1]. Negative
|
221
308
|
// boost means demotion. Default is 0.0.
|
222
309
|
//
|
223
|
-
// Setting to 1.0 gives the document a big promotion. However, it does
|
224
|
-
// necessarily mean that the boosted document will be the top result
|
225
|
-
// all times, nor that other documents will be excluded. Results
|
226
|
-
// still be shown even when none of them matches the condition.
|
227
|
-
// results that are significantly more relevant to the search query
|
228
|
-
// still trump your heavily favored but irrelevant documents.
|
310
|
+
// Setting to 1.0 gives the document a big promotion. However, it does
|
311
|
+
// not necessarily mean that the boosted document will be the top result
|
312
|
+
// at all times, nor that other documents will be excluded. Results
|
313
|
+
// could still be shown even when none of them matches the condition.
|
314
|
+
// And results that are significantly more relevant to the search query
|
315
|
+
// can still trump your heavily favored but irrelevant documents.
|
229
316
|
//
|
230
317
|
// Setting to -1.0 gives the document a big demotion. However, results
|
231
318
|
// that are deeply relevant might still be shown. The document will have
|
232
|
-
// an upstream battle to get a fairly high ranking, but it is not
|
233
|
-
// out completely.
|
319
|
+
// an upstream battle to get a fairly high ranking, but it is not
|
320
|
+
// blocked out completely.
|
234
321
|
//
|
235
322
|
// Setting to 0.0 means no boost applied. The boosting condition is
|
236
|
-
// ignored.
|
323
|
+
// ignored. Only one of the (condition, boost) combination or the
|
324
|
+
// boost_control_spec below are set. If both are set then the global boost
|
325
|
+
// is ignored and the more fine-grained boost_control_spec is applied.
|
237
326
|
float boost = 2;
|
327
|
+
|
328
|
+
// Complex specification for custom ranking based on customer defined
|
329
|
+
// attribute value.
|
330
|
+
BoostControlSpec boost_control_spec = 3;
|
238
331
|
}
|
239
332
|
|
240
333
|
// Condition boost specifications. If a document matches multiple conditions
|
@@ -330,8 +423,18 @@ message SearchRequest {
|
|
330
423
|
|
331
424
|
// Specification of the model.
|
332
425
|
message ModelSpec {
|
333
|
-
// The
|
334
|
-
//
|
426
|
+
// The model version used to generate the summary.
|
427
|
+
//
|
428
|
+
// Supported values are:
|
429
|
+
//
|
430
|
+
// * `stable`: string. Default value when no value is specified. Uses a
|
431
|
+
// generally available, fine-tuned model. For more information, see
|
432
|
+
// [Answer generation model versions and
|
433
|
+
// lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
|
434
|
+
// * `preview`: string. (Public preview) Uses a preview model. For more
|
435
|
+
// information, see
|
436
|
+
// [Answer generation model versions and
|
437
|
+
// lifecycle](https://cloud.google.com/generative-ai-app-builder/docs/answer-generation-models).
|
335
438
|
string version = 1;
|
336
439
|
}
|
337
440
|
|
@@ -339,7 +442,7 @@ message SearchRequest {
|
|
339
442
|
// of results returned is less than `summaryResultCount`, the summary is
|
340
443
|
// generated from all of the results.
|
341
444
|
//
|
342
|
-
// At most
|
445
|
+
// At most 10 results can be used to generate a summary.
|
343
446
|
int32 summary_result_count = 1;
|
344
447
|
|
345
448
|
// Specifies whether to include citations in the summary. The default
|
@@ -398,6 +501,14 @@ message SearchRequest {
|
|
398
501
|
// If specified, the spec will be used to modify the model specification
|
399
502
|
// provided to the LLM.
|
400
503
|
ModelSpec model_spec = 7;
|
504
|
+
|
505
|
+
// If true, answer will be generated from most relevant chunks from top
|
506
|
+
// search results. This feature will improve summary quality.
|
507
|
+
// Please note that with this feature enabled, not all top search results
|
508
|
+
// will be referenced and included in the reference list, so the citation
|
509
|
+
// source index only points to the search results listed in the reference
|
510
|
+
// list.
|
511
|
+
bool use_semantic_chunks = 8;
|
401
512
|
}
|
402
513
|
|
403
514
|
// A specification for configuring the extractive content in a search
|
@@ -414,7 +525,7 @@ message SearchRequest {
|
|
414
525
|
// `max_extractive_answer_count`, return all of the answers. Otherwise,
|
415
526
|
// return the `max_extractive_answer_count`.
|
416
527
|
//
|
417
|
-
// At most
|
528
|
+
// At most five answers are returned for each
|
418
529
|
// [SearchResult][google.cloud.discoveryengine.v1alpha.SearchResponse.SearchResult].
|
419
530
|
int32 max_extractive_answer_count = 1;
|
420
531
|
|
@@ -438,10 +549,9 @@ message SearchRequest {
|
|
438
549
|
int32 max_extractive_segment_count = 2;
|
439
550
|
|
440
551
|
// Specifies whether to return the confidence score from the extractive
|
441
|
-
// segments in each search result.
|
442
|
-
//
|
443
|
-
//
|
444
|
-
// users, please reach out to Cloud Support team if you want to use it.
|
552
|
+
// segments in each search result. This feature is available only for new
|
553
|
+
// or allowlisted data stores. To allowlist your data store, please
|
554
|
+
// contact your Customer Engineer. The default value is `false`.
|
445
555
|
bool return_extractive_segment_score = 3;
|
446
556
|
|
447
557
|
// Specifies whether to also include the adjacent from each selected
|
@@ -455,6 +565,41 @@ message SearchRequest {
|
|
455
565
|
int32 num_next_segments = 5;
|
456
566
|
}
|
457
567
|
|
568
|
+
// Specifies the chunk spec to be returned from the search response.
|
569
|
+
// Only available if the
|
570
|
+
// [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.search_result_mode]
|
571
|
+
// is set to
|
572
|
+
// [CHUNKS][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]
|
573
|
+
message ChunkSpec {
|
574
|
+
// The number of previous chunks to be returned of the current chunk. The
|
575
|
+
// maximum allowed value is 3.
|
576
|
+
// If not specified, no previous chunks will be returned.
|
577
|
+
int32 num_previous_chunks = 1;
|
578
|
+
|
579
|
+
// The number of next chunks to be returned of the current chunk. The
|
580
|
+
// maximum allowed value is 3.
|
581
|
+
// If not specified, no next chunks will be returned.
|
582
|
+
int32 num_next_chunks = 2;
|
583
|
+
}
|
584
|
+
|
585
|
+
// Specifies the search result mode. If unspecified, the
|
586
|
+
// search result mode is based on
|
587
|
+
// [DataStore.DocumentProcessingConfig.chunking_config][]:
|
588
|
+
// * If [DataStore.DocumentProcessingConfig.chunking_config][] is specified,
|
589
|
+
// it defaults to `CHUNKS`.
|
590
|
+
// * Otherwise, it defaults to `DOCUMENTS`.
|
591
|
+
enum SearchResultMode {
|
592
|
+
// Default value.
|
593
|
+
SEARCH_RESULT_MODE_UNSPECIFIED = 0;
|
594
|
+
|
595
|
+
// Returns documents in the search result.
|
596
|
+
DOCUMENTS = 1;
|
597
|
+
|
598
|
+
// Returns chunks in the search result. Only available if the
|
599
|
+
// [DataStore.DocumentProcessingConfig.chunking_config][] is specified.
|
600
|
+
CHUNKS = 2;
|
601
|
+
}
|
602
|
+
|
458
603
|
// If `snippetSpec` is not specified, snippets are not included in the
|
459
604
|
// search response.
|
460
605
|
SnippetSpec snippet_spec = 1;
|
@@ -466,6 +611,21 @@ message SearchRequest {
|
|
466
611
|
// If there is no extractive_content_spec provided, there will be no
|
467
612
|
// extractive answer in the search response.
|
468
613
|
ExtractiveContentSpec extractive_content_spec = 3;
|
614
|
+
|
615
|
+
// Specifies the search result mode. If unspecified, the
|
616
|
+
// search result mode is based on
|
617
|
+
// [DataStore.DocumentProcessingConfig.chunking_config][]:
|
618
|
+
// * If [DataStore.DocumentProcessingConfig.chunking_config][] is specified,
|
619
|
+
// it defaults to `CHUNKS`.
|
620
|
+
// * Otherwise, it defaults to `DOCUMENTS`.
|
621
|
+
SearchResultMode search_result_mode = 4;
|
622
|
+
|
623
|
+
// Specifies the chunk spec to be returned from the search response.
|
624
|
+
// Only available if the
|
625
|
+
// [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.search_result_mode]
|
626
|
+
// is set to
|
627
|
+
// [CHUNKS][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]
|
628
|
+
ChunkSpec chunk_spec = 5;
|
469
629
|
}
|
470
630
|
|
471
631
|
// The specification that uses customized query embedding vector to do
|
@@ -513,11 +673,15 @@ message SearchRequest {
|
|
513
673
|
ImageQuery image_query = 19;
|
514
674
|
|
515
675
|
// Maximum number of
|
516
|
-
// [Document][google.cloud.discoveryengine.v1alpha.Document]s to return.
|
517
|
-
//
|
518
|
-
//
|
676
|
+
// [Document][google.cloud.discoveryengine.v1alpha.Document]s to return. The
|
677
|
+
// maximum allowed value depends on the data type. Values above the maximum
|
678
|
+
// value are coerced to the maximum value.
|
519
679
|
//
|
520
|
-
//
|
680
|
+
// * Websites with basic indexing: Default `10`, Maximum `25`.
|
681
|
+
// * Websites with advanced indexing: Default `25`, Maximum `50`.
|
682
|
+
// * Other: Default `50`, Maximum `100`.
|
683
|
+
//
|
684
|
+
// If this field is negative, an `INVALID_ARGUMENT` is returned.
|
521
685
|
int32 page_size = 4;
|
522
686
|
|
523
687
|
// A page token received from a previous
|
@@ -540,6 +704,9 @@ message SearchRequest {
|
|
540
704
|
// If this field is negative, an `INVALID_ARGUMENT` is returned.
|
541
705
|
int32 offset = 6;
|
542
706
|
|
707
|
+
// A list of data store specs to apply on a search call.
|
708
|
+
repeated DataStoreSpec data_store_specs = 32;
|
709
|
+
|
543
710
|
// The filter syntax consists of an expression language for constructing a
|
544
711
|
// predicate from one or more fields of the documents being filtered. Filter
|
545
712
|
// expression is case-sensitive.
|
@@ -645,12 +812,14 @@ message SearchRequest {
|
|
645
812
|
|
646
813
|
// Uses the provided embedding to do additional semantic document retrieval.
|
647
814
|
// The retrieval is based on the dot product of
|
648
|
-
// [SearchRequest.
|
649
|
-
// embedding that is provided in
|
650
|
-
// [SearchRequest.
|
815
|
+
// [SearchRequest.EmbeddingSpec.EmbeddingVector.vector][google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.vector]
|
816
|
+
// and the document embedding that is provided in
|
817
|
+
// [SearchRequest.EmbeddingSpec.EmbeddingVector.field_path][google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path].
|
651
818
|
//
|
652
|
-
// If
|
653
|
-
//
|
819
|
+
// If
|
820
|
+
// [SearchRequest.EmbeddingSpec.EmbeddingVector.field_path][google.cloud.discoveryengine.v1alpha.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path]
|
821
|
+
// is not provided, it will use
|
822
|
+
// [ServingConfig.EmbeddingConfig.field_path][google.cloud.discoveryengine.v1alpha.ServingConfig.embedding_config].
|
654
823
|
EmbeddingSpec embedding_spec = 23;
|
655
824
|
|
656
825
|
// The ranking expression controls the customized ranking on retrieval
|
@@ -697,6 +866,9 @@ message SearchRequest {
|
|
697
866
|
// Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
698
867
|
// for more details.
|
699
868
|
map<string, string> user_labels = 22;
|
869
|
+
|
870
|
+
// Custom fine tuning configs.
|
871
|
+
CustomFineTuningSpec custom_fine_tuning_spec = 34;
|
700
872
|
}
|
701
873
|
|
702
874
|
// Response message for
|
@@ -713,6 +885,12 @@ message SearchResponse {
|
|
713
885
|
// marked as retrievable are populated.
|
714
886
|
Document document = 2;
|
715
887
|
|
888
|
+
// The chunk data in the search response if the
|
889
|
+
// [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.search_result_mode]
|
890
|
+
// is set to
|
891
|
+
// [CHUNKS][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
|
892
|
+
Chunk chunk = 18;
|
893
|
+
|
716
894
|
// Google provided available scores.
|
717
895
|
map<string, DoubleList> model_scores = 4;
|
718
896
|
}
|
@@ -807,6 +985,15 @@ message SearchResponse {
|
|
807
985
|
|
808
986
|
// Document reference.
|
809
987
|
message Reference {
|
988
|
+
// Chunk content.
|
989
|
+
message ChunkContent {
|
990
|
+
// Chunk textual content.
|
991
|
+
string content = 1;
|
992
|
+
|
993
|
+
// Page identifier.
|
994
|
+
string page_identifier = 2;
|
995
|
+
}
|
996
|
+
|
810
997
|
// Title of the document.
|
811
998
|
string title = 1;
|
812
999
|
|
@@ -822,8 +1009,11 @@ message SearchResponse {
|
|
822
1009
|
}
|
823
1010
|
];
|
824
1011
|
|
825
|
-
//
|
1012
|
+
// Cloud Storage or HTTP uri for the document.
|
826
1013
|
string uri = 3;
|
1014
|
+
|
1015
|
+
// List of cited chunk contents derived from document content.
|
1016
|
+
repeated ChunkContent chunk_contents = 4;
|
827
1017
|
}
|
828
1018
|
|
829
1019
|
// Summary with metadata information.
|
@@ -887,6 +1077,7 @@ message SearchResponse {
|
|
887
1077
|
// confidence scores.
|
888
1078
|
SafetyAttributes safety_attributes = 3;
|
889
1079
|
|
1080
|
+
// Summary with metadata information.
|
890
1081
|
SummaryWithMetadata summary_with_metadata = 4;
|
891
1082
|
}
|
892
1083
|
|