Skip to content

Commit

Permalink
feat: add data store, engine and site search engine services
Browse files Browse the repository at this point in the history
feat: support search summarization with citations and references
feat: add suggestion deny list import/purge APIs
feat: add engine support for multi-turn search and search APIs
docs: keep the API doc up-to-date with recent changes

PiperOrigin-RevId: 605218577
  • Loading branch information
Google APIs authored and Copybara-Service committed Feb 8, 2024
1 parent 679060c commit 565c340
Show file tree
Hide file tree
Showing 18 changed files with 2,215 additions and 42 deletions.
13 changes: 13 additions & 0 deletions google/cloud/discoveryengine/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,23 @@ proto_library(
name = "discoveryengine_proto",
srcs = [
"common.proto",
"completion.proto",
"completion_service.proto",
"conversation.proto",
"conversational_search_service.proto",
"data_store.proto",
"data_store_service.proto",
"document.proto",
"document_service.proto",
"engine.proto",
"engine_service.proto",
"import_config.proto",
"purge_config.proto",
"schema.proto",
"schema_service.proto",
"search_service.proto",
"site_search_engine.proto",
"site_search_engine_service.proto",
"user_event.proto",
"user_event_service.proto",
],
Expand Down Expand Up @@ -107,12 +114,18 @@ java_gapic_test(
"com.google.cloud.discoveryengine.v1.CompletionServiceClientTest",
"com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.ConversationalSearchServiceClientTest",
"com.google.cloud.discoveryengine.v1.DataStoreServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.DataStoreServiceClientTest",
"com.google.cloud.discoveryengine.v1.DocumentServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.DocumentServiceClientTest",
"com.google.cloud.discoveryengine.v1.EngineServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.EngineServiceClientTest",
"com.google.cloud.discoveryengine.v1.SchemaServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.SchemaServiceClientTest",
"com.google.cloud.discoveryengine.v1.SearchServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.SearchServiceClientTest",
"com.google.cloud.discoveryengine.v1.SiteSearchEngineServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.SiteSearchEngineServiceClientTest",
"com.google.cloud.discoveryengine.v1.UserEventServiceClientHttpJsonTest",
"com.google.cloud.discoveryengine.v1.UserEventServiceClientTest",
],
Expand Down
57 changes: 54 additions & 3 deletions google/cloud/discoveryengine/v1/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,67 @@ option (google.api.resource_definition) = {
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}"
};
option (google.api.resource_definition) = {
type: "discoveryengine.googleapis.com/DataStore"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}"
type: "discoveryengine.googleapis.com/Collection"
pattern: "projects/{project}/locations/{location}/collections/{collection}"
};
option (google.api.resource_definition) = {
type: "discoveryengine.googleapis.com/ServingConfig"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}"
};

// The industry vertical associated with the
// [DataStore][google.cloud.discoveryengine.v1.DataStore].
enum IndustryVertical {
// Value used when unset.
INDUSTRY_VERTICAL_UNSPECIFIED = 0;

// The generic vertical for documents that are not specific to any industry
// vertical.
GENERIC = 1;

// The media industry vertical.
MEDIA = 2;
}

// The type of solution.
enum SolutionType {
// Default value.
SOLUTION_TYPE_UNSPECIFIED = 0;

// Used for Recommendations AI.
SOLUTION_TYPE_RECOMMENDATION = 1;

// Used for Discovery Search.
SOLUTION_TYPE_SEARCH = 2;

// Used for use cases related to the Generative AI agent.
SOLUTION_TYPE_CHAT = 3;
}

// Tiers of search features. Different tiers might have different
// pricing. To learn more, please check the pricing documentation.
enum SearchTier {
// Default value when the enum is unspecified. This is invalid to use.
SEARCH_TIER_UNSPECIFIED = 0;

// Standard tier.
SEARCH_TIER_STANDARD = 1;

// Enterprise tier.
SEARCH_TIER_ENTERPRISE = 2;
}

// Add-on that provides additional functionality for search.
enum SearchAddOn {
// Default value when the enum is unspecified. This is invalid to use.
SEARCH_ADD_ON_UNSPECIFIED = 0;

// Large language model add-on.
SEARCH_ADD_ON_LLM = 1;
}

// A floating point interval.
message Interval {
// The lower bound of the interval. If neither of the min fields are
Expand Down
52 changes: 52 additions & 0 deletions google/cloud/discoveryengine/v1/completion.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package google.cloud.discoveryengine.v1;

import "google/api/field_behavior.proto";

option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
option java_multiple_files = true;
option java_outer_classname = "CompletionProto";
option java_package = "com.google.cloud.discoveryengine.v1";
option objc_class_prefix = "DISCOVERYENGINE";
option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1";
option ruby_package = "Google::Cloud::DiscoveryEngine::V1";

// Suggestion deny list entry identifying the phrase to block from suggestions
// and the applied operation for the phrase.
message SuggestionDenyListEntry {
// Operator for matching with the generated suggestions.
enum MatchOperator {
// Default value. Should not be used
MATCH_OPERATOR_UNSPECIFIED = 0;

// If the suggestion is an exact match to the block_phrase, then block it.
EXACT_MATCH = 1;

// If the suggestion contains the block_phrase, then block it.
CONTAINS = 2;
}

// Required. Phrase to block from suggestions served. Can be maximum 125
// characters.
string block_phrase = 1 [(google.api.field_behavior) = REQUIRED];

// Required. The match operator to apply for this phrase. Whether to block the
// exact phrase, or block any suggestions containing this phrase.
MatchOperator match_operator = 2 [(google.api.field_behavior) = REQUIRED];
}
55 changes: 51 additions & 4 deletions google/cloud/discoveryengine/v1/completion_service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import "google/api/annotations.proto";
import "google/api/client.proto";
import "google/api/field_behavior.proto";
import "google/api/resource.proto";
import "google/cloud/discoveryengine/v1/import_config.proto";
import "google/cloud/discoveryengine/v1/purge_config.proto";
import "google/longrunning/operations.proto";

option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1";
option go_package = "cloud.google.com/go/discoveryengine/apiv1/discoveryenginepb;discoveryenginepb";
Expand All @@ -45,6 +48,44 @@ service CompletionService {
}
};
}

// Imports all
// [SuggestionDenyListEntry][google.cloud.discoveryengine.v1.SuggestionDenyListEntry]
// for a DataStore.
rpc ImportSuggestionDenyListEntries(ImportSuggestionDenyListEntriesRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/suggestionDenyListEntries:import"
body: "*"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/dataStores/*}/suggestionDenyListEntries:import"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesResponse"
metadata_type: "google.cloud.discoveryengine.v1.ImportSuggestionDenyListEntriesMetadata"
};
}

// Permanently deletes all
// [SuggestionDenyListEntry][google.cloud.discoveryengine.v1.SuggestionDenyListEntry]
// for a DataStore.
rpc PurgeSuggestionDenyListEntries(PurgeSuggestionDenyListEntriesRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/suggestionDenyListEntries:purge"
body: "*"
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/dataStores/**}/suggestionDenyListEntries:purge"
body: "*"
}
};
option (google.longrunning.operation_info) = {
response_type: "google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesResponse"
metadata_type: "google.cloud.discoveryengine.v1.PurgeSuggestionDenyListEntriesMetadata"
};
}
}

// Request message for
Expand All @@ -65,8 +106,9 @@ message CompleteQueryRequest {
// 128 characters.
string query = 2 [(google.api.field_behavior) = REQUIRED];

// Selects data model of query suggestions for serving. Currently supported
// values:
// Specifies the autocomplete data model. This overrides any model specified
// in the Configuration > Autocomplete section of the Cloud console. Currently
// supported values:
//
// * `document` - Using suggestions generated from user-imported documents.
// * `search-history` - Using suggestions generated from the past history of
Expand All @@ -80,8 +122,7 @@ message CompleteQueryRequest {
// Default values:
//
// * `document` is the default model for regular dataStores.
// * `search-history` is the default model for
// [IndustryVertical.SITE_SEARCH][] dataStores.
// * `search-history` is the default model for site search dataStores.
string query_model = 3;

// A unique identifier for tracking visitors. For example, this could be
Expand Down Expand Up @@ -115,6 +156,12 @@ message CompleteQueryResponse {
message QuerySuggestion {
// The suggestion for the query.
string suggestion = 1;

// The unique document field paths that serve as the source of this
// suggestion if it was generated from completable fields.
//
// This field is only populated for the document-completable model.
repeated string completable_field_paths = 2;
}

// Results of the matched query suggestions. The result list is ordered and
Expand Down
3 changes: 3 additions & 0 deletions google/cloud/discoveryengine/v1/conversation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ message Conversation {
type: "discoveryengine.googleapis.com/Conversation"
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}"
pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}"
};

// Enumeration of the state of the conversation.
Expand All @@ -52,6 +53,8 @@ message Conversation {

// Immutable. Fully qualified name
// `project/*/locations/global/collections/{collection}/dataStore/*/conversations/*`
// or
// `project/*/locations/global/collections/{collection}/engines/*/conversations/*`.
string name = 1 [(google.api.field_behavior) = IMMUTABLE];

// The state of the Conversation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ service ConversationalSearchService {
post: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse"
body: "*"
}
additional_bindings {
post: "/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}:converse"
body: "*"
}
};
option (google.api.method_signature) = "name,query";
}
Expand All @@ -66,6 +70,10 @@ service ConversationalSearchService {
post: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations"
body: "conversation"
}
additional_bindings {
post: "/v1/{parent=projects/*/locations/*/collections/*/engines/*}/conversations"
body: "conversation"
}
};
option (google.api.method_signature) = "parent,conversation";
}
Expand All @@ -81,6 +89,9 @@ service ConversationalSearchService {
additional_bindings {
delete: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
}
additional_bindings {
delete: "/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}"
}
};
option (google.api.method_signature) = "name";
}
Expand All @@ -99,6 +110,10 @@ service ConversationalSearchService {
patch: "/v1/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
body: "conversation"
}
additional_bindings {
patch: "/v1/{conversation.name=projects/*/locations/*/collections/*/engines/*/conversations/*}"
body: "conversation"
}
};
option (google.api.method_signature) = "conversation,update_mask";
}
Expand All @@ -110,6 +125,9 @@ service ConversationalSearchService {
additional_bindings {
get: "/v1/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
}
additional_bindings {
get: "/v1/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}"
}
};
option (google.api.method_signature) = "name";
}
Expand All @@ -123,6 +141,9 @@ service ConversationalSearchService {
additional_bindings {
get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations"
}
additional_bindings {
get: "/v1/{parent=projects/*/locations/*/collections/*/engines/*}/conversations"
}
};
option (google.api.method_signature) = "parent";
}
Expand Down Expand Up @@ -184,6 +205,24 @@ message ConverseConversationRequest {

// A specification for configuring the summary returned in the response.
SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8;

// The filter syntax consists of an expression language for constructing a
// predicate from one or more fields of the documents being filtered. Filter
// expression is case-sensitive. This will be used to filter search results
// which may affect the summary response.
//
// If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
//
// Filtering in Vertex AI Search is done by mapping the LHS filter key to a
// key property defined in the Vertex AI Search backend -- this mapping is
// defined by the customer in their schema. For example a media customer might
// have a field 'name' in their schema. In this case the filter would look
// like this: filter --> name:'ANY("king kong")'
//
// For more information about filtering including syntax and filter
// operators, see
// [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
string filter = 9;
}

// Response message for
Expand Down Expand Up @@ -224,7 +263,7 @@ message UpdateConversationRequest {
// [Conversation][google.cloud.discoveryengine.v1.Conversation] to update. The
// following are NOT supported:
//
// * [conversation.name][]
// * [Conversation.name][google.cloud.discoveryengine.v1.Conversation.name]
//
// If not set or empty, all supported fields are updated.
google.protobuf.FieldMask update_mask = 2;
Expand Down

0 comments on commit 565c340

Please sign in to comment.