Skip to content

Commit fa4e75b

Browse files
Google APIscopybara-github
authored andcommitted
feat: Update CompletionService
feat: Update SearchService docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 655276517
1 parent cead733 commit fa4e75b

13 files changed

Lines changed: 690 additions & 2 deletions

google/cloud/discoveryengine/v1beta/BUILD.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,6 @@ load(
423423

424424
csharp_proto_library(
425425
name = "discoveryengine_csharp_proto",
426-
extra_opts = [],
427426
deps = [":discoveryengine_proto"],
428427
)
429428

google/cloud/discoveryengine/v1beta/answer.proto

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,14 @@ message Answer {
188188
// If citation_type is CHUNK_LEVEL_CITATION and chunk mode is on,
189189
// populate chunk info.
190190
repeated ChunkInfo chunk_info = 5;
191+
192+
// Data representation.
193+
// The structured JSON data for the document.
194+
// It's populated from the struct data from the Document
195+
// , or the Chunk in
196+
// search result
197+
// .
198+
google.protobuf.Struct struct_data = 6;
191199
}
192200

193201
// Search results observed by the search action, it can be snippets info
@@ -296,6 +304,12 @@ message Answer {
296304
// Google skips the answer if there is a potential policy violation
297305
// detected. This includes content that may be violent or toxic.
298306
POTENTIAL_POLICY_VIOLATION = 4;
307+
308+
// The no relevant content case.
309+
//
310+
// Google skips the answer if there is no relevant content in the
311+
// retrieved search results.
312+
NO_RELEVANT_CONTENT = 5;
299313
}
300314

301315
// Immutable. Fully qualified name

google/cloud/discoveryengine/v1beta/completion.proto

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,34 @@ message SuggestionDenyListEntry {
5050
// exact phrase, or block any suggestions containing this phrase.
5151
MatchOperator match_operator = 2 [(google.api.field_behavior) = REQUIRED];
5252
}
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+
}

google/cloud/discoveryengine/v1beta/completion_service.proto

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,44 @@ service CompletionService {
8686
metadata_type: "google.cloud.discoveryengine.v1beta.PurgeSuggestionDenyListEntriesMetadata"
8787
};
8888
}
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+
}
89127
}
90128

91129
// Request message for

google/cloud/discoveryengine/v1beta/conversational_search_service.proto

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -792,6 +792,25 @@ message AnswerQueryRequest {
792792
// The field must be a UTF-8 encoded string with a length limit of 128
793793
// characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
794794
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;
795814
}
796815

797816
// Response message for

google/cloud/discoveryengine/v1beta/custom_tuning_model.proto

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ message CustomTuningModel {
5656

5757
// The model training failed.
5858
TRAINING_FAILED = 5;
59+
60+
// The model training finished successfully but metrics did not improve.
61+
NO_IMPROVEMENT = 6;
5962
}
6063

6164
// Required. The fully qualified resource name of the model.
@@ -80,8 +83,11 @@ message CustomTuningModel {
8083
ModelState model_state = 4;
8184

8285
// Timestamp the Model was created at.
83-
google.protobuf.Timestamp create_time = 5;
86+
google.protobuf.Timestamp create_time = 5 [deprecated = true];
8487

8588
// Timestamp the model training was initiated.
8689
google.protobuf.Timestamp training_start_time = 6;
90+
91+
// The metrics of the trained model.
92+
map<string, double> metrics = 7;
8793
}

google/cloud/discoveryengine/v1beta/data_store.proto

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,9 @@ message DataStore {
9898
google.protobuf.Timestamp create_time = 4
9999
[(google.api.field_behavior) = OUTPUT_ONLY];
100100

101+
// Language info for DataStore.
102+
LanguageInfo language_info = 14;
103+
101104
// Configuration for Document understanding and enrichment.
102105
DocumentProcessingConfig document_processing_config = 27;
103106

@@ -118,3 +121,23 @@ message DataStore {
118121
// doc](https://cloud.google.com/generative-ai-app-builder/docs/provide-schema).
119122
Schema starting_schema = 28;
120123
}
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+
}

google/cloud/discoveryengine/v1beta/data_store_service.proto

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ message CreateDataStoreRequest {
152152
// search (GENERIC vertical and PUBLIC_WEBSITE content_config), this flag will
153153
// be ignored.
154154
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;
155165
}
156166

157167
// Request message for

google/cloud/discoveryengine/v1beta/discoveryengine_v1beta.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ types:
4747
- name: google.cloud.discoveryengine.v1beta.EnableAdvancedSiteSearchResponse
4848
- name: google.cloud.discoveryengine.v1beta.Engine
4949
- name: google.cloud.discoveryengine.v1beta.Evaluation
50+
- name: google.cloud.discoveryengine.v1beta.ImportCompletionSuggestionsMetadata
51+
- name: google.cloud.discoveryengine.v1beta.ImportCompletionSuggestionsResponse
5052
- name: google.cloud.discoveryengine.v1beta.ImportDocumentsMetadata
5153
- name: google.cloud.discoveryengine.v1beta.ImportDocumentsResponse
5254
- name: google.cloud.discoveryengine.v1beta.ImportSampleQueriesMetadata

google/cloud/discoveryengine/v1beta/import_config.proto

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,38 @@ message CloudSqlSource {
327327
bool offload = 6;
328328
}
329329

330+
// AlloyDB source import data from.
331+
message AlloyDbSource {
332+
// The project ID that the AlloyDB source is in
333+
// with a length limit of 128 characters. If not specified, inherits the
334+
// project ID from the parent request.
335+
string project_id = 1;
336+
337+
// Required. The AlloyDB location to copy the data from with a length limit of
338+
// 256 characters.
339+
string location_id = 2 [(google.api.field_behavior) = REQUIRED];
340+
341+
// Required. The AlloyDB cluster to copy the data from with a length limit of
342+
// 256 characters.
343+
string cluster_id = 3 [(google.api.field_behavior) = REQUIRED];
344+
345+
// Required. The AlloyDB database to copy the data from with a length limit of
346+
// 256 characters.
347+
string database_id = 4 [(google.api.field_behavior) = REQUIRED];
348+
349+
// Required. The AlloyDB table to copy the data from with a length limit of
350+
// 256 characters.
351+
string table_id = 5 [(google.api.field_behavior) = REQUIRED];
352+
353+
// Intermediate Cloud Storage directory used for the import with a length
354+
// limit of 2,000 characters. Can be specified if one wants to have the
355+
// AlloyDB export to a specific Cloud Storage directory.
356+
//
357+
// Ensure that the AlloyDB service account has the necessary Cloud
358+
// Storage Admin permissions to access the specified Cloud Storage directory.
359+
string gcs_staging_dir = 6;
360+
}
361+
330362
// Firestore source import data from.
331363
message FirestoreSource {
332364
// The project ID that the Cloud SQL source is in with a length limit of 128
@@ -500,6 +532,9 @@ message ImportDocumentsRequest {
500532
// Firestore input source.
501533
FirestoreSource firestore_source = 13;
502534

535+
// AlloyDB input source.
536+
AlloyDbSource alloy_db_source = 14;
537+
503538
// Cloud Bigtable input source.
504539
BigtableSource bigtable_source = 15;
505540
}
@@ -665,6 +700,79 @@ message ImportSuggestionDenyListEntriesMetadata {
665700
google.protobuf.Timestamp update_time = 2;
666701
}
667702

703+
// Request message for
704+
// [CompletionService.ImportCompletionSuggestions][google.cloud.discoveryengine.v1beta.CompletionService.ImportCompletionSuggestions]
705+
// method.
706+
message ImportCompletionSuggestionsRequest {
707+
// The inline source for CompletionSuggestions.
708+
message InlineSource {
709+
// Required. A list of all denylist entries to import. Max of 1000 items.
710+
repeated CompletionSuggestion suggestions = 1
711+
[(google.api.field_behavior) = REQUIRED];
712+
}
713+
714+
// The source of the autocomplete suggestions.
715+
oneof source {
716+
// The Inline source for suggestion entries.
717+
InlineSource inline_source = 2;
718+
719+
// Cloud Storage location for the input content.
720+
GcsSource gcs_source = 3;
721+
722+
// BigQuery input source.
723+
BigQuerySource bigquery_source = 4;
724+
}
725+
726+
// Required. The parent data store resource name for which to import customer
727+
// autocomplete suggestions.
728+
//
729+
// Follows pattern `projects/*/locations/*/collections/*/dataStores/*`
730+
string parent = 1 [
731+
(google.api.field_behavior) = REQUIRED,
732+
(google.api.resource_reference) = {
733+
type: "discoveryengine.googleapis.com/DataStore"
734+
}
735+
];
736+
737+
// The desired location of errors incurred during the Import.
738+
ImportErrorConfig error_config = 5;
739+
}
740+
741+
// Response of the
742+
// [CompletionService.ImportCompletionSuggestions][google.cloud.discoveryengine.v1beta.CompletionService.ImportCompletionSuggestions]
743+
// method. If the long running operation is done, this message is returned by
744+
// the google.longrunning.Operations.response field if the operation is
745+
// successful.
746+
message ImportCompletionSuggestionsResponse {
747+
// A sample of errors encountered while processing the request.
748+
repeated google.rpc.Status error_samples = 1;
749+
750+
// The desired location of errors incurred during the Import.
751+
ImportErrorConfig error_config = 2;
752+
}
753+
754+
// Metadata related to the progress of the ImportCompletionSuggestions
755+
// operation. This will be returned by the google.longrunning.Operation.metadata
756+
// field.
757+
message ImportCompletionSuggestionsMetadata {
758+
// Operation create time.
759+
google.protobuf.Timestamp create_time = 1;
760+
761+
// Operation last update time. If the operation is done, this is also the
762+
// finish time.
763+
google.protobuf.Timestamp update_time = 2;
764+
765+
// Count of
766+
// [CompletionSuggestion][google.cloud.discoveryengine.v1beta.CompletionSuggestion]s
767+
// successfully imported.
768+
int64 success_count = 3;
769+
770+
// Count of
771+
// [CompletionSuggestion][google.cloud.discoveryengine.v1beta.CompletionSuggestion]s
772+
// that failed to be imported.
773+
int64 failure_count = 4;
774+
}
775+
668776
// Request message for
669777
// [SampleQueryService.ImportSampleQueries][google.cloud.discoveryengine.v1beta.SampleQueryService.ImportSampleQueries]
670778
// method.

0 commit comments

Comments
 (0)