Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [discoveryengine] support extractive content in search #4355

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ message CompleteQueryRequest {
// API calls. Do not use it when there is no traffic for Search API.
// * `user-event` - Using suggestions generated from user-imported search
// events.
// * `document-completable` - Using suggestions taken directly from
// user-imported document fields marked as completable.
//
// Default values:
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ message Document {

// The MIME type of the content. Supported types:
//
// * `application/pdf` (PDF)
// * `application/pdf` (PDF, only native PDFs are supported for now)
// * `text/html` (HTML)
// * `application/vnd.openxmlformats-officedocument.wordprocessingml.document` (DOCX)
// * `application/vnd.openxmlformats-officedocument.presentationml.presentation` (PPTX)
// * `text/plain` (TXT)
//
// See https://www.iana.org/assignments/media-types/media-types.xhtml.
string mime_type = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ message GcsSource {
// * `custom`: One custom data JSON per row in arbitrary format that conforms
// the defined [Schema][google.cloud.discoveryengine.v1beta.Schema] of the
// data store. This can only be used by the GENERIC Data Store vertical.
// * `csv`: A CSV file with header conforming the defined
// [Schema][google.cloud.discoveryengine.v1beta.Schema] of the
// data store. Each entry after the header will be imported as a Document.
// This can only be used by the GENERIC Data Store vertical.
//
// Supported values for user even imports:
//
Expand Down Expand Up @@ -137,16 +141,16 @@ message ImportUserEventsRequest {
repeated UserEvent user_events = 1 [(google.api.field_behavior) = REQUIRED];
}

// The desired input source of the user event data.
// Required - The desired input source of the user event data.
oneof source {
// Required. The Inline source for the input content for UserEvents.
InlineSource inline_source = 2 [(google.api.field_behavior) = REQUIRED];
// The Inline source for the input content for UserEvents.
InlineSource inline_source = 2;

// Required. Cloud Storage location for the input content.
GcsSource gcs_source = 3 [(google.api.field_behavior) = REQUIRED];
// Cloud Storage location for the input content.
GcsSource gcs_source = 3;

// Required. BigQuery input source.
BigQuerySource bigquery_source = 4 [(google.api.field_behavior) = REQUIRED];
// BigQuery input source.
BigQuerySource bigquery_source = 4;
}

// Required. Parent DataStore resource name, of the form
Expand Down Expand Up @@ -290,7 +294,7 @@ message ImportDocumentsRequest {
// [GcsSource.data_schema][google.cloud.discoveryengine.v1beta.GcsSource.data_schema]
// or
// [BigQuerySource.data_schema][google.cloud.discoveryengine.v1beta.BigQuerySource.data_schema]
// is `custom`. Otherwise, an INVALID_ARGUMENT error is thrown.
// is `custom` or `csv`. Otherwise, an INVALID_ARGUMENT error is thrown.
bool auto_generate_ids = 8;

// The field in the Cloud Storage and BigQuery sources that indicates the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,10 @@ message SearchRequest {
// The specification that configs the snippet in the search results.
message SnippetSpec {
// Max number of snippets returned in each search result.
//
// A snippet is an infomartive summary of a content with highlighting for
// UI rendering.
//
// If the matching snippets is less than the max_snippet_count, return all
// of the snippets; otherwise, return the max_snippet_count.
//
Expand All @@ -308,13 +312,47 @@ message SearchRequest {
int32 summary_result_count = 1;
}

// The specification that configs the extractive content in search results.
message ExtractiveContentSpec {
// The max number of extractive answers returned in each search result.
//
// An extractive answer is a verbatim answer extracted from the original
// document, which provides precise and contextually relevant answer to
// the search query.
//
// If the number of matching answers is less than the
// extractive_answer_count, return all of the answers; otherwise, return
// the extractive_answer_count.
//
// At most 5 answers will be returned for each SearchResult.
int32 max_extractive_answer_count = 1;

// The max number of extractive segments returned in each search result.
//
// An extractive segment is a text segment extracted from the original
// document which is relevant to the search query and in general more
// verbose than an extrative answer. The segment could then be used as
// input for LLMs to generate summaries and answers.
//
// If the number of matching segments is less than the
// max_extractive_segment_count, return all of the segments; otherwise,
// return the max_extractive_segment_count.
//
// Currently one segment will be returned for each SearchResult.
int32 max_extractive_segment_count = 2;
}

// If there is no snippet spec provided, there will be no snippet in the
// search result.
SnippetSpec snippet_spec = 1;

// If there is no summary spec provided, there will be no summary in the
// search response.
SummarySpec summary_spec = 2;

// If there is no extractive_content_spec provided, there will be no
// extractive answer in the search response.
ExtractiveContentSpec extractive_content_spec = 3;
}

// Required. The resource name of the Search serving config, such as
Expand Down Expand Up @@ -549,6 +587,14 @@ message SearchResponse {
// performance.
string attribution_token = 4;

// The URI of a customer-defined redirect page. If redirect action is
// triggered, no search is performed, and only
// [redirect_uri][google.cloud.discoveryengine.v1beta.SearchResponse.redirect_uri]
// and
// [attribution_token][google.cloud.discoveryengine.v1beta.SearchResponse.attribution_token]
// are set in the response.
string redirect_uri = 12;

// A token that can be sent as
// [SearchRequest.page_token][google.cloud.discoveryengine.v1beta.SearchRequest.page_token]
// to retrieve the next page. If this field is omitted, there are no
Expand Down
115 changes: 115 additions & 0 deletions packages/google-cloud-discoveryengine/protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading