Skip to content

Commit e6b6ff9

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add GroundedGenerationService API
feat: Add AdvancedCompleteQuery API feat: Add lite search API to allow public website search with API key feat: Add Sitemap APIs to preview channel feat: Support search personalization to preview channel feat: Support natural language understanding search feat: Add BillingEstimation in data store feat: Support Google Workspace search feat: Support advanced boost search feat: Add one_box_page_size on search feat: support query regex in control match rules docs: deprecate extractive_answers in answer generation docs: deprecate asynchronous mode in answer generation docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 691212731
1 parent 67878b0 commit e6b6ff9

25 files changed

Lines changed: 1290 additions & 56 deletions

google/cloud/discoveryengine/v1beta/BUILD.bazel

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

424424
csharp_proto_library(
425425
name = "discoveryengine_csharp_proto",
426+
extra_opts = [],
426427
deps = [":discoveryengine_proto"],
427428
)
428429

google/cloud/discoveryengine/v1beta/answer.proto

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,8 @@ message Answer {
220220

221221
// Data representation.
222222
// The structured JSON data for the document.
223-
// It's populated from the struct data from the Document
224-
// , or the Chunk in
225-
// search result
226-
// .
223+
// It's populated from the struct data from the Document, or the
224+
// Chunk in search result.
227225
google.protobuf.Struct struct_data = 6;
228226
}
229227

@@ -282,11 +280,14 @@ message Answer {
282280
// Adversarial query classification type.
283281
ADVERSARIAL_QUERY = 1;
284282

285-
// Non-answer-seeking query classification type.
283+
// Non-answer-seeking query classification type, for chit chat.
286284
NON_ANSWER_SEEKING_QUERY = 2;
287285

288286
// Jail-breaking query classification type.
289287
JAIL_BREAKING_QUERY = 3;
288+
289+
// Non-answer-seeking query classification type, for no clear intent.
290+
NON_ANSWER_SEEKING_QUERY_V2 = 4;
290291
}
291292

292293
// Query classification type.
@@ -323,7 +324,9 @@ message Answer {
323324
// The adversarial query ignored case.
324325
ADVERSARIAL_QUERY_IGNORED = 1;
325326

326-
// The non-answer seeking query ignored case.
327+
// The non-answer seeking query ignored case
328+
//
329+
// Google skips the answer if the query is chit chat.
327330
NON_ANSWER_SEEKING_QUERY_IGNORED = 2;
328331

329332
// The out-of-domain query ignored case.
@@ -355,6 +358,17 @@ message Answer {
355358
// Google skips the summary if there is a customer policy violation
356359
// detected. The policy is defined by the customer.
357360
CUSTOMER_POLICY_VIOLATION = 7;
361+
362+
// The non-answer seeking query ignored case.
363+
//
364+
// Google skips the answer if the query doesn't have clear intent.
365+
NON_ANSWER_SEEKING_QUERY_IGNORED_V2 = 8;
366+
367+
// The low-grounded answer case.
368+
//
369+
// Google skips the answer if a well grounded answer was unable to be
370+
// generated.
371+
LOW_GROUNDED_ANSWER = 9;
358372
}
359373

360374
// Immutable. Fully qualified name

google/cloud/discoveryengine/v1beta/common.proto

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,24 @@ option (google.api.resource_definition) = {
3939
type: "discoveryengine.googleapis.com/Location"
4040
pattern: "projects/{project}/locations/{location}"
4141
};
42-
option (google.api.resource_definition) = {
43-
type: "discoveryengine.googleapis.com/GroundingConfig"
44-
pattern: "projects/{project}/locations/{location}/groundingConfigs/{grounding_config}"
45-
};
4642
option (google.api.resource_definition) = {
4743
type: "discoveryengine.googleapis.com/RankingConfig"
4844
pattern: "projects/{project}/locations/{location}/rankingConfigs/{ranking_config}"
4945
};
46+
option (google.api.resource_definition) = {
47+
type: "discoveryengine.googleapis.com/CompletionConfig"
48+
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/completionConfig"
49+
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/completionConfig"
50+
pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/completionConfig"
51+
};
5052
option (google.api.resource_definition) = {
5153
type: "healthcare.googleapis.com/FhirStore"
5254
pattern: "projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}"
5355
};
56+
option (google.api.resource_definition) = {
57+
type: "healthcare.googleapis.com/FhirResource"
58+
pattern: "projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id}"
59+
};
5460

5561
// The industry vertical associated with the
5662
// [DataStore][google.cloud.discoveryengine.v1beta.DataStore].

google/cloud/discoveryengine/v1beta/completion_service.proto

Lines changed: 274 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ import "google/api/annotations.proto";
2020
import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/resource.proto";
23+
import "google/cloud/discoveryengine/v1beta/common.proto";
24+
import "google/cloud/discoveryengine/v1beta/document.proto";
2325
import "google/cloud/discoveryengine/v1beta/import_config.proto";
2426
import "google/cloud/discoveryengine/v1beta/purge_config.proto";
2527
import "google/longrunning/operations.proto";
28+
import "google/protobuf/timestamp.proto";
2629

2730
option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
2831
option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
@@ -49,6 +52,23 @@ service CompletionService {
4952
};
5053
}
5154

55+
// Completes the user input with advanced keyword suggestions.
56+
rpc AdvancedCompleteQuery(AdvancedCompleteQueryRequest)
57+
returns (AdvancedCompleteQueryResponse) {
58+
option (google.api.http) = {
59+
post: "/v1beta/{completion_config=projects/*/locations/*/dataStores/*/completionConfig}:completeQuery"
60+
body: "*"
61+
additional_bindings {
62+
post: "/v1beta/{completion_config=projects/*/locations/*/collections/*/dataStores/*/completionConfig}:completeQuery"
63+
body: "*"
64+
}
65+
additional_bindings {
66+
post: "/v1beta/{completion_config=projects/*/locations/*/collections/*/engines/*/completionConfig}:completeQuery"
67+
body: "*"
68+
}
69+
};
70+
}
71+
5272
// Imports all
5373
// [SuggestionDenyListEntry][google.cloud.discoveryengine.v1beta.SuggestionDenyListEntry]
5474
// for a DataStore.
@@ -212,3 +232,257 @@ message CompleteQueryResponse {
212232
// must be true and there must be no suggestions that match the full query.
213233
bool tail_match_triggered = 2;
214234
}
235+
236+
// Request message for
237+
// [CompletionService.AdvancedCompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.AdvancedCompleteQuery]
238+
// method.
239+
// .
240+
message AdvancedCompleteQueryRequest {
241+
// Specification to boost suggestions based on the condtion of the suggestion.
242+
message BoostSpec {
243+
// Boost applies to suggestions which match a condition.
244+
message ConditionBoostSpec {
245+
// An expression which specifies a boost condition. The syntax is the same
246+
// as [filter expression
247+
// syntax](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata#filter-expression-syntax).
248+
// Currently, the only supported condition is a list of BCP-47 lang codes.
249+
//
250+
// Example:
251+
//
252+
// * To boost suggestions in languages `en` or `fr`:
253+
// `(lang_code: ANY("en", "fr"))`
254+
string condition = 1;
255+
256+
// Strength of the boost, which should be in [-1, 1].
257+
// Negative boost means demotion. Default is 0.0.
258+
//
259+
// Setting to 1.0 gives the suggestions a big promotion. However, it does
260+
// not necessarily mean that the top result will be a boosted suggestion.
261+
//
262+
// Setting to -1.0 gives the suggestions a big demotion. However, other
263+
// suggestions that are relevant might still be shown.
264+
//
265+
// Setting to 0.0 means no boost applied. The boosting condition is
266+
// ignored.
267+
float boost = 2;
268+
}
269+
270+
// Condition boost specifications. If a suggestion matches multiple
271+
// conditions in the specifictions, boost values from these specifications
272+
// are all applied and combined in a non-linear way. Maximum number of
273+
// specifications is 20.
274+
//
275+
// Note: Currently only support language condition boost.
276+
repeated ConditionBoostSpec condition_boost_specs = 1;
277+
}
278+
279+
// Suggestion type to return.
280+
enum SuggestionType {
281+
// Default value.
282+
SUGGESTION_TYPE_UNSPECIFIED = 0;
283+
284+
// Returns query suggestions.
285+
QUERY = 1;
286+
287+
// Returns people suggestions.
288+
PEOPLE = 2;
289+
290+
// Returns content suggestions.
291+
CONTENT = 3;
292+
293+
// Returns recent search suggestions.
294+
RECENT_SEARCH = 4;
295+
296+
// Returns Google Workspace suggestions.
297+
GOOGLE_WORKSPACE = 5;
298+
}
299+
300+
// Required. The completion_config of the parent dataStore or engine resource
301+
// name for which the completion is performed, such as
302+
// `projects/*/locations/global/collections/default_collection/dataStores/*/completionConfig`
303+
// `projects/*/locations/global/collections/default_collection/engines/*/completionConfig`.
304+
string completion_config = 1 [
305+
(google.api.field_behavior) = REQUIRED,
306+
(google.api.resource_reference) = {
307+
type: "discoveryengine.googleapis.com/CompletionConfig"
308+
}
309+
];
310+
311+
// Required. The typeahead input used to fetch suggestions. Maximum length is
312+
// 128 characters.
313+
//
314+
// The query can not be empty for most of the suggestion types. If it is
315+
// empty, an `INVALID_ARGUMENT` error is returned. The exception is when the
316+
// suggestion_types contains only the type `RECENT_SEARCH`, the query can
317+
// be an empty string. The is called "zero prefix" feature, which returns
318+
// user's recently searched queries given the empty query.
319+
string query = 2 [(google.api.field_behavior) = REQUIRED];
320+
321+
// Specifies the autocomplete data model. This overrides any model specified
322+
// in the Configuration > Autocomplete section of the Cloud console. Currently
323+
// supported values:
324+
//
325+
// * `document` - Using suggestions generated from user-imported documents.
326+
// * `search-history` - Using suggestions generated from the past history of
327+
// [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
328+
// API calls. Do not use it when there is no traffic for Search API.
329+
// * `user-event` - Using suggestions generated from user-imported search
330+
// events.
331+
// * `document-completable` - Using suggestions taken directly from
332+
// user-imported document fields marked as completable.
333+
//
334+
// Default values:
335+
//
336+
// * `document` is the default model for regular dataStores.
337+
// * `search-history` is the default model for site search dataStores.
338+
string query_model = 3;
339+
340+
// A unique identifier for tracking visitors. For example, this could be
341+
// implemented with an HTTP cookie, which should be able to uniquely identify
342+
// a visitor on a single device. This unique identifier should not change if
343+
// the visitor logs in or out of the website.
344+
//
345+
// This field should NOT have a fixed value such as `unknown_visitor`.
346+
//
347+
// This should be the same identifier as
348+
// [UserEvent.user_pseudo_id][google.cloud.discoveryengine.v1beta.UserEvent.user_pseudo_id]
349+
// and
350+
// [SearchRequest.user_pseudo_id][google.cloud.discoveryengine.v1beta.SearchRequest.user_pseudo_id].
351+
//
352+
// The field must be a UTF-8 encoded string with a length limit of 128
353+
string user_pseudo_id = 4;
354+
355+
// Optional. Information about the end user.
356+
//
357+
// This should be the same identifier information as
358+
// [UserEvent.user_info][google.cloud.discoveryengine.v1beta.UserEvent.user_info]
359+
// and
360+
// [SearchRequest.user_info][google.cloud.discoveryengine.v1beta.SearchRequest.user_info].
361+
UserInfo user_info = 9 [(google.api.field_behavior) = OPTIONAL];
362+
363+
// Indicates if tail suggestions should be returned if there are no
364+
// suggestions that match the full query. Even if set to true, if there are
365+
// suggestions that match the full query, those are returned and no
366+
// tail suggestions are returned.
367+
bool include_tail_suggestions = 5;
368+
369+
// Optional. Specification to boost suggestions matching the condition.
370+
BoostSpec boost_spec = 6 [(google.api.field_behavior) = OPTIONAL];
371+
372+
// Optional. Suggestion types to return. If empty or unspecified, query
373+
// suggestions are returned. Only one suggestion type is supported at the
374+
// moment.
375+
repeated SuggestionType suggestion_types = 7
376+
[(google.api.field_behavior) = OPTIONAL];
377+
}
378+
379+
// Response message for
380+
// [CompletionService.AdvancedCompleteQuery][google.cloud.discoveryengine.v1beta.CompletionService.AdvancedCompleteQuery]
381+
// method.
382+
message AdvancedCompleteQueryResponse {
383+
// Suggestions as search queries.
384+
message QuerySuggestion {
385+
// The suggestion for the query.
386+
string suggestion = 1;
387+
388+
// The unique document field paths that serve as the source of this
389+
// suggestion if it was generated from completable fields.
390+
//
391+
// This field is only populated for the document-completable model.
392+
repeated string completable_field_paths = 2;
393+
394+
// The name of the dataStore that this suggestion belongs to.
395+
repeated string data_store = 3;
396+
}
397+
398+
// Suggestions as people.
399+
message PersonSuggestion {
400+
// The type of the person based on the source.
401+
enum PersonType {
402+
// Default value.
403+
PERSON_TYPE_UNSPECIFIED = 0;
404+
405+
// The suggestion is from a GOOGLE_IDENTITY source.
406+
CLOUD_IDENTITY = 1;
407+
408+
// The suggestion is from a THIRD_PARTY_IDENTITY source.
409+
THIRD_PARTY_IDENTITY = 2;
410+
}
411+
412+
// The suggestion for the query.
413+
string suggestion = 1;
414+
415+
// The type of the person.
416+
PersonType person_type = 2;
417+
418+
// The document data snippet in the suggestion. Only a subset of fields is
419+
// populated.
420+
Document document = 4;
421+
422+
// The name of the dataStore that this suggestion belongs to.
423+
string data_store = 5 [(google.api.resource_reference) = {
424+
type: "discoveryengine.googleapis.com/DataStore"
425+
}];
426+
}
427+
428+
// Suggestions as content.
429+
message ContentSuggestion {
430+
// The type of the content returned for content suggestions.
431+
enum ContentType {
432+
// Default value.
433+
CONTENT_TYPE_UNSPECIFIED = 0;
434+
435+
// The suggestion is from a Google Workspace source.
436+
GOOGLE_WORKSPACE = 1;
437+
438+
// The suggestion is from a third party source.
439+
THIRD_PARTY = 2;
440+
}
441+
442+
// The suggestion for the query.
443+
string suggestion = 1;
444+
445+
// The type of the content suggestion.
446+
ContentType content_type = 2;
447+
448+
// The document data snippet in the suggestion. Only a subset of fields will
449+
// be populated.
450+
Document document = 4;
451+
452+
// The name of the dataStore that this suggestion belongs to.
453+
string data_store = 5 [(google.api.resource_reference) = {
454+
type: "discoveryengine.googleapis.com/DataStore"
455+
}];
456+
}
457+
458+
// Suggestions from recent search history.
459+
message RecentSearchSuggestion {
460+
// The suggestion for the query.
461+
string suggestion = 1;
462+
463+
// The time when this recent rearch happened.
464+
google.protobuf.Timestamp recent_search_time = 2;
465+
}
466+
467+
// Results of the matched query suggestions. The result list is ordered and
468+
// the first result is a top suggestion.
469+
repeated QuerySuggestion query_suggestions = 1;
470+
471+
// True if the returned suggestions are all tail suggestions.
472+
//
473+
// For tail matching to be triggered, include_tail_suggestions in the request
474+
// must be true and there must be no suggestions that match the full query.
475+
bool tail_match_triggered = 2;
476+
477+
// Results of the matched people suggestions. The result list is ordered and
478+
// the first result is the top suggestion.
479+
repeated PersonSuggestion people_suggestions = 3;
480+
481+
// Results of the matched content suggestions. The result list is ordered and
482+
// the first result is the top suggestion.
483+
repeated ContentSuggestion content_suggestions = 4;
484+
485+
// Results of the matched "recent search" suggestions. The result list is
486+
// ordered and the first result is the top suggestion.
487+
repeated RecentSearchSuggestion recent_search_suggestions = 5;
488+
}

0 commit comments

Comments
 (0)