@google-cloud/discoveryengine 1.10.0 → 1.12.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 +20 -0
- package/README.md +33 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/evaluation.proto +232 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/evaluation_service.proto +252 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +83 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/sample_query.proto +86 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/sample_query_service.proto +264 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/sample_query_set.proto +64 -0
- package/build/protos/google/cloud/discoveryengine/v1alpha/sample_query_set_service.proto +258 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/answer.proto +14 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/chunk.proto +119 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +0 -5
- package/build/protos/google/cloud/discoveryengine/v1beta/completion.proto +31 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +38 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +29 -2
- package/build/protos/google/cloud/discoveryengine/v1beta/custom_tuning_model.proto +7 -1
- package/build/protos/google/cloud/discoveryengine/v1beta/data_store.proto +23 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/data_store_service.proto +10 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +1 -1
- package/build/protos/google/cloud/discoveryengine/v1beta/document_processing_config.proto +37 -2
- package/build/protos/google/cloud/discoveryengine/v1beta/evaluation.proto +231 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/evaluation_service.proto +252 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +191 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +111 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/sample_query.proto +86 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/sample_query_service.proto +264 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/sample_query_set.proto +64 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/sample_query_set_service.proto +256 -0
- package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +370 -8
- package/build/protos/google/cloud/discoveryengine/v1beta/serving_config.proto +11 -5
- package/build/protos/google/cloud/discoveryengine/v1beta/user_event_service.proto +24 -0
- package/build/protos/protos.d.ts +32735 -21073
- package/build/protos/protos.js +80768 -53241
- package/build/protos/protos.json +5309 -2481
- package/build/src/v1alpha/acl_config_service_client.d.ts +108 -0
- package/build/src/v1alpha/acl_config_service_client.js +157 -0
- package/build/src/v1alpha/chunk_service_client.d.ts +108 -0
- package/build/src/v1alpha/chunk_service_client.js +157 -0
- package/build/src/v1alpha/completion_service_client.d.ts +108 -0
- package/build/src/v1alpha/completion_service_client.js +157 -0
- package/build/src/v1alpha/control_service_client.d.ts +108 -0
- package/build/src/v1alpha/control_service_client.js +157 -0
- package/build/src/v1alpha/conversational_search_service_client.d.ts +108 -0
- package/build/src/v1alpha/conversational_search_service_client.js +157 -0
- package/build/src/v1alpha/data_store_service_client.d.ts +108 -0
- package/build/src/v1alpha/data_store_service_client.js +157 -0
- package/build/src/v1alpha/document_service_client.d.ts +108 -0
- package/build/src/v1alpha/document_service_client.js +157 -0
- package/build/src/v1alpha/engine_service_client.d.ts +108 -0
- package/build/src/v1alpha/engine_service_client.js +157 -0
- package/build/src/v1alpha/estimate_billing_service_client.d.ts +108 -0
- package/build/src/v1alpha/estimate_billing_service_client.js +157 -0
- package/build/src/v1alpha/evaluation_service_client.d.ts +2349 -0
- package/build/src/v1alpha/evaluation_service_client.js +3288 -0
- package/build/src/v1alpha/evaluation_service_client_config.json +58 -0
- package/build/src/v1alpha/grounded_generation_service_client.d.ts +108 -0
- package/build/src/v1alpha/grounded_generation_service_client.js +157 -0
- package/build/src/v1alpha/index.d.ts +3 -0
- package/build/src/v1alpha/index.js +7 -1
- package/build/src/v1alpha/project_service_client.d.ts +108 -0
- package/build/src/v1alpha/project_service_client.js +157 -0
- package/build/src/v1alpha/rank_service_client.d.ts +108 -0
- package/build/src/v1alpha/rank_service_client.js +157 -0
- package/build/src/v1alpha/recommendation_service_client.d.ts +108 -0
- package/build/src/v1alpha/recommendation_service_client.js +157 -0
- package/build/src/v1alpha/sample_query_service_client.d.ts +2317 -0
- package/build/src/v1alpha/sample_query_service_client.js +3186 -0
- package/build/src/v1alpha/sample_query_service_client_config.json +68 -0
- package/build/src/v1alpha/sample_query_set_service_client.d.ts +2176 -0
- package/build/src/v1alpha/sample_query_set_service_client.js +2931 -0
- package/build/src/v1alpha/sample_query_set_service_client_config.json +63 -0
- package/build/src/v1alpha/schema_service_client.d.ts +108 -0
- package/build/src/v1alpha/schema_service_client.js +157 -0
- package/build/src/v1alpha/search_service_client.d.ts +108 -0
- package/build/src/v1alpha/search_service_client.js +157 -0
- package/build/src/v1alpha/search_tuning_service_client.d.ts +108 -0
- package/build/src/v1alpha/search_tuning_service_client.js +157 -0
- package/build/src/v1alpha/serving_config_service_client.d.ts +108 -0
- package/build/src/v1alpha/serving_config_service_client.js +157 -0
- package/build/src/v1alpha/site_search_engine_service_client.d.ts +108 -0
- package/build/src/v1alpha/site_search_engine_service_client.js +157 -0
- package/build/src/v1alpha/user_event_service_client.d.ts +108 -0
- package/build/src/v1alpha/user_event_service_client.js +157 -0
- package/build/src/v1beta/completion_service_client.d.ts +328 -0
- package/build/src/v1beta/completion_service_client.js +423 -0
- package/build/src/v1beta/completion_service_client_config.json +10 -0
- package/build/src/v1beta/control_service_client.d.ts +237 -0
- package/build/src/v1beta/control_service_client.js +333 -0
- package/build/src/v1beta/conversational_search_service_client.d.ts +255 -0
- package/build/src/v1beta/conversational_search_service_client.js +333 -0
- package/build/src/v1beta/data_store_service_client.d.ts +246 -0
- package/build/src/v1beta/data_store_service_client.js +339 -0
- package/build/src/v1beta/document_service_client.d.ts +239 -0
- package/build/src/v1beta/document_service_client.js +339 -0
- package/build/src/v1beta/engine_service_client.d.ts +237 -0
- package/build/src/v1beta/engine_service_client.js +339 -0
- package/build/src/v1beta/evaluation_service_client.d.ts +2325 -0
- package/build/src/v1beta/evaluation_service_client.js +3252 -0
- package/build/src/v1beta/evaluation_service_client_config.json +58 -0
- package/build/src/v1beta/grounded_generation_service_client.d.ts +237 -0
- package/build/src/v1beta/grounded_generation_service_client.js +333 -0
- package/build/src/v1beta/index.d.ts +3 -0
- package/build/src/v1beta/index.js +7 -1
- package/build/src/v1beta/project_service_client.d.ts +237 -0
- package/build/src/v1beta/project_service_client.js +339 -0
- package/build/src/v1beta/rank_service_client.d.ts +237 -0
- package/build/src/v1beta/rank_service_client.js +333 -0
- package/build/src/v1beta/recommendation_service_client.d.ts +237 -0
- package/build/src/v1beta/recommendation_service_client.js +333 -0
- package/build/src/v1beta/sample_query_service_client.d.ts +2293 -0
- package/build/src/v1beta/sample_query_service_client.js +3150 -0
- package/build/src/v1beta/sample_query_service_client_config.json +68 -0
- package/build/src/v1beta/sample_query_set_service_client.d.ts +2150 -0
- package/build/src/v1beta/sample_query_set_service_client.js +2895 -0
- package/build/src/v1beta/sample_query_set_service_client_config.json +63 -0
- package/build/src/v1beta/schema_service_client.d.ts +237 -0
- package/build/src/v1beta/schema_service_client.js +339 -0
- package/build/src/v1beta/search_service_client.d.ts +414 -12
- package/build/src/v1beta/search_service_client.js +451 -8
- package/build/src/v1beta/search_tuning_service_client.d.ts +237 -0
- package/build/src/v1beta/search_tuning_service_client.js +339 -0
- package/build/src/v1beta/serving_config_service_client.d.ts +237 -0
- package/build/src/v1beta/serving_config_service_client.js +333 -0
- package/build/src/v1beta/site_search_engine_service_client.d.ts +237 -0
- package/build/src/v1beta/site_search_engine_service_client.js +339 -0
- package/build/src/v1beta/user_event_service_client.d.ts +312 -0
- package/build/src/v1beta/user_event_service_client.js +381 -0
- package/build/src/v1beta/user_event_service_client_config.json +5 -0
- package/package.json +1 -1
@@ -0,0 +1,119 @@
|
|
1
|
+
// Copyright 2024 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.v1beta;
|
18
|
+
|
19
|
+
import "google/api/field_behavior.proto";
|
20
|
+
import "google/api/resource.proto";
|
21
|
+
import "google/protobuf/struct.proto";
|
22
|
+
|
23
|
+
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
|
24
|
+
option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
|
25
|
+
option java_multiple_files = true;
|
26
|
+
option java_outer_classname = "ChunkProto";
|
27
|
+
option java_package = "com.google.cloud.discoveryengine.v1beta";
|
28
|
+
option objc_class_prefix = "DISCOVERYENGINE";
|
29
|
+
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
|
30
|
+
option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
|
31
|
+
|
32
|
+
// Chunk captures all raw metadata information of items to be recommended or
|
33
|
+
// searched in the chunk mode.
|
34
|
+
message Chunk {
|
35
|
+
option (google.api.resource) = {
|
36
|
+
type: "discoveryengine.googleapis.com/Chunk"
|
37
|
+
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}"
|
38
|
+
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}"
|
39
|
+
};
|
40
|
+
|
41
|
+
// Document metadata contains the information of the document of the current
|
42
|
+
// chunk.
|
43
|
+
message DocumentMetadata {
|
44
|
+
// Uri of the document.
|
45
|
+
string uri = 1;
|
46
|
+
|
47
|
+
// Title of the document.
|
48
|
+
string title = 2;
|
49
|
+
|
50
|
+
// Data representation.
|
51
|
+
// The structured JSON data for the document. It should conform to the
|
52
|
+
// registered [Schema][google.cloud.discoveryengine.v1beta.Schema] or an
|
53
|
+
// `INVALID_ARGUMENT` error is thrown.
|
54
|
+
google.protobuf.Struct struct_data = 3;
|
55
|
+
}
|
56
|
+
|
57
|
+
// Page span of the chunk.
|
58
|
+
message PageSpan {
|
59
|
+
// The start page of the chunk.
|
60
|
+
int32 page_start = 1;
|
61
|
+
|
62
|
+
// The end page of the chunk.
|
63
|
+
int32 page_end = 2;
|
64
|
+
}
|
65
|
+
|
66
|
+
// Metadata of the current chunk. This field is only populated on
|
67
|
+
// [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
|
68
|
+
// API.
|
69
|
+
message ChunkMetadata {
|
70
|
+
// The previous chunks of the current chunk. The number is controlled by
|
71
|
+
// [SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks][google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ChunkSpec.num_previous_chunks].
|
72
|
+
// This field is only populated on
|
73
|
+
// [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
|
74
|
+
// API.
|
75
|
+
repeated Chunk previous_chunks = 1;
|
76
|
+
|
77
|
+
// The next chunks of the current chunk. The number is controlled by
|
78
|
+
// [SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks][google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.ChunkSpec.num_next_chunks].
|
79
|
+
// This field is only populated on
|
80
|
+
// [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
|
81
|
+
// API.
|
82
|
+
repeated Chunk next_chunks = 2;
|
83
|
+
}
|
84
|
+
|
85
|
+
// The full resource name of the chunk.
|
86
|
+
// Format:
|
87
|
+
// `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document_id}/chunks/{chunk_id}`.
|
88
|
+
//
|
89
|
+
// This field must be a UTF-8 encoded string with a length limit of 1024
|
90
|
+
// characters.
|
91
|
+
string name = 1;
|
92
|
+
|
93
|
+
// Unique chunk ID of the current chunk.
|
94
|
+
string id = 2;
|
95
|
+
|
96
|
+
// Content is a string from a document (parsed content).
|
97
|
+
string content = 3;
|
98
|
+
|
99
|
+
// Output only. Represents the relevance score based on similarity.
|
100
|
+
// Higher score indicates higher chunk relevance.
|
101
|
+
// The score is in range [-1.0, 1.0].
|
102
|
+
// Only populated on [SearchService.SearchResponse][].
|
103
|
+
optional double relevance_score = 8
|
104
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
105
|
+
|
106
|
+
// Metadata of the document from the current chunk.
|
107
|
+
DocumentMetadata document_metadata = 5;
|
108
|
+
|
109
|
+
// Output only. This field is OUTPUT_ONLY.
|
110
|
+
// It contains derived data that are not in the original input document.
|
111
|
+
google.protobuf.Struct derived_struct_data = 4
|
112
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
113
|
+
|
114
|
+
// Page span of the chunk.
|
115
|
+
PageSpan page_span = 6;
|
116
|
+
|
117
|
+
// Output only. Metadata of the current chunk.
|
118
|
+
ChunkMetadata chunk_metadata = 7 [(google.api.field_behavior) = OUTPUT_ONLY];
|
119
|
+
}
|
@@ -51,11 +51,6 @@ option (google.api.resource_definition) = {
|
|
51
51
|
type: "healthcare.googleapis.com/FhirStore"
|
52
52
|
pattern: "projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}"
|
53
53
|
};
|
54
|
-
option (google.api.resource_definition) = {
|
55
|
-
type: "discoveryengine.googleapis.com/Chunk"
|
56
|
-
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}"
|
57
|
-
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}/chunks/{chunk}"
|
58
|
-
};
|
59
54
|
|
60
55
|
// The industry vertical associated with the
|
61
56
|
// [DataStore][google.cloud.discoveryengine.v1beta.DataStore].
|
@@ -50,3 +50,34 @@ message SuggestionDenyListEntry {
|
|
50
50
|
// exact phrase, or block any suggestions containing this phrase.
|
51
51
|
MatchOperator match_operator = 2 [(google.api.field_behavior) = REQUIRED];
|
52
52
|
}
|
53
|
+
|
54
|
+
// Autocomplete suggestions that are imported from Customer.
|
55
|
+
message CompletionSuggestion {
|
56
|
+
// Ranking metrics of this suggestion.
|
57
|
+
oneof ranking_info {
|
58
|
+
// Global score of this suggestion. Control how this suggestion would be
|
59
|
+
// scored / ranked.
|
60
|
+
double global_score = 2;
|
61
|
+
|
62
|
+
// Frequency of this suggestion. Will be used to rank suggestions when score
|
63
|
+
// is not available.
|
64
|
+
int64 frequency = 3;
|
65
|
+
}
|
66
|
+
|
67
|
+
// Required. The suggestion text.
|
68
|
+
string suggestion = 1 [(google.api.field_behavior) = REQUIRED];
|
69
|
+
|
70
|
+
// BCP-47 language code of this suggestion.
|
71
|
+
string language_code = 4;
|
72
|
+
|
73
|
+
// If two suggestions have the same groupId, they will not be
|
74
|
+
// returned together. Instead the one ranked higher will be returned. This can
|
75
|
+
// be used to deduplicate semantically identical suggestions.
|
76
|
+
string group_id = 5;
|
77
|
+
|
78
|
+
// The score of this suggestion within its group.
|
79
|
+
double group_score = 6;
|
80
|
+
|
81
|
+
// Alternative matching phrases for this suggestion.
|
82
|
+
repeated string alternative_phrases = 7;
|
83
|
+
}
|
@@ -86,6 +86,44 @@ service CompletionService {
|
|
86
86
|
metadata_type: "google.cloud.discoveryengine.v1beta.PurgeSuggestionDenyListEntriesMetadata"
|
87
87
|
};
|
88
88
|
}
|
89
|
+
|
90
|
+
// Imports
|
91
|
+
// [CompletionSuggestion][google.cloud.discoveryengine.v1beta.CompletionSuggestion]s
|
92
|
+
// for a DataStore.
|
93
|
+
rpc ImportCompletionSuggestions(ImportCompletionSuggestionsRequest)
|
94
|
+
returns (google.longrunning.Operation) {
|
95
|
+
option (google.api.http) = {
|
96
|
+
post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/completionSuggestions:import"
|
97
|
+
body: "*"
|
98
|
+
additional_bindings {
|
99
|
+
post: "/v1beta/{parent=projects/*/locations/*/dataStores/*}/completionSuggestions:import"
|
100
|
+
body: "*"
|
101
|
+
}
|
102
|
+
};
|
103
|
+
option (google.longrunning.operation_info) = {
|
104
|
+
response_type: "google.cloud.discoveryengine.v1beta.ImportCompletionSuggestionsResponse"
|
105
|
+
metadata_type: "google.cloud.discoveryengine.v1beta.ImportCompletionSuggestionsMetadata"
|
106
|
+
};
|
107
|
+
}
|
108
|
+
|
109
|
+
// Permanently deletes all
|
110
|
+
// [CompletionSuggestion][google.cloud.discoveryengine.v1beta.CompletionSuggestion]s
|
111
|
+
// for a DataStore.
|
112
|
+
rpc PurgeCompletionSuggestions(PurgeCompletionSuggestionsRequest)
|
113
|
+
returns (google.longrunning.Operation) {
|
114
|
+
option (google.api.http) = {
|
115
|
+
post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/completionSuggestions:purge"
|
116
|
+
body: "*"
|
117
|
+
additional_bindings {
|
118
|
+
post: "/v1beta/{parent=projects/*/locations/*/dataStores/*}/completionSuggestions:purge"
|
119
|
+
body: "*"
|
120
|
+
}
|
121
|
+
};
|
122
|
+
option (google.longrunning.operation_info) = {
|
123
|
+
response_type: "google.cloud.discoveryengine.v1beta.PurgeCompletionSuggestionsResponse"
|
124
|
+
metadata_type: "google.cloud.discoveryengine.v1beta.PurgeCompletionSuggestionsMetadata"
|
125
|
+
};
|
126
|
+
}
|
89
127
|
}
|
90
128
|
|
91
129
|
// Request message for
|
package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto
CHANGED
@@ -587,6 +587,12 @@ message AnswerQueryRequest {
|
|
587
587
|
// If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
|
588
588
|
string order_by = 4;
|
589
589
|
|
590
|
+
// Specifies the search result mode. If unspecified, the
|
591
|
+
// search result mode defaults to `DOCUMENTS`.
|
592
|
+
// See [parse and chunk
|
593
|
+
// documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
|
594
|
+
SearchRequest.ContentSearchSpec.SearchResultMode search_result_mode = 5;
|
595
|
+
|
590
596
|
// Specs defining dataStores to filter on in a search call and
|
591
597
|
// configurations for those dataStores. This is only considered for
|
592
598
|
// engines with multiple dataStores use case. For single dataStore within
|
@@ -786,6 +792,25 @@ message AnswerQueryRequest {
|
|
786
792
|
// The field must be a UTF-8 encoded string with a length limit of 128
|
787
793
|
// characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
788
794
|
string user_pseudo_id = 12;
|
795
|
+
|
796
|
+
// The user labels applied to a resource must meet the following requirements:
|
797
|
+
//
|
798
|
+
// * Each resource can have multiple labels, up to a maximum of 64.
|
799
|
+
// * Each label must be a key-value pair.
|
800
|
+
// * Keys have a minimum length of 1 character and a maximum length of 63
|
801
|
+
// characters and cannot be empty. Values can be empty and have a maximum
|
802
|
+
// length of 63 characters.
|
803
|
+
// * Keys and values can contain only lowercase letters, numeric characters,
|
804
|
+
// underscores, and dashes. All characters must use UTF-8 encoding, and
|
805
|
+
// international characters are allowed.
|
806
|
+
// * The key portion of a label must be unique. However, you can use the same
|
807
|
+
// key with multiple resources.
|
808
|
+
// * Keys must start with a lowercase letter or international character.
|
809
|
+
//
|
810
|
+
// See [Google Cloud
|
811
|
+
// Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
812
|
+
// for more details.
|
813
|
+
map<string, string> user_labels = 13;
|
789
814
|
}
|
790
815
|
|
791
816
|
// Response message for
|
@@ -793,8 +818,10 @@ message AnswerQueryRequest {
|
|
793
818
|
// method.
|
794
819
|
message AnswerQueryResponse {
|
795
820
|
// Answer resource object.
|
796
|
-
// If
|
797
|
-
//
|
821
|
+
// If
|
822
|
+
// [AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps][google.cloud.discoveryengine.v1beta.AnswerQueryRequest.QueryUnderstandingSpec.QueryRephraserSpec.max_rephrase_steps]
|
823
|
+
// is greater than 1, use
|
824
|
+
// [Answer.name][google.cloud.discoveryengine.v1beta.Answer.name] to fetch
|
798
825
|
// answer information using
|
799
826
|
// [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1beta.ConversationalSearchService.GetAnswer]
|
800
827
|
// API.
|
@@ -56,6 +56,9 @@ message CustomTuningModel {
|
|
56
56
|
|
57
57
|
// The model training failed.
|
58
58
|
TRAINING_FAILED = 5;
|
59
|
+
|
60
|
+
// The model training finished successfully but metrics did not improve.
|
61
|
+
NO_IMPROVEMENT = 6;
|
59
62
|
}
|
60
63
|
|
61
64
|
// Required. The fully qualified resource name of the model.
|
@@ -80,8 +83,11 @@ message CustomTuningModel {
|
|
80
83
|
ModelState model_state = 4;
|
81
84
|
|
82
85
|
// Timestamp the Model was created at.
|
83
|
-
google.protobuf.Timestamp create_time = 5;
|
86
|
+
google.protobuf.Timestamp create_time = 5 [deprecated = true];
|
84
87
|
|
85
88
|
// Timestamp the model training was initiated.
|
86
89
|
google.protobuf.Timestamp training_start_time = 6;
|
90
|
+
|
91
|
+
// The metrics of the trained model.
|
92
|
+
map<string, double> metrics = 7;
|
87
93
|
}
|
@@ -98,6 +98,9 @@ message DataStore {
|
|
98
98
|
google.protobuf.Timestamp create_time = 4
|
99
99
|
[(google.api.field_behavior) = OUTPUT_ONLY];
|
100
100
|
|
101
|
+
// Language info for DataStore.
|
102
|
+
LanguageInfo language_info = 14;
|
103
|
+
|
101
104
|
// Configuration for Document understanding and enrichment.
|
102
105
|
DocumentProcessingConfig document_processing_config = 27;
|
103
106
|
|
@@ -118,3 +121,23 @@ message DataStore {
|
|
118
121
|
// doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema).
|
119
122
|
Schema starting_schema = 28;
|
120
123
|
}
|
124
|
+
|
125
|
+
// Language info for DataStore.
|
126
|
+
message LanguageInfo {
|
127
|
+
// The language code for the DataStore.
|
128
|
+
string language_code = 1;
|
129
|
+
|
130
|
+
// Output only. This is the normalized form of language_code.
|
131
|
+
// E.g.: language_code of `en-GB`, `en_GB`, `en-UK` or `en-gb`
|
132
|
+
// will have normalized_language_code of `en-GB`.
|
133
|
+
string normalized_language_code = 2
|
134
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
135
|
+
|
136
|
+
// Output only. Language part of normalized_language_code.
|
137
|
+
// E.g.: `en-US` -> `en`, `zh-Hans-HK` -> `zh`, `en` -> `en`.
|
138
|
+
string language = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
|
139
|
+
|
140
|
+
// Output only. Region part of normalized_language_code, if present.
|
141
|
+
// E.g.: `en-US` -> `US`, `zh-Hans-HK` -> `HK`, `en` -> ``.
|
142
|
+
string region = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
|
143
|
+
}
|
@@ -152,6 +152,16 @@ message CreateDataStoreRequest {
|
|
152
152
|
// search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
|
153
153
|
// be ignored.
|
154
154
|
bool create_advanced_site_search = 4;
|
155
|
+
|
156
|
+
// A boolean flag indicating whether to skip the default schema creation for
|
157
|
+
// the data store. Only enable this flag if you are certain that the default
|
158
|
+
// schema is incompatible with your use case.
|
159
|
+
//
|
160
|
+
// If set to true, you must manually create a schema for the data store before
|
161
|
+
// any documents can be ingested.
|
162
|
+
//
|
163
|
+
// This flag cannot be specified if `data_store.starting_schema` is specified.
|
164
|
+
bool skip_default_schema_creation = 7;
|
155
165
|
}
|
156
166
|
|
157
167
|
// Request message for
|
@@ -54,7 +54,7 @@ message Document {
|
|
54
54
|
|
55
55
|
// The URI of the content. Only Cloud Storage URIs (e.g.
|
56
56
|
// `gs://bucket-name/path/to/file`) are supported. The maximum file size
|
57
|
-
// is 2.5 MB for text-based formats,
|
57
|
+
// is 2.5 MB for text-based formats, 200 MB for other formats.
|
58
58
|
string uri = 3;
|
59
59
|
}
|
60
60
|
|
@@ -41,6 +41,30 @@ message DocumentProcessingConfig {
|
|
41
41
|
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/documentProcessingConfig"
|
42
42
|
};
|
43
43
|
|
44
|
+
// Configuration for chunking config.
|
45
|
+
message ChunkingConfig {
|
46
|
+
// Configuration for the layout based chunking.
|
47
|
+
message LayoutBasedChunkingConfig {
|
48
|
+
// The token size limit for each chunk.
|
49
|
+
//
|
50
|
+
// Supported values: 100-500 (inclusive).
|
51
|
+
// Default value: 500.
|
52
|
+
int32 chunk_size = 1;
|
53
|
+
|
54
|
+
// Whether to include appending different levels of headings to chunks
|
55
|
+
// from the middle of the document to prevent context loss.
|
56
|
+
//
|
57
|
+
// Default value: False.
|
58
|
+
bool include_ancestor_headings = 2;
|
59
|
+
}
|
60
|
+
|
61
|
+
// Additional configs that defines the behavior of the chunking.
|
62
|
+
oneof chunk_mode {
|
63
|
+
// Configuration for the layout based chunking.
|
64
|
+
LayoutBasedChunkingConfig layout_based_chunking_config = 1;
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
44
68
|
// Related configurations applied to a specific type of document parser.
|
45
69
|
message ParsingConfig {
|
46
70
|
// The digital parsing configurations for documents.
|
@@ -57,6 +81,9 @@ message DocumentProcessingConfig {
|
|
57
81
|
bool use_native_text = 2;
|
58
82
|
}
|
59
83
|
|
84
|
+
// The layout parsing configurations for documents.
|
85
|
+
message LayoutParsingConfig {}
|
86
|
+
|
60
87
|
// Configs for document processing types.
|
61
88
|
oneof type_dedicated_config {
|
62
89
|
// Configurations applied to digital parser.
|
@@ -65,6 +92,9 @@ message DocumentProcessingConfig {
|
|
65
92
|
// Configurations applied to OCR parser. Currently it only applies to
|
66
93
|
// PDFs.
|
67
94
|
OcrParsingConfig ocr_parsing_config = 2;
|
95
|
+
|
96
|
+
// Configurations applied to layout parser.
|
97
|
+
LayoutParsingConfig layout_parsing_config = 3;
|
68
98
|
}
|
69
99
|
}
|
70
100
|
|
@@ -73,6 +103,9 @@ message DocumentProcessingConfig {
|
|
73
103
|
// `projects/*/locations/*/collections/*/dataStores/*/documentProcessingConfig`.
|
74
104
|
string name = 1;
|
75
105
|
|
106
|
+
// Whether chunking mode is enabled.
|
107
|
+
ChunkingConfig chunking_config = 3;
|
108
|
+
|
76
109
|
// Configurations for default Document parser.
|
77
110
|
// If not specified, we will configure it as default DigitalParsingConfig, and
|
78
111
|
// the default parsing config will be applied to all file types for Document
|
@@ -85,8 +118,10 @@ message DocumentProcessingConfig {
|
|
85
118
|
// * `pdf`: Override parsing config for PDF files, either digital parsing, ocr
|
86
119
|
// parsing or layout parsing is supported.
|
87
120
|
// * `html`: Override parsing config for HTML files, only digital parsing and
|
88
|
-
//
|
121
|
+
// layout parsing are supported.
|
89
122
|
// * `docx`: Override parsing config for DOCX files, only digital parsing and
|
90
|
-
//
|
123
|
+
// layout parsing are supported.
|
124
|
+
// * `pptx`: Override parsing config for PPTX files, only digital parsing and
|
125
|
+
// layout parsing are supported.
|
91
126
|
map<string, ParsingConfig> parsing_config_overrides = 5;
|
92
127
|
}
|
@@ -0,0 +1,231 @@
|
|
1
|
+
// Copyright 2024 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.v1beta;
|
18
|
+
|
19
|
+
import "google/api/field_behavior.proto";
|
20
|
+
import "google/api/resource.proto";
|
21
|
+
import "google/cloud/discoveryengine/v1beta/search_service.proto";
|
22
|
+
import "google/protobuf/timestamp.proto";
|
23
|
+
import "google/rpc/status.proto";
|
24
|
+
|
25
|
+
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
|
26
|
+
option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
|
27
|
+
option java_multiple_files = true;
|
28
|
+
option java_outer_classname = "EvaluationProto";
|
29
|
+
option java_package = "com.google.cloud.discoveryengine.v1beta";
|
30
|
+
option objc_class_prefix = "DISCOVERYENGINE";
|
31
|
+
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
|
32
|
+
option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
|
33
|
+
|
34
|
+
// An evaluation is a single execution (or run) of an evaluation process. It
|
35
|
+
// encapsulates the state of the evaluation and the resulting data.
|
36
|
+
message Evaluation {
|
37
|
+
option (google.api.resource) = {
|
38
|
+
type: "discoveryengine.googleapis.com/Evaluation"
|
39
|
+
pattern: "projects/{project}/locations/{location}/evaluations/{evaluation}"
|
40
|
+
};
|
41
|
+
|
42
|
+
// Describes the specification of the evaluation.
|
43
|
+
message EvaluationSpec {
|
44
|
+
// Describes the specification of the query set.
|
45
|
+
message QuerySetSpec {
|
46
|
+
// Required. The full resource name of the
|
47
|
+
// [SampleQuerySet][google.cloud.discoveryengine.v1beta.SampleQuerySet]
|
48
|
+
// used for the evaluation, in the format of
|
49
|
+
// `projects/{project}/locations/{location}/sampleQuerySets/{sampleQuerySet}`.
|
50
|
+
string sample_query_set = 1 [
|
51
|
+
(google.api.field_behavior) = REQUIRED,
|
52
|
+
(google.api.resource_reference) = {
|
53
|
+
type: "discoveryengine.googleapis.com/SampleQuerySet"
|
54
|
+
}
|
55
|
+
];
|
56
|
+
}
|
57
|
+
|
58
|
+
// The search specification.
|
59
|
+
oneof search_spec {
|
60
|
+
// Required. The search request that is used to perform the evaluation.
|
61
|
+
//
|
62
|
+
// Only the following fields within SearchRequest are supported; if any
|
63
|
+
// other fields are provided, an UNSUPPORTED error will be returned:
|
64
|
+
//
|
65
|
+
// * [SearchRequest.serving_config][google.cloud.discoveryengine.v1beta.SearchRequest.serving_config]
|
66
|
+
// * [SearchRequest.branch][google.cloud.discoveryengine.v1beta.SearchRequest.branch]
|
67
|
+
// * [SearchRequest.canonical_filter][google.cloud.discoveryengine.v1beta.SearchRequest.canonical_filter]
|
68
|
+
// * [SearchRequest.query_expansion_spec][google.cloud.discoveryengine.v1beta.SearchRequest.query_expansion_spec]
|
69
|
+
// * [SearchRequest.spell_correction_spec][google.cloud.discoveryengine.v1beta.SearchRequest.spell_correction_spec]
|
70
|
+
// * [SearchRequest.content_search_spec][google.cloud.discoveryengine.v1beta.SearchRequest.content_search_spec]
|
71
|
+
// * [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.SearchRequest.user_pseudo_id]
|
72
|
+
SearchRequest search_request = 2 [(google.api.field_behavior) = REQUIRED];
|
73
|
+
}
|
74
|
+
|
75
|
+
// Required. The specification of the query set.
|
76
|
+
QuerySetSpec query_set_spec = 1 [(google.api.field_behavior) = REQUIRED];
|
77
|
+
}
|
78
|
+
|
79
|
+
// Describes the state of an evaluation.
|
80
|
+
enum State {
|
81
|
+
// The evaluation is unspecified.
|
82
|
+
STATE_UNSPECIFIED = 0;
|
83
|
+
|
84
|
+
// The service is preparing to run the evaluation.
|
85
|
+
PENDING = 1;
|
86
|
+
|
87
|
+
// The evaluation is in progress.
|
88
|
+
RUNNING = 2;
|
89
|
+
|
90
|
+
// The evaluation completed successfully.
|
91
|
+
SUCCEEDED = 3;
|
92
|
+
|
93
|
+
// The evaluation failed.
|
94
|
+
FAILED = 4;
|
95
|
+
}
|
96
|
+
|
97
|
+
// Identifier. The full resource name of the
|
98
|
+
// [Evaluation][google.cloud.discoveryengine.v1beta.Evaluation], in the format
|
99
|
+
// of `projects/{project}/locations/{location}/evaluations/{evaluation}`.
|
100
|
+
//
|
101
|
+
// This field must be a UTF-8 encoded string with a length limit of 1024
|
102
|
+
// characters.
|
103
|
+
string name = 1 [(google.api.field_behavior) = IDENTIFIER];
|
104
|
+
|
105
|
+
// Required. The specification of the evaluation.
|
106
|
+
EvaluationSpec evaluation_spec = 2 [(google.api.field_behavior) = REQUIRED];
|
107
|
+
|
108
|
+
// Output only. The metrics produced by the evaluation, averaged across all
|
109
|
+
// [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]s in the
|
110
|
+
// [SampleQuerySet][google.cloud.discoveryengine.v1beta.SampleQuerySet].
|
111
|
+
//
|
112
|
+
// Only populated when the evaluation's state is SUCCEEDED.
|
113
|
+
QualityMetrics quality_metrics = 3
|
114
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
115
|
+
|
116
|
+
// Output only. The state of the evaluation.
|
117
|
+
State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
|
118
|
+
|
119
|
+
// Output only. The error that occurred during evaluation. Only populated when
|
120
|
+
// the evaluation's state is FAILED.
|
121
|
+
google.rpc.Status error = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
|
122
|
+
|
123
|
+
// Output only. Timestamp the
|
124
|
+
// [Evaluation][google.cloud.discoveryengine.v1beta.Evaluation] was created
|
125
|
+
// at.
|
126
|
+
google.protobuf.Timestamp create_time = 6
|
127
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
128
|
+
|
129
|
+
// Output only. Timestamp the
|
130
|
+
// [Evaluation][google.cloud.discoveryengine.v1beta.Evaluation] was completed
|
131
|
+
// at.
|
132
|
+
google.protobuf.Timestamp end_time = 7
|
133
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
134
|
+
|
135
|
+
// Output only. A sample of errors encountered while processing the request.
|
136
|
+
repeated google.rpc.Status error_samples = 8
|
137
|
+
[(google.api.field_behavior) = OUTPUT_ONLY];
|
138
|
+
}
|
139
|
+
|
140
|
+
// Describes the metrics produced by the evaluation.
|
141
|
+
message QualityMetrics {
|
142
|
+
// Stores the metric values at specific top-k levels.
|
143
|
+
message TopkMetrics {
|
144
|
+
// The top-1 value.
|
145
|
+
double top_1 = 1;
|
146
|
+
|
147
|
+
// The top-3 value.
|
148
|
+
double top_3 = 2;
|
149
|
+
|
150
|
+
// The top-5 value.
|
151
|
+
double top_5 = 3;
|
152
|
+
|
153
|
+
// The top-10 value.
|
154
|
+
double top_10 = 4;
|
155
|
+
}
|
156
|
+
|
157
|
+
// Recall per document, at various top-k cutoff levels.
|
158
|
+
//
|
159
|
+
// Recall is the fraction of relevant documents retrieved out of all
|
160
|
+
// relevant documents.
|
161
|
+
//
|
162
|
+
// Example (top-5):
|
163
|
+
// * For a single
|
164
|
+
// [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], If 3 out
|
165
|
+
// of 5 relevant documents are retrieved in the top-5, recall@5 = 3/5 = 0.6
|
166
|
+
TopkMetrics doc_recall = 1;
|
167
|
+
|
168
|
+
// Precision per document, at various top-k cutoff levels.
|
169
|
+
//
|
170
|
+
// Precision is the fraction of retrieved documents that are relevant.
|
171
|
+
//
|
172
|
+
// Example (top-5):
|
173
|
+
// * For a single
|
174
|
+
// [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], If 4 out
|
175
|
+
// of 5 retrieved documents in the top-5 are relevant, precision@5 = 4/5 =
|
176
|
+
// 0.8
|
177
|
+
TopkMetrics doc_precision = 2;
|
178
|
+
|
179
|
+
// Normalized discounted cumulative gain (NDCG) per document, at various top-k
|
180
|
+
// cutoff levels.
|
181
|
+
//
|
182
|
+
// NDCG measures the ranking quality, giving higher relevance to top
|
183
|
+
// results.
|
184
|
+
//
|
185
|
+
// Example (top-3):
|
186
|
+
// Suppose [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]
|
187
|
+
// with three retrieved documents (D1, D2, D3) and binary relevance
|
188
|
+
// judgements (1 for relevant, 0 for not relevant):
|
189
|
+
//
|
190
|
+
// Retrieved: [D3 (0), D1 (1), D2 (1)]
|
191
|
+
// Ideal: [D1 (1), D2 (1), D3 (0)]
|
192
|
+
//
|
193
|
+
// Calculate NDCG@3 for each
|
194
|
+
// [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]:
|
195
|
+
// * DCG@3: 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13
|
196
|
+
// * Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + 0/log2(3+1) = 1.63
|
197
|
+
// * NDCG@3: 1.13/1.63 = 0.693
|
198
|
+
TopkMetrics doc_ndcg = 3;
|
199
|
+
|
200
|
+
// Recall per page, at various top-k cutoff levels.
|
201
|
+
//
|
202
|
+
// Recall is the fraction of relevant pages retrieved out of all relevant
|
203
|
+
// pages.
|
204
|
+
//
|
205
|
+
// Example (top-5):
|
206
|
+
// * For a single
|
207
|
+
// [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery], if 3 out
|
208
|
+
// of 5 relevant pages are retrieved in the top-5, recall@5 = 3/5 = 0.6
|
209
|
+
TopkMetrics page_recall = 4;
|
210
|
+
|
211
|
+
// Normalized discounted cumulative gain (NDCG) per page, at various top-k
|
212
|
+
// cutoff levels.
|
213
|
+
//
|
214
|
+
// NDCG measures the ranking quality, giving higher relevance to top
|
215
|
+
// results.
|
216
|
+
//
|
217
|
+
// Example (top-3):
|
218
|
+
// Suppose [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]
|
219
|
+
// with three retrieved pages (P1, P2, P3) and binary relevance judgements (1
|
220
|
+
// for relevant, 0 for not relevant):
|
221
|
+
//
|
222
|
+
// Retrieved: [P3 (0), P1 (1), P2 (1)]
|
223
|
+
// Ideal: [P1 (1), P2 (1), P3 (0)]
|
224
|
+
//
|
225
|
+
// Calculate NDCG@3 for
|
226
|
+
// [SampleQuery][google.cloud.discoveryengine.v1beta.SampleQuery]:
|
227
|
+
// * DCG@3: 0/log2(1+1) + 1/log2(2+1) + 1/log2(3+1) = 1.13
|
228
|
+
// * Ideal DCG@3: 1/log2(1+1) + 1/log2(2+1) + 0/log2(3+1) = 1.63
|
229
|
+
// * NDCG@3: 1.13/1.63 = 0.693
|
230
|
+
TopkMetrics page_ndcg = 5;
|
231
|
+
}
|