Skip to content

Commit 5e2f0b2

Browse files
Google APIscopybara-github
authored andcommitted
feat: add site search engine service
feat: add search tuning service feat: add engine support for conversational engine service feat: support search summarization with citations and references docs: keep the API doc up-to-date with recent changes PiperOrigin-RevId: 590625062
1 parent c278ac6 commit 5e2f0b2

11 files changed

Lines changed: 1018 additions & 10 deletions

google/cloud/discoveryengine/v1alpha/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ proto_library(
3737
"schema.proto",
3838
"schema_service.proto",
3939
"search_service.proto",
40+
"search_tuning_service.proto",
41+
"site_search_engine.proto",
4042
"site_search_engine_service.proto",
4143
"user_event.proto",
4244
"user_event_service.proto",
@@ -128,6 +130,8 @@ java_gapic_test(
128130
"com.google.cloud.discoveryengine.v1alpha.SchemaServiceClientTest",
129131
"com.google.cloud.discoveryengine.v1alpha.SearchServiceClientHttpJsonTest",
130132
"com.google.cloud.discoveryengine.v1alpha.SearchServiceClientTest",
133+
"com.google.cloud.discoveryengine.v1alpha.SearchTuningServiceClientHttpJsonTest",
134+
"com.google.cloud.discoveryengine.v1alpha.SearchTuningServiceClientTest",
131135
"com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClientHttpJsonTest",
132136
"com.google.cloud.discoveryengine.v1alpha.SiteSearchEngineServiceClientTest",
133137
"com.google.cloud.discoveryengine.v1alpha.UserEventServiceClientHttpJsonTest",

google/cloud/discoveryengine/v1alpha/common.proto

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ option (google.api.resource_definition) = {
4141
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
4242
pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}"
4343
};
44-
option (google.api.resource_definition) = {
45-
type: "discoveryengine.googleapis.com/SiteSearchEngine"
46-
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/siteSearchEngine"
47-
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/siteSearchEngine"
48-
};
4944

5045
// The industry vertical associated with the
5146
// [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].

google/cloud/discoveryengine/v1alpha/conversation.proto

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ message Conversation {
3636
type: "discoveryengine.googleapis.com/Conversation"
3737
pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/conversations/{conversation}"
3838
pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/conversations/{conversation}"
39+
pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/conversations/{conversation}"
3940
};
4041

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

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

5760
// The state of the Conversation.

google/cloud/discoveryengine/v1alpha/conversational_search_service.proto

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ service ConversationalSearchService {
5050
post: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}:converse"
5151
body: "*"
5252
}
53+
additional_bindings {
54+
post: "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}:converse"
55+
body: "*"
56+
}
5357
};
5458
option (google.api.method_signature) = "name,query";
5559
}
@@ -66,6 +70,10 @@ service ConversationalSearchService {
6670
post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations"
6771
body: "conversation"
6872
}
73+
additional_bindings {
74+
post: "/v1alpha/{parent=projects/*/locations/*/collections/*/engines/*}/conversations"
75+
body: "conversation"
76+
}
6977
};
7078
option (google.api.method_signature) = "parent,conversation";
7179
}
@@ -81,6 +89,9 @@ service ConversationalSearchService {
8189
additional_bindings {
8290
delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
8391
}
92+
additional_bindings {
93+
delete: "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}"
94+
}
8495
};
8596
option (google.api.method_signature) = "name";
8697
}
@@ -99,6 +110,10 @@ service ConversationalSearchService {
99110
patch: "/v1alpha/{conversation.name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
100111
body: "conversation"
101112
}
113+
additional_bindings {
114+
patch: "/v1alpha/{conversation.name=projects/*/locations/*/collections/*/engines/*/conversations/*}"
115+
body: "conversation"
116+
}
102117
};
103118
option (google.api.method_signature) = "conversation,update_mask";
104119
}
@@ -110,6 +125,9 @@ service ConversationalSearchService {
110125
additional_bindings {
111126
get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/conversations/*}"
112127
}
128+
additional_bindings {
129+
get: "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/conversations/*}"
130+
}
113131
};
114132
option (google.api.method_signature) = "name";
115133
}
@@ -123,6 +141,9 @@ service ConversationalSearchService {
123141
additional_bindings {
124142
get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/conversations"
125143
}
144+
additional_bindings {
145+
get: "/v1alpha/{parent=projects/*/locations/*/collections/*/engines/*}/conversations"
146+
}
126147
};
127148
option (google.api.method_signature) = "parent";
128149
}
@@ -184,6 +205,24 @@ message ConverseConversationRequest {
184205

185206
// A specification for configuring the summary returned in the response.
186207
SearchRequest.ContentSearchSpec.SummarySpec summary_spec = 8;
208+
209+
// The filter syntax consists of an expression language for constructing a
210+
// predicate from one or more fields of the documents being filtered. Filter
211+
// expression is case-sensitive. This will be used to filter search results
212+
// which may affect the summary response.
213+
//
214+
// If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
215+
//
216+
// Filtering in Vertex AI Search is done by mapping the LHS filter key to a
217+
// key property defined in the Vertex AI Search backend -- this mapping is
218+
// defined by the customer in their schema. For example a media customer might
219+
// have a field 'name' in their schema. In this case the filter would look
220+
// like this: filter --> name:'ANY("king kong")'
221+
//
222+
// For more information about filtering including syntax and filter
223+
// operators, see
224+
// [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
225+
string filter = 9;
187226
}
188227

189228
// Response message for

google/cloud/discoveryengine/v1alpha/discoveryengine_v1alpha.yaml

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,30 @@ apis:
1212
- name: google.cloud.discoveryengine.v1alpha.RecommendationService
1313
- name: google.cloud.discoveryengine.v1alpha.SchemaService
1414
- name: google.cloud.discoveryengine.v1alpha.SearchService
15+
- name: google.cloud.discoveryengine.v1alpha.SearchTuningService
1516
- name: google.cloud.discoveryengine.v1alpha.SiteSearchEngineService
1617
- name: google.cloud.discoveryengine.v1alpha.UserEventService
1718
- name: google.cloud.location.Locations
1819
- name: google.longrunning.Operations
1920

2021
types:
2122
- name: google.cloud.discoveryengine.logging.ErrorLog
23+
- name: google.cloud.discoveryengine.v1alpha.BatchCreateTargetSiteMetadata
24+
- name: google.cloud.discoveryengine.v1alpha.BatchCreateTargetSitesResponse
2225
- name: google.cloud.discoveryengine.v1alpha.CreateDataStoreMetadata
2326
- name: google.cloud.discoveryengine.v1alpha.CreateEngineMetadata
2427
- name: google.cloud.discoveryengine.v1alpha.CreateSchemaMetadata
28+
- name: google.cloud.discoveryengine.v1alpha.CreateTargetSiteMetadata
2529
- name: google.cloud.discoveryengine.v1alpha.DataStore
2630
- name: google.cloud.discoveryengine.v1alpha.DeleteDataStoreMetadata
2731
- name: google.cloud.discoveryengine.v1alpha.DeleteEngineMetadata
2832
- name: google.cloud.discoveryengine.v1alpha.DeleteSchemaMetadata
33+
- name: google.cloud.discoveryengine.v1alpha.DeleteTargetSiteMetadata
34+
- name: google.cloud.discoveryengine.v1alpha.DisableAdvancedSiteSearchMetadata
35+
- name: google.cloud.discoveryengine.v1alpha.DisableAdvancedSiteSearchResponse
36+
- name: google.cloud.discoveryengine.v1alpha.DocumentProcessingConfig
37+
- name: google.cloud.discoveryengine.v1alpha.EnableAdvancedSiteSearchMetadata
38+
- name: google.cloud.discoveryengine.v1alpha.EnableAdvancedSiteSearchResponse
2939
- name: google.cloud.discoveryengine.v1alpha.Engine
3040
- name: google.cloud.discoveryengine.v1alpha.FieldConfig
3141
- name: google.cloud.discoveryengine.v1alpha.ImportDocumentsMetadata
@@ -40,18 +50,22 @@ types:
4050
- name: google.cloud.discoveryengine.v1alpha.RecrawlUrisResponse
4151
- name: google.cloud.discoveryengine.v1alpha.Schema
4252
- name: google.cloud.discoveryengine.v1alpha.TargetSite
53+
- name: google.cloud.discoveryengine.v1alpha.TrainCustomModelMetadata
54+
- name: google.cloud.discoveryengine.v1alpha.TrainCustomModelResponse
4355
- name: google.cloud.discoveryengine.v1alpha.TuneEngineMetadata
4456
- name: google.cloud.discoveryengine.v1alpha.TuneEngineResponse
4557
- name: google.cloud.discoveryengine.v1alpha.UpdateSchemaMetadata
58+
- name: google.cloud.discoveryengine.v1alpha.UpdateTargetSiteMetadata
4659

4760
documentation:
4861
summary: Discovery Engine API.
4962

5063
http:
5164
rules:
5265
- selector: google.longrunning.Operations.GetOperation
53-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}'
66+
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector/operations/*}'
5467
additional_bindings:
68+
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*/operations/*}'
5569
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*/operations/*}'
5670
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/operations/*}'
5771
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*/operations/*}'
@@ -65,8 +79,9 @@ http:
6579
- get: '/v1alpha/{name=projects/*/locations/*/operations/*}'
6680
- get: '/v1alpha/{name=projects/*/operations/*}'
6781
- selector: google.longrunning.Operations.ListOperations
68-
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations'
82+
get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataConnector}/operations'
6983
additional_bindings:
84+
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/branches/*}/operations'
7085
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/models/*}/operations'
7186
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/schemas/*}/operations'
7287
- get: '/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/siteSearchEngine/targetSites}/operations'
@@ -114,7 +129,11 @@ authentication:
114129
oauth:
115130
canonical_scopes: |-
116131
https://www.googleapis.com/auth/cloud-platform
117-
- selector: google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.RecrawlUris
132+
- selector: google.cloud.discoveryengine.v1alpha.SearchTuningService.TrainCustomModel
133+
oauth:
134+
canonical_scopes: |-
135+
https://www.googleapis.com/auth/cloud-platform
136+
- selector: 'google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.*'
118137
oauth:
119138
canonical_scopes: |-
120139
https://www.googleapis.com/auth/cloud-platform

google/cloud/discoveryengine/v1alpha/document.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ message Document {
5353

5454
// The URI of the content. Only Cloud Storage URIs (e.g.
5555
// `gs://bucket-name/path/to/file`) are supported. The maximum file size
56-
// is 100 MB.
56+
// is 2.5 MB for text-based formats, 100 MB for other formats.
5757
string uri = 3;
5858
}
5959

google/cloud/discoveryengine/v1alpha/engine_service.proto

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ service EngineService {
105105
}
106106

107107
// Resumes the training of an existing engine. Only applicable if
108-
// [solution_type][] is
108+
// [SolutionType][google.cloud.discoveryengine.v1alpha.SolutionType] is
109109
// [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1alpha.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
110110
rpc ResumeEngine(ResumeEngineRequest) returns (Engine) {
111111
option (google.api.http) = {

google/cloud/discoveryengine/v1alpha/search_service.proto

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,20 @@ message SearchRequest {
321321
// A specification for configuring a summary returned in a search
322322
// response.
323323
message SummarySpec {
324+
// Specification of the prompt to use with the model.
325+
message ModelPromptSpec {
326+
// Text at the beginning of the prompt that instructs the assistant.
327+
// Examples are available in the user guide.
328+
string preamble = 1;
329+
}
330+
331+
// Specification of the model.
332+
message ModelSpec {
333+
// The string format of the model version.
334+
// e.g. stable, preview, etc.
335+
string version = 1;
336+
}
337+
324338
// The number of top results to generate the summary from. If the number
325339
// of results returned is less than `summaryResultCount`, the summary is
326340
// generated from all of the results.
@@ -372,10 +386,18 @@ message SearchRequest {
372386
// fallback messages instead.
373387
bool ignore_non_summary_seeking_query = 4;
374388

389+
// If specified, the spec will be used to modify the prompt provided to
390+
// the LLM.
391+
ModelPromptSpec model_prompt_spec = 5;
392+
375393
// Language code for Summary. Use language tags defined by
376394
// [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
377395
// Note: This is an experimental feature.
378396
string language_code = 6;
397+
398+
// If specified, the spec will be used to modify the model specification
399+
// provided to the LLM.
400+
ModelSpec model_spec = 7;
379401
}
380402

381403
// A specification for configuring the extractive content in a search
@@ -535,6 +557,20 @@ message SearchRequest {
535557
// [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
536558
string filter = 7;
537559

560+
// The default filter that is applied when a user performs a search without
561+
// checking any filters on the search page.
562+
//
563+
// The filter applied to every search request when quality improvement such as
564+
// query expansion is needed. In the case a query does not have a sufficient
565+
// amount of results this filter will be used to determine whether or not to
566+
// enable the query expansion flow. The original filter will still be used for
567+
// the query expanded search.
568+
// This field is strongly recommended to achieve high search quality.
569+
//
570+
// For more information about filter syntax, see
571+
// [SearchRequest.filter][google.cloud.discoveryengine.v1alpha.SearchRequest.filter].
572+
string canonical_filter = 29;
573+
538574
// The order in which documents are returned. Documents can be ordered by
539575
// a field in an [Document][google.cloud.discoveryengine.v1alpha.Document]
540576
// object. Leave it unset if ordered by relevance. `order_by` expression is
@@ -743,6 +779,65 @@ message SearchResponse {
743779
repeated float scores = 2;
744780
}
745781

782+
// Citation metadata.
783+
message CitationMetadata {
784+
// Citations for segments.
785+
repeated Citation citations = 1;
786+
}
787+
788+
// Citation info for a segment.
789+
message Citation {
790+
// Index indicates the start of the segment, measured in bytes/unicode.
791+
int64 start_index = 1;
792+
793+
// End of the attributed segment, exclusive.
794+
int64 end_index = 2;
795+
796+
// Citation sources for the attributed segment.
797+
repeated CitationSource sources = 3;
798+
}
799+
800+
// Citation source.
801+
message CitationSource {
802+
// Document reference index from SummaryWithMetadata.references.
803+
// It is 0-indexed and the value will be zero if the reference_index is
804+
// not set explicitly.
805+
int64 reference_index = 4;
806+
}
807+
808+
// Document reference.
809+
message Reference {
810+
// Title of the document.
811+
string title = 1;
812+
813+
// Required.
814+
// [Document.name][google.cloud.discoveryengine.v1alpha.Document.name] of
815+
// the document. Full resource name of the referenced document, in the
816+
// format
817+
// `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
818+
string document = 2 [
819+
(google.api.field_behavior) = REQUIRED,
820+
(google.api.resource_reference) = {
821+
type: "discoveryengine.googleapis.com/Document"
822+
}
823+
];
824+
825+
// GCS or HTTP uri for the document.
826+
string uri = 3;
827+
}
828+
829+
// Summary with metadata information.
830+
message SummaryWithMetadata {
831+
// Summary text with no citation information.
832+
string summary = 1;
833+
834+
// Citation metadata for given summary.
835+
CitationMetadata citation_metadata = 2;
836+
837+
// Document References.
838+
repeated Reference references = 3;
839+
}
840+
746841
// An Enum for summary-skipped reasons.
747842
enum SummarySkippedReason {
748843
// Default value. The summary skipped reason is not specified.
@@ -791,6 +886,8 @@ message SearchResponse {
791886
// A collection of Safety Attribute categories and their associated
792887
// confidence scores.
793888
SafetyAttributes safety_attributes = 3;
889+
890+
SummaryWithMetadata summary_with_metadata = 4;
794891
}
795892

796893
// Debug information specifically related to forward geocoding issues arising

0 commit comments

Comments
 (0)