@google-cloud/discoveryengine 0.8.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/README.md +13 -1
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +30 -2
  4. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +15 -2
  5. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +114 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +303 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/document.proto +8 -5
  8. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +4 -3
  9. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +27 -23
  10. package/build/protos/google/cloud/discoveryengine/v1/schema.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +428 -20
  12. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +48 -39
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +2 -2
  14. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +7 -2
  15. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +13 -2
  16. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +138 -0
  17. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +306 -0
  18. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +2 -4
  19. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +2 -1
  20. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +17 -17
  21. package/build/protos/google/cloud/discoveryengine/v1beta/schema.proto +1 -1
  22. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +276 -64
  23. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +45 -36
  24. package/build/protos/google/cloud/discoveryengine/v1beta/user_event_service.proto +2 -2
  25. package/build/protos/protos.d.ts +13913 -8367
  26. package/build/protos/protos.js +36766 -22883
  27. package/build/protos/protos.json +3956 -2571
  28. package/build/src/index.d.ts +4 -1
  29. package/build/src/index.js +4 -1
  30. package/build/src/v1/completion_service_client.d.ts +161 -12
  31. package/build/src/v1/completion_service_client.js +188 -4
  32. package/build/src/v1/conversational_search_service_client.d.ts +947 -0
  33. package/build/src/v1/conversational_search_service_client.js +1205 -0
  34. package/build/src/v1/conversational_search_service_client_config.json +68 -0
  35. package/build/src/v1/document_service_client.d.ts +245 -109
  36. package/build/src/v1/document_service_client.js +231 -31
  37. package/build/src/v1/index.d.ts +1 -0
  38. package/build/src/v1/index.js +3 -1
  39. package/build/src/v1/schema_service_client.d.ts +187 -53
  40. package/build/src/v1/schema_service_client.js +224 -27
  41. package/build/src/v1/search_service_client.d.ts +266 -59
  42. package/build/src/v1/search_service_client.js +267 -41
  43. package/build/src/v1/user_event_service_client.d.ts +159 -19
  44. package/build/src/v1/user_event_service_client.js +208 -7
  45. package/build/src/v1beta/completion_service_client.d.ts +159 -12
  46. package/build/src/v1beta/completion_service_client.js +188 -4
  47. package/build/src/v1beta/conversational_search_service_client.d.ts +947 -0
  48. package/build/src/v1beta/conversational_search_service_client.js +1205 -0
  49. package/build/src/v1beta/conversational_search_service_client_config.json +68 -0
  50. package/build/src/v1beta/document_service_client.d.ts +237 -101
  51. package/build/src/v1beta/document_service_client.js +227 -27
  52. package/build/src/v1beta/index.d.ts +1 -0
  53. package/build/src/v1beta/index.js +3 -1
  54. package/build/src/v1beta/recommendation_service_client.d.ts +158 -15
  55. package/build/src/v1beta/recommendation_service_client.js +188 -4
  56. package/build/src/v1beta/schema_service_client.d.ts +187 -53
  57. package/build/src/v1beta/schema_service_client.js +224 -27
  58. package/build/src/v1beta/search_service_client.d.ts +305 -71
  59. package/build/src/v1beta/search_service_client.js +293 -49
  60. package/build/src/v1beta/user_event_service_client.d.ts +156 -16
  61. package/build/src/v1beta/user_event_service_client.js +208 -7
  62. package/package.json +10 -13
@@ -56,6 +56,15 @@ service SearchService {
56
56
  // [SearchService.Search][google.cloud.discoveryengine.v1beta.SearchService.Search]
57
57
  // method.
58
58
  message SearchRequest {
59
+ // Specifies the image query input.
60
+ message ImageQuery {
61
+ oneof image {
62
+ // Base64 encoded image bytes. Supported image formats: JPEG, PNG, and
63
+ // BMP.
64
+ string image_bytes = 1;
65
+ }
66
+ }
67
+
59
68
  // A facet specification to perform faceted search.
60
69
  message FacetSpec {
61
70
  // Specifies how a facet is computed.
@@ -65,7 +74,7 @@ message SearchRequest {
65
74
  // which the facet values are computed. Facet key is case-sensitive.
66
75
  string key = 1 [(google.api.field_behavior) = REQUIRED];
67
76
 
68
- // Set only if values should be bucketized into intervals. Must be set
77
+ // Set only if values should be bucketed into intervals. Must be set
69
78
  // for facets with numerical values. Must not be set for facet with text
70
79
  // values. Maximum number of intervals is 30.
71
80
  repeated Interval intervals = 2;
@@ -73,22 +82,22 @@ message SearchRequest {
73
82
  // Only get facet for the given restricted values. Only supported on
74
83
  // textual fields. For example, suppose "category" has three values
75
84
  // "Action > 2022", "Action > 2021" and "Sci-Fi > 2022". If set
76
- // "restricted_values" to "Action > 2022", the "category" facet will only
77
- // contain "Action > 2022". Only supported on textual fields. Maximum
85
+ // "restricted_values" to "Action > 2022", the "category" facet only
86
+ // contains "Action > 2022". Only supported on textual fields. Maximum
78
87
  // is 10.
79
88
  repeated string restricted_values = 3;
80
89
 
81
90
  // Only get facet values that start with the given string prefix. For
82
91
  // example, suppose "category" has three values "Action > 2022",
83
92
  // "Action > 2021" and "Sci-Fi > 2022". If set "prefixes" to "Action", the
84
- // "category" facet will only contain "Action > 2022" and "Action > 2021".
93
+ // "category" facet only contains "Action > 2022" and "Action > 2021".
85
94
  // Only supported on textual fields. Maximum is 10.
86
95
  repeated string prefixes = 4;
87
96
 
88
97
  // Only get facet values that contains the given strings. For example,
89
98
  // suppose "category" has three values "Action > 2022",
90
99
  // "Action > 2021" and "Sci-Fi > 2022". If set "contains" to "2022", the
91
- // "category" facet will only contain "Action > 2022" and "Sci-Fi > 2022".
100
+ // "category" facet only contains "Action > 2022" and "Sci-Fi > 2022".
92
101
  // Only supported on textual fields. Maximum is 10.
93
102
  repeated string contains = 5;
94
103
 
@@ -121,7 +130,7 @@ message SearchRequest {
121
130
 
122
131
  // Maximum of facet values that should be returned for this facet. If
123
132
  // unspecified, defaults to 20. The maximum allowed value is 300. Values
124
- // above 300 will be coerced to 300.
133
+ // above 300 are coerced to 300.
125
134
  //
126
135
  // If this field is negative, an `INVALID_ARGUMENT` is returned.
127
136
  int32 limit = 2;
@@ -158,15 +167,15 @@ message SearchRequest {
158
167
 
159
168
  // Enables dynamic position for this facet. If set to true, the position of
160
169
  // this facet among all facets in the response is determined automatically.
161
- // It will be ordered together with dynamic facets if dynamic
162
- // facets is enabled. If set to false, the position of this facet in the
163
- // response will be the same as in the request, and it will be ranked before
170
+ // If dynamic facets are enabled, it is ordered together.
171
+ // If set to false, the position of this facet in the
172
+ // response is the same as in the request, and it is ranked before
164
173
  // the facets with dynamic position enable and all dynamic facets.
165
174
  //
166
175
  // For example, you may always want to have rating facet returned in
167
176
  // the response, but it's not necessarily to always display the rating facet
168
177
  // at the top. In that case, you can set enable_dynamic_position to true so
169
- // that the position of rating facet in response will be determined
178
+ // that the position of rating facet in response is determined
170
179
  // automatically.
171
180
  //
172
181
  // Another example, assuming you have the following facets in the request:
@@ -177,13 +186,13 @@ message SearchRequest {
177
186
  //
178
187
  // * "brands", enable_dynamic_position = false
179
188
  //
180
- // And also you have a dynamic facets enable, which will generate a facet
181
- // 'gender'. Then the final order of the facets in the response can be
189
+ // And also you have a dynamic facets enabled, which generates a facet
190
+ // `gender`. Then the final order of the facets in the response can be
182
191
  // ("price", "brands", "rating", "gender") or ("price", "brands", "gender",
183
192
  // "rating") depends on how API orders "gender" and "rating" facets.
184
- // However, notice that "price" and "brands" will always be
185
- // ranked at 1st and 2nd position since their enable_dynamic_position are
186
- // false.
193
+ // However, notice that "price" and "brands" are always
194
+ // ranked at first and second position because their enable_dynamic_position
195
+ // is false.
187
196
  bool enable_dynamic_position = 4;
188
197
  }
189
198
 
@@ -253,6 +262,11 @@ message SearchRequest {
253
262
  // The condition under which query expansion should occur. Default to
254
263
  // [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.Condition.DISABLED].
255
264
  Condition condition = 1;
265
+
266
+ // Whether to pin unexpanded results. If this field is set to true,
267
+ // unexpanded products are always at the top of the search results, followed
268
+ // by the expanded results.
269
+ bool pin_unexpanded_results = 2;
256
270
  }
257
271
 
258
272
  // The specification for query spell correction.
@@ -281,72 +295,141 @@ message SearchRequest {
281
295
  Mode mode = 1;
282
296
  }
283
297
 
284
- // The specification that configs the desired behavior of the UCS content
285
- // search.
298
+ // A specification for configuring the behavior of content search.
286
299
  message ContentSearchSpec {
287
- // The specification that configs the snippet in the search results.
300
+ // A specification for configuring snippets in a search response.
288
301
  message SnippetSpec {
289
- // Max number of snippets returned in each search result.
290
- //
291
- // A snippet is an infomartive summary of a content with highlighting for
292
- // UI rendering.
293
- //
294
- // If the matching snippets is less than the max_snippet_count, return all
295
- // of the snippets; otherwise, return the max_snippet_count.
296
- //
297
- // At most 5 snippets will be returned for each SearchResult.
298
- int32 max_snippet_count = 1;
299
-
300
- // if true, only snippet reference is returned.
301
- bool reference_only = 2;
302
+ // [DEPRECATED] This field is deprecated. To control snippet return, use
303
+ // `return_snippet` field. For backwards compatibility, we will return
304
+ // snippet if max_snippet_count > 0.
305
+ int32 max_snippet_count = 1 [deprecated = true];
306
+
307
+ // [DEPRECATED] This field is deprecated and will have no affect on the
308
+ // snippet.
309
+ bool reference_only = 2 [deprecated = true];
310
+
311
+ // If `true`, then return snippet. If no snippet can be generated, we
312
+ // return "No snippet is available for this page." A `snippet_status` with
313
+ // `SUCCESS` or `NO_SNIPPET_AVAILABLE` will also be returned.
314
+ bool return_snippet = 3;
302
315
  }
303
316
 
304
- // The specification that configs the summary in the search response.
317
+ // A specification for configuring a summary returned in a search
318
+ // response.
305
319
  message SummarySpec {
306
- // The number of top results the summary should be generated from.
307
- // If the number of returned results is less than summary_result_count,
308
- // then the summary would be derived from all the results; otherwise, the
309
- // summary would be derived from the top results.
320
+ // The number of top results to generate the summary from. If the number
321
+ // of results returned is less than `summaryResultCount`, the summary is
322
+ // generated from all of the results.
310
323
  //
311
- // At most 5 results can be used for generating summary.
324
+ // At most five results can be used to generate a summary.
312
325
  int32 summary_result_count = 1;
326
+
327
+ // Specifies whether to include citations in the summary. The default
328
+ // value is `false`.
329
+ //
330
+ // When this field is set to `true`, summaries include in-line citation
331
+ // numbers.
332
+ //
333
+ // Example summary including citations:
334
+ //
335
+ // BigQuery is Google Cloud's fully managed and completely serverless
336
+ // enterprise data warehouse [1]. BigQuery supports all data types, works
337
+ // across clouds, and has built-in machine learning and business
338
+ // intelligence, all within a unified platform [2, 3].
339
+ //
340
+ // The citation numbers refer to the returned search results and are
341
+ // 1-indexed. For example, [1] means that the sentence is attributed to
342
+ // the first search result. [2, 3] means that the sentence is attributed
343
+ // to both the second and third search results.
344
+ bool include_citations = 2;
345
+
346
+ // Specifies whether to filter out adversarial queries. The default value
347
+ // is `false`.
348
+ //
349
+ // Google employs search-query classification to detect adversarial
350
+ // queries. No summary is returned if the search query is classified as an
351
+ // adversarial query. For example, a user might ask a question regarding
352
+ // negative comments about the company or submit a query designed to
353
+ // generate unsafe, policy-violating output. If this field is set to
354
+ // `true`, we skip generating summaries for adversarial queries and return
355
+ // fallback messages instead.
356
+ bool ignore_adversarial_query = 3;
357
+
358
+ // Specifies whether to filter out queries that are not summary-seeking.
359
+ // The default value is `false`.
360
+ //
361
+ // Google employs search-query classification to detect summary-seeking
362
+ // queries. No summary is returned if the search query is classified as a
363
+ // non-summary seeking query. For example, `why is the sky blue` and `Who
364
+ // is the best soccer player in the world?` are summary-seeking queries,
365
+ // but `SFO airport` and `world cup 2026` are not. They are most likely
366
+ // navigational queries. If this field is set to `true`, we skip
367
+ // generating summaries for non-summary seeking queries and return
368
+ // fallback messages instead.
369
+ bool ignore_non_summary_seeking_query = 4;
370
+
371
+ // Language code for Summary. Use language tags defined by
372
+ // [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
373
+ string language_code = 6;
313
374
  }
314
375
 
315
- // The specification that configs the extractive content in search results.
376
+ // A specification for configuring the extractive content in a search
377
+ // response.
316
378
  message ExtractiveContentSpec {
317
- // The max number of extractive answers returned in each search result.
379
+ // The maximum number of extractive answers returned in each search
380
+ // result.
318
381
  //
319
382
  // An extractive answer is a verbatim answer extracted from the original
320
- // document, which provides precise and contextually relevant answer to
383
+ // document, which provides a precise and contextually relevant answer to
321
384
  // the search query.
322
385
  //
323
386
  // If the number of matching answers is less than the
324
- // extractive_answer_count, return all of the answers; otherwise, return
325
- // the extractive_answer_count.
387
+ // `max_extractive_answer_count`, return all of the answers. Otherwise,
388
+ // return the `max_extractive_answer_count`.
326
389
  //
327
- // At most 5 answers will be returned for each SearchResult.
390
+ // At most one answer is returned for each
391
+ // [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult].
328
392
  int32 max_extractive_answer_count = 1;
329
393
 
330
394
  // The max number of extractive segments returned in each search result.
395
+ // Only applied if the
396
+ // [DataStore][google.cloud.discoveryengine.v1beta.DataStore] is set to
397
+ // [DataStore.ContentConfig.CONTENT_REQUIRED][google.cloud.discoveryengine.v1beta.DataStore.ContentConfig.CONTENT_REQUIRED]
398
+ // or
399
+ // [DataStore.solution_types][google.cloud.discoveryengine.v1beta.DataStore.solution_types]
400
+ // is
401
+ // [SOLUTION_TYPE_CHAT][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_CHAT].
331
402
  //
332
403
  // An extractive segment is a text segment extracted from the original
333
- // document which is relevant to the search query and in general more
334
- // verbose than an extrative answer. The segment could then be used as
404
+ // document that is relevant to the search query, and, in general, more
405
+ // verbose than an extractive answer. The segment could then be used as
335
406
  // input for LLMs to generate summaries and answers.
336
407
  //
337
- // If the number of matching segments is less than the
338
- // max_extractive_segment_count, return all of the segments; otherwise,
339
- // return the max_extractive_segment_count.
340
- //
341
- // Currently one segment will be returned for each SearchResult.
408
+ // If the number of matching segments is less than
409
+ // `max_extractive_segment_count`, return all of the segments. Otherwise,
410
+ // return the `max_extractive_segment_count`.
342
411
  int32 max_extractive_segment_count = 2;
412
+
413
+ // Specifies whether to return the confidence score from the extractive
414
+ // segments in each search result. The default value is `false`.
415
+ bool return_extractive_segment_score = 3;
416
+
417
+ // Specifies whether to also include the adjacent from each selected
418
+ // segments.
419
+ // Return at most `num_previous_segments` segments before each selected
420
+ // segments.
421
+ int32 num_previous_segments = 4;
422
+
423
+ // Return at most `num_next_segments` segments after each selected
424
+ // segments.
425
+ int32 num_next_segments = 5;
343
426
  }
344
427
 
345
- // If there is no snippet spec provided, there will be no snippet in the
346
- // search result.
428
+ // If `snippetSpec` is not specified, snippets are not included in the
429
+ // search response.
347
430
  SnippetSpec snippet_spec = 1;
348
431
 
349
- // If there is no summary spec provided, there will be no summary in the
432
+ // If `summarySpec` is not specified, summaries are not included in the
350
433
  // search response.
351
434
  SummarySpec summary_spec = 2;
352
435
 
@@ -355,6 +438,22 @@ message SearchRequest {
355
438
  ExtractiveContentSpec extractive_content_spec = 3;
356
439
  }
357
440
 
441
+ // The specification that uses customized query embedding vector to do
442
+ // semantic document retrieval.
443
+ message EmbeddingSpec {
444
+ // Embedding vector.
445
+ message EmbeddingVector {
446
+ // Embedding field path in schema.
447
+ string field_path = 1;
448
+
449
+ // Query embedding vector.
450
+ repeated float vector = 2;
451
+ }
452
+
453
+ // The embedding vector used for retrieval. Limit to 1.
454
+ repeated EmbeddingVector embedding_vectors = 1;
455
+ }
456
+
358
457
  // Required. The resource name of the Search serving config, such as
359
458
  // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
360
459
  // This field is used to identify the serving configuration name, set
@@ -378,9 +477,12 @@ message SearchRequest {
378
477
  // Raw search query.
379
478
  string query = 3;
380
479
 
480
+ // Raw image query.
481
+ ImageQuery image_query = 19;
482
+
381
483
  // Maximum number of [Document][google.cloud.discoveryengine.v1beta.Document]s
382
484
  // to return. If unspecified, defaults to a reasonable value. The maximum
383
- // allowed value is 100. Values above 100 will be coerced to 100.
485
+ // allowed value is 100. Values above 100 are coerced to 100.
384
486
  //
385
487
  // If this field is negative, an `INVALID_ARGUMENT` is returned.
386
488
  int32 page_size = 4;
@@ -412,17 +514,18 @@ message SearchRequest {
412
514
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
413
515
  string filter = 7;
414
516
 
415
- // The order in which documents are returned. Document can be ordered by
517
+ // The order in which documents are returned. Documents can be ordered by
416
518
  // a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
417
- // object. Leave it unset if ordered by relevance. OrderBy expression is
519
+ // object. Leave it unset if ordered by relevance. `order_by` expression is
418
520
  // case-sensitive.
419
521
  //
420
- // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
522
+ // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
421
523
  string order_by = 8;
422
524
 
423
525
  // Information about the end user.
424
- // Highly recommended for analytics. The user_agent string in UserInfo will
425
- // be used to deduce device_type for analytics.
526
+ // Highly recommended for analytics.
527
+ // [UserInfo.user_agent][google.cloud.discoveryengine.v1beta.UserInfo.user_agent]
528
+ // is used to deduce `device_type` for analytics.
426
529
  UserInfo user_info = 21;
427
530
 
428
531
  // Facet specifications for faceted search. If empty, no facets are returned.
@@ -446,11 +549,11 @@ message SearchRequest {
446
549
  map<string, google.protobuf.Value> params = 11;
447
550
 
448
551
  // The query expansion specification that specifies the conditions under which
449
- // query expansion will occur.
552
+ // query expansion occurs.
450
553
  QueryExpansionSpec query_expansion_spec = 13;
451
554
 
452
555
  // The spell correction specification that specifies the mode under
453
- // which spell correction will take effect.
556
+ // which spell correction takes effect.
454
557
  SpellCorrectionSpec spell_correction_spec = 14;
455
558
 
456
559
  // A unique identifier for tracking visitors. For example, this could be
@@ -469,12 +572,42 @@ message SearchRequest {
469
572
  // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
470
573
  string user_pseudo_id = 15;
471
574
 
472
- // The content search spec that configs the desired behavior of content
473
- // search.
575
+ // A specification for configuring the behavior of content search.
474
576
  ContentSearchSpec content_search_spec = 24;
475
577
 
578
+ // Uses the provided embedding to do additional semantic document retrieval.
579
+ // The retrieval is based on the dot product of
580
+ // [SearchRequest.embedding_spec.embedding_vectors.vector][] and the document
581
+ // embedding that is provided in
582
+ // [SearchRequest.embedding_spec.embedding_vectors.field_path][].
583
+ //
584
+ // If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
585
+ // provided, it will use [ServingConfig.embedding_config.field_paths][].
586
+ EmbeddingSpec embedding_spec = 23;
587
+
588
+ // The ranking expression controls the customized ranking on retrieval
589
+ // documents. This overrides [ServingConfig.ranking_expression][].
590
+ // The ranking expression is a single function or multiple functions that are
591
+ // joint by "+".
592
+ // * ranking_expression = function, { " + ", function };
593
+ // Supported functions:
594
+ // * double * relevance_score
595
+ // * double * dotProduct(embedding_field_path)
596
+ // Function variables:
597
+ // `relevance_score`: pre-defined keywords, used for measure relevance
598
+ // between query and document.
599
+ // `embedding_field_path`: the document embedding field
600
+ // used with query embedding vector.
601
+ // `dotProduct`: embedding function between embedding_field_path and query
602
+ // embedding vector.
603
+ //
604
+ // Example ranking expression:
605
+ // If document has an embedding field doc_embedding, the ranking expression
606
+ // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
607
+ string ranking_expression = 26;
608
+
476
609
  // Whether to turn on safe search. This is only supported for
477
- // [ContentConfig.PUBLIC_WEBSITE][].
610
+ // website search.
478
611
  bool safe_search = 20;
479
612
 
480
613
  // The user labels applied to a resource must meet the following requirements:
@@ -510,6 +643,9 @@ message SearchResponse {
510
643
  // The document data snippet in the search response. Only fields that are
511
644
  // marked as retrievable are populated.
512
645
  Document document = 2;
646
+
647
+ // Google provided available scores.
648
+ map<string, DoubleList> model_scores = 4;
513
649
  }
514
650
 
515
651
  // A facet result.
@@ -556,12 +692,85 @@ message SearchResponse {
556
692
 
557
693
  // A list of ranked refinement attributes.
558
694
  repeated RefinementAttribute refinement_attributes = 1;
695
+
696
+ // Suggested follow-up questions.
697
+ repeated string follow_up_questions = 2;
559
698
  }
560
699
 
561
700
  // Summary of the top N search result specified by the summary spec.
562
701
  message Summary {
702
+ // Safety Attribute categories and their associated confidence scores.
703
+ message SafetyAttributes {
704
+ // The display names of Safety Attribute categories associated with the
705
+ // generated content. Order matches the Scores.
706
+ repeated string categories = 1;
707
+
708
+ // The confidence scores of the each category, higher
709
+ // value means higher confidence. Order matches the Categories.
710
+ repeated float scores = 2;
711
+ }
712
+
713
+ // An Enum for summary-skipped reasons.
714
+ enum SummarySkippedReason {
715
+ // Default value. The summary skipped reason is not specified.
716
+ SUMMARY_SKIPPED_REASON_UNSPECIFIED = 0;
717
+
718
+ // The adversarial query ignored case.
719
+ //
720
+ // Only populated when
721
+ // [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
722
+ // is set to `true`.
723
+ ADVERSARIAL_QUERY_IGNORED = 1;
724
+
725
+ // The non-summary seeking query ignored case.
726
+ //
727
+ // Only populated when
728
+ // [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
729
+ // is set to `true`.
730
+ NON_SUMMARY_SEEKING_QUERY_IGNORED = 2;
731
+
732
+ // The out-of-domain query ignored case.
733
+ //
734
+ // Google skips the summary if there are no high-relevance search results.
735
+ // For example, the data store contains facts about company A but the
736
+ // user query is asking questions about company B.
737
+ OUT_OF_DOMAIN_QUERY_IGNORED = 3;
738
+
739
+ // The potential policy violation case.
740
+ //
741
+ // Google skips the summary if there is a potential policy violation
742
+ // detected. This includes content that may be violent or toxic.
743
+ POTENTIAL_POLICY_VIOLATION = 4;
744
+
745
+ // The LLM addon not enabled case.
746
+ //
747
+ // Google skips the summary if the LLM addon is not enabled.
748
+ LLM_ADDON_NOT_ENABLED = 5;
749
+ }
750
+
563
751
  // The summary content.
564
752
  string summary_text = 1;
753
+
754
+ // Additional summary-skipped reasons. This provides the reason for ignored
755
+ // cases. If nothing is skipped, this field is not set.
756
+ repeated SummarySkippedReason summary_skipped_reasons = 2;
757
+
758
+ // A collection of Safety Attribute categories and their associated
759
+ // confidence scores.
760
+ SafetyAttributes safety_attributes = 3;
761
+ }
762
+
763
+ // Information describing query expansion including whether expansion has
764
+ // occurred.
765
+ message QueryExpansionInfo {
766
+ // Bool describing whether query expansion has occurred.
767
+ bool expanded_query = 1;
768
+
769
+ // Number of pinned results. This field will only be set when expansion
770
+ // happens and
771
+ // [SearchRequest.QueryExpansionSpec.pin_unexpanded_results][google.cloud.discoveryengine.v1beta.SearchRequest.QueryExpansionSpec.pin_unexpanded_results]
772
+ // is set to true.
773
+ int64 pinned_result_count = 2;
565
774
  }
566
775
 
567
776
  // A list of matched documents. The order represents the ranking.
@@ -614,4 +823,7 @@ message SearchResponse {
614
823
 
615
824
  // Controls applied as part of the Control service.
616
825
  repeated string applied_controls = 10;
826
+
827
+ // Query expansion information for the returned results.
828
+ QueryExpansionInfo query_expansion_info = 14;
617
829
  }