@google-cloud/discoveryengine 1.3.1 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (166) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +64 -0
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +54 -3
  4. package/build/protos/google/cloud/discoveryengine/v1/completion.proto +52 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +51 -4
  6. package/build/protos/google/cloud/discoveryengine/v1/conversation.proto +3 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +40 -1
  8. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +98 -0
  9. package/build/protos/google/cloud/discoveryengine/v1/data_store_service.proto +304 -0
  10. package/build/protos/google/cloud/discoveryengine/v1/document.proto +1 -1
  11. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +215 -0
  12. package/build/protos/google/cloud/discoveryengine/v1/engine_service.proto +242 -0
  13. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +64 -0
  14. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +38 -0
  15. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +137 -4
  16. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine.proto +170 -0
  17. package/build/protos/google/cloud/discoveryengine/v1/site_search_engine_service.proto +691 -0
  18. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +3 -3
  19. package/build/protos/google/cloud/discoveryengine/v1alpha/acl_config.proto +49 -0
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/acl_config_service.proto +79 -0
  21. package/build/protos/google/cloud/discoveryengine/v1alpha/chunk.proto +72 -0
  22. package/build/protos/google/cloud/discoveryengine/v1alpha/chunk_service.proto +137 -0
  23. package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +77 -4
  24. package/build/protos/google/cloud/discoveryengine/v1alpha/completion.proto +52 -0
  25. package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +44 -2
  26. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +6 -1
  27. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store.proto +44 -0
  28. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store_service.proto +80 -1
  29. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +83 -0
  30. package/build/protos/google/cloud/discoveryengine/v1alpha/document_processing_config.proto +127 -0
  31. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +6 -0
  32. package/build/protos/google/cloud/discoveryengine/v1alpha/engine.proto +13 -8
  33. package/build/protos/google/cloud/discoveryengine/v1alpha/engine_service.proto +3 -2
  34. package/build/protos/google/cloud/discoveryengine/v1alpha/estimate_billing_service.proto +130 -0
  35. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +64 -0
  36. package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +66 -0
  37. package/build/protos/google/cloud/discoveryengine/v1alpha/recommendation_service.proto +3 -1
  38. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +3 -0
  39. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +74 -13
  40. package/build/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto +24 -20
  41. package/build/protos/google/cloud/discoveryengine/v1alpha/serving_config.proto +271 -0
  42. package/build/protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto +147 -0
  43. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine.proto +9 -3
  44. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +7 -4
  45. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +4 -3
  46. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +59 -8
  47. package/build/protos/google/cloud/discoveryengine/v1beta/completion.proto +52 -0
  48. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +51 -4
  49. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +3 -0
  50. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +45 -1
  51. package/build/protos/google/cloud/discoveryengine/v1beta/data_store.proto +120 -0
  52. package/build/protos/google/cloud/discoveryengine/v1beta/data_store_service.proto +306 -0
  53. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +10 -1
  54. package/build/protos/google/cloud/discoveryengine/v1beta/document_processing_config.proto +94 -0
  55. package/build/protos/google/cloud/discoveryengine/v1beta/engine.proto +220 -0
  56. package/build/protos/google/cloud/discoveryengine/v1beta/engine_service.proto +244 -0
  57. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +64 -0
  58. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +41 -0
  59. package/build/protos/google/cloud/discoveryengine/v1beta/recommendation_service.proto +26 -3
  60. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +169 -15
  61. package/build/protos/google/cloud/discoveryengine/v1beta/search_tuning_service.proto +151 -0
  62. package/build/protos/google/cloud/discoveryengine/v1beta/serving_config.proto +265 -0
  63. package/build/protos/google/cloud/discoveryengine/v1beta/serving_config_service.proto +148 -0
  64. package/build/protos/google/cloud/discoveryengine/v1beta/site_search_engine.proto +170 -0
  65. package/build/protos/google/cloud/discoveryengine/v1beta/site_search_engine_service.proto +695 -0
  66. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -3
  67. package/build/protos/protos.d.ts +48530 -23682
  68. package/build/protos/protos.js +122429 -63306
  69. package/build/protos/protos.json +13438 -7286
  70. package/build/src/index.d.ts +10 -1
  71. package/build/src/index.js +10 -1
  72. package/build/src/v1/completion_service_client.d.ts +489 -7
  73. package/build/src/v1/completion_service_client.js +715 -11
  74. package/build/src/v1/completion_service_client_config.json +10 -0
  75. package/build/src/v1/conversational_search_service_client.d.ts +341 -3
  76. package/build/src/v1/conversational_search_service_client.js +466 -9
  77. package/build/src/v1/data_store_service_client.d.ts +1286 -0
  78. package/build/src/v1/data_store_service_client.js +1768 -0
  79. package/build/src/v1/data_store_service_client_config.json +46 -0
  80. package/build/src/v1/document_service_client.d.ts +347 -2
  81. package/build/src/v1/document_service_client.js +506 -9
  82. package/build/src/v1/engine_service_client.d.ts +1211 -0
  83. package/build/src/v1/engine_service_client.js +1731 -0
  84. package/build/src/v1/engine_service_client_config.json +46 -0
  85. package/build/src/v1/index.d.ts +3 -0
  86. package/build/src/v1/index.js +7 -1
  87. package/build/src/v1/schema_service_client.d.ts +272 -2
  88. package/build/src/v1/schema_service_client.js +402 -9
  89. package/build/src/v1/search_service_client.d.ts +515 -11
  90. package/build/src/v1/search_service_client.js +648 -15
  91. package/build/src/v1/site_search_engine_service_client.d.ts +1564 -0
  92. package/build/src/v1/site_search_engine_service_client.js +2075 -0
  93. package/build/src/v1/site_search_engine_service_client_config.json +74 -0
  94. package/build/src/v1/user_event_service_client.d.ts +272 -2
  95. package/build/src/v1/user_event_service_client.js +402 -9
  96. package/build/src/v1alpha/acl_config_service_client.d.ts +1233 -0
  97. package/build/src/v1alpha/acl_config_service_client.js +1765 -0
  98. package/build/src/v1alpha/acl_config_service_client_config.json +34 -0
  99. package/build/src/v1alpha/chunk_service_client.d.ts +1350 -0
  100. package/build/src/v1alpha/chunk_service_client.js +1886 -0
  101. package/build/src/v1alpha/chunk_service_client_config.json +34 -0
  102. package/build/src/v1alpha/completion_service_client.d.ts +599 -5
  103. package/build/src/v1alpha/completion_service_client.js +868 -12
  104. package/build/src/v1alpha/completion_service_client_config.json +10 -0
  105. package/build/src/v1alpha/conversational_search_service_client.d.ts +244 -3
  106. package/build/src/v1alpha/conversational_search_service_client.js +353 -10
  107. package/build/src/v1alpha/data_store_service_client.d.ts +462 -5
  108. package/build/src/v1alpha/data_store_service_client.js +599 -12
  109. package/build/src/v1alpha/data_store_service_client_config.json +8 -0
  110. package/build/src/v1alpha/document_service_client.d.ts +393 -2
  111. package/build/src/v1alpha/document_service_client.js +551 -10
  112. package/build/src/v1alpha/engine_service_client.d.ts +386 -4
  113. package/build/src/v1alpha/engine_service_client.js +551 -10
  114. package/build/src/v1alpha/estimate_billing_service_client.d.ts +1367 -0
  115. package/build/src/v1alpha/estimate_billing_service_client.js +2028 -0
  116. package/build/src/v1alpha/estimate_billing_service_client_config.json +30 -0
  117. package/build/src/v1alpha/index.d.ts +4 -0
  118. package/build/src/v1alpha/index.js +10 -2
  119. package/build/src/v1alpha/recommendation_service_client.d.ts +242 -3
  120. package/build/src/v1alpha/recommendation_service_client.js +353 -10
  121. package/build/src/v1alpha/schema_service_client.d.ts +383 -2
  122. package/build/src/v1alpha/schema_service_client.js +551 -10
  123. package/build/src/v1alpha/search_service_client.d.ts +269 -17
  124. package/build/src/v1alpha/search_service_client.js +373 -20
  125. package/build/src/v1alpha/search_tuning_service_client.d.ts +384 -3
  126. package/build/src/v1alpha/search_tuning_service_client.js +551 -10
  127. package/build/src/v1alpha/serving_config_service_client.d.ts +1369 -0
  128. package/build/src/v1alpha/serving_config_service_client.js +1935 -0
  129. package/build/src/v1alpha/serving_config_service_client_config.json +38 -0
  130. package/build/src/v1alpha/site_search_engine_service_client.d.ts +383 -2
  131. package/build/src/v1alpha/site_search_engine_service_client.js +551 -10
  132. package/build/src/v1alpha/user_event_service_client.d.ts +383 -2
  133. package/build/src/v1alpha/user_event_service_client.js +551 -10
  134. package/build/src/v1beta/completion_service_client.d.ts +708 -7
  135. package/build/src/v1beta/completion_service_client.js +1015 -11
  136. package/build/src/v1beta/completion_service_client_config.json +10 -0
  137. package/build/src/v1beta/conversational_search_service_client.d.ts +420 -3
  138. package/build/src/v1beta/conversational_search_service_client.js +570 -9
  139. package/build/src/v1beta/data_store_service_client.d.ts +1508 -0
  140. package/build/src/v1beta/data_store_service_client.js +2070 -0
  141. package/build/src/v1beta/data_store_service_client_config.json +46 -0
  142. package/build/src/v1beta/document_service_client.d.ts +566 -2
  143. package/build/src/v1beta/document_service_client.js +810 -11
  144. package/build/src/v1beta/engine_service_client.d.ts +1432 -0
  145. package/build/src/v1beta/engine_service_client.js +2032 -0
  146. package/build/src/v1beta/engine_service_client_config.json +46 -0
  147. package/build/src/v1beta/index.d.ts +5 -0
  148. package/build/src/v1beta/index.js +11 -1
  149. package/build/src/v1beta/recommendation_service_client.d.ts +495 -5
  150. package/build/src/v1beta/recommendation_service_client.js +674 -9
  151. package/build/src/v1beta/schema_service_client.d.ts +491 -2
  152. package/build/src/v1beta/schema_service_client.js +706 -11
  153. package/build/src/v1beta/search_service_client.d.ts +620 -29
  154. package/build/src/v1beta/search_service_client.js +772 -27
  155. package/build/src/v1beta/search_tuning_service_client.d.ts +1196 -0
  156. package/build/src/v1beta/search_tuning_service_client.js +1781 -0
  157. package/build/src/v1beta/search_tuning_service_client_config.json +30 -0
  158. package/build/src/v1beta/serving_config_service_client.d.ts +1217 -0
  159. package/build/src/v1beta/serving_config_service_client.js +1724 -0
  160. package/build/src/v1beta/serving_config_service_client_config.json +38 -0
  161. package/build/src/v1beta/site_search_engine_service_client.d.ts +1787 -0
  162. package/build/src/v1beta/site_search_engine_service_client.js +2375 -0
  163. package/build/src/v1beta/site_search_engine_service_client_config.json +74 -0
  164. package/build/src/v1beta/user_event_service_client.d.ts +491 -2
  165. package/build/src/v1beta/user_event_service_client.js +706 -11
  166. package/package.json +3 -3
@@ -48,6 +48,10 @@ service SearchService {
48
48
  post: "/v1beta/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:search"
49
49
  body: "*"
50
50
  }
51
+ additional_bindings {
52
+ post: "/v1beta/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:search"
53
+ body: "*"
54
+ }
51
55
  };
52
56
  }
53
57
  }
@@ -65,6 +69,19 @@ message SearchRequest {
65
69
  }
66
70
  }
67
71
 
72
+ // A struct to define data stores to filter on in a search call.
73
+ message DataStoreSpec {
74
+ // Required. Full resource name of
75
+ // [DataStore][google.cloud.discoveryengine.v1beta.DataStore], such as
76
+ // `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}`.
77
+ string data_store = 1 [
78
+ (google.api.field_behavior) = REQUIRED,
79
+ (google.api.resource_reference) = {
80
+ type: "discoveryengine.googleapis.com/DataStore"
81
+ }
82
+ ];
83
+ }
84
+
68
85
  // A facet specification to perform faceted search.
69
86
  message FacetSpec {
70
87
  // Specifies how a facet is computed.
@@ -208,9 +225,8 @@ message SearchRequest {
208
225
  // Examples:
209
226
  //
210
227
  // * To boost documents with document ID "doc_1" or "doc_2", and
211
- // color
212
- // "Red" or "Blue":
213
- // * (id: ANY("doc_1", "doc_2")) AND (color: ANY("Red","Blue"))
228
+ // color "Red" or "Blue":
229
+ // `(document_id: ANY("doc_1", "doc_2")) AND (color: ANY("Red", "Blue"))`
214
230
  string condition = 1;
215
231
 
216
232
  // Strength of the condition boost, which should be in [-1, 1]. Negative
@@ -317,11 +333,33 @@ message SearchRequest {
317
333
  // A specification for configuring a summary returned in a search
318
334
  // response.
319
335
  message SummarySpec {
336
+ // Specification of the prompt to use with the model.
337
+ message ModelPromptSpec {
338
+ // Text at the beginning of the prompt that instructs the assistant.
339
+ // Examples are available in the user guide.
340
+ string preamble = 1;
341
+ }
342
+
343
+ // Specification of the model.
344
+ message ModelSpec {
345
+ // The model version used to generate the summary.
346
+ //
347
+ // Supported values are:
348
+ //
349
+ // * `stable`: string. Default value when no value is specified. Uses a
350
+ // generally available, fine-tuned version of the text-bison@001
351
+ // model.
352
+ // * `preview`: string. (Public preview) Uses a fine-tuned version of
353
+ // the text-bison@002 model. This model works only for summaries in
354
+ // English.
355
+ string version = 1;
356
+ }
357
+
320
358
  // The number of top results to generate the summary from. If the number
321
359
  // of results returned is less than `summaryResultCount`, the summary is
322
360
  // generated from all of the results.
323
361
  //
324
- // At most five results can be used to generate a summary.
362
+ // At most 10 results can be used to generate a summary.
325
363
  int32 summary_result_count = 1;
326
364
 
327
365
  // Specifies whether to include citations in the summary. The default
@@ -368,9 +406,18 @@ message SearchRequest {
368
406
  // fallback messages instead.
369
407
  bool ignore_non_summary_seeking_query = 4;
370
408
 
409
+ // If specified, the spec will be used to modify the prompt provided to
410
+ // the LLM.
411
+ ModelPromptSpec model_prompt_spec = 5;
412
+
371
413
  // Language code for Summary. Use language tags defined by
372
- // [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
414
+ // [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
415
+ // Note: This is an experimental feature.
373
416
  string language_code = 6;
417
+
418
+ // If specified, the spec will be used to modify the model specification
419
+ // provided to the LLM.
420
+ ModelSpec model_spec = 7;
374
421
  }
375
422
 
376
423
  // A specification for configuring the extractive content in a search
@@ -387,7 +434,7 @@ message SearchRequest {
387
434
  // `max_extractive_answer_count`, return all of the answers. Otherwise,
388
435
  // return the `max_extractive_answer_count`.
389
436
  //
390
- // At most one answer is returned for each
437
+ // At most five answers are returned for each
391
438
  // [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult].
392
439
  int32 max_extractive_answer_count = 1;
393
440
 
@@ -412,6 +459,9 @@ message SearchRequest {
412
459
 
413
460
  // Specifies whether to return the confidence score from the extractive
414
461
  // segments in each search result. The default value is `false`.
462
+ //
463
+ // Note: this is a priavte preview feature and only works for allowlisted
464
+ // users, please reach out to Cloud Support team if you want to use it.
415
465
  bool return_extractive_segment_score = 3;
416
466
 
417
467
  // Specifies whether to also include the adjacent from each selected
@@ -455,6 +505,8 @@ message SearchRequest {
455
505
  }
456
506
 
457
507
  // Required. The resource name of the Search serving config, such as
508
+ // `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
509
+ // or
458
510
  // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
459
511
  // This field is used to identify the serving configuration name, set
460
512
  // of models used to make the search.
@@ -507,17 +559,45 @@ message SearchRequest {
507
559
  // If this field is negative, an `INVALID_ARGUMENT` is returned.
508
560
  int32 offset = 6;
509
561
 
562
+ // A list of data store specs to apply on a search call.
563
+ repeated DataStoreSpec data_store_specs = 32;
564
+
510
565
  // The filter syntax consists of an expression language for constructing a
511
566
  // predicate from one or more fields of the documents being filtered. Filter
512
567
  // expression is case-sensitive.
513
568
  //
514
569
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
570
+ //
571
+ // Filtering in Vertex AI Search is done by mapping the LHS filter key to a
572
+ // key property defined in the Vertex AI Search backend -- this mapping is
573
+ // defined by the customer in their schema. For example a media customer might
574
+ // have a field 'name' in their schema. In this case the filter would look
575
+ // like this: filter --> name:'ANY("king kong")'
576
+ //
577
+ // For more information about filtering including syntax and filter
578
+ // operators, see
579
+ // [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
515
580
  string filter = 7;
516
581
 
582
+ // The default filter that is applied when a user performs a search without
583
+ // checking any filters on the search page.
584
+ //
585
+ // The filter applied to every search request when quality improvement such as
586
+ // query expansion is needed. In the case a query does not have a sufficient
587
+ // amount of results this filter will be used to determine whether or not to
588
+ // enable the query expansion flow. The original filter will still be used for
589
+ // the query expanded search.
590
+ // This field is strongly recommended to achieve high search quality.
591
+ //
592
+ // For more information about filter syntax, see
593
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1beta.SearchRequest.filter].
594
+ string canonical_filter = 29;
595
+
517
596
  // The order in which documents are returned. Documents can be ordered by
518
597
  // a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
519
598
  // object. Leave it unset if ordered by relevance. `order_by` expression is
520
- // case-sensitive.
599
+ // case-sensitive. For more information on ordering, see
600
+ // [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
521
601
  //
522
602
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
523
603
  string order_by = 8;
@@ -535,6 +615,8 @@ message SearchRequest {
535
615
  repeated FacetSpec facet_specs = 9;
536
616
 
537
617
  // Boost specification to boost certain documents.
618
+ // For more information on boosting, see
619
+ // [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
538
620
  BoostSpec boost_spec = 10;
539
621
 
540
622
  // Additional search parameters.
@@ -543,9 +625,17 @@ message SearchRequest {
543
625
  //
544
626
  // * `user_country_code`: string. Default empty. If set to non-empty, results
545
627
  // are restricted or boosted based on the location provided.
628
+ // Example:
629
+ // user_country_code: "au"
630
+ //
631
+ // For available codes see [Country
632
+ // Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes)
633
+ //
546
634
  // * `search_type`: double. Default empty. Enables non-webpage searching
547
- // depending on the value. The only valid non-default value is 1,
548
- // which enables image searching.
635
+ // depending on the value. The only valid non-default value is 1,
636
+ // which enables image searching.
637
+ // Example:
638
+ // search_type: 1
549
639
  map<string, google.protobuf.Value> params = 11;
550
640
 
551
641
  // The query expansion specification that specifies the conditions under which
@@ -577,16 +667,18 @@ message SearchRequest {
577
667
 
578
668
  // Uses the provided embedding to do additional semantic document retrieval.
579
669
  // 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][].
670
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.vector][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.vector]
671
+ // and the document embedding that is provided in
672
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.field_path][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path].
583
673
  //
584
- // If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
585
- // provided, it will use [ServingConfig.embedding_config.field_paths][].
674
+ // If
675
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.field_path][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path]
676
+ // is not provided, it will use [ServingConfig.EmbeddingConfig.field_path][].
586
677
  EmbeddingSpec embedding_spec = 23;
587
678
 
588
679
  // The ranking expression controls the customized ranking on retrieval
589
- // documents. This overrides [ServingConfig.ranking_expression][].
680
+ // documents. This overrides
681
+ // [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1beta.ServingConfig.ranking_expression].
590
682
  // The ranking expression is a single function or multiple functions that are
591
683
  // joint by "+".
592
684
  // * ranking_expression = function, { " + ", function };
@@ -710,6 +802,65 @@ message SearchResponse {
710
802
  repeated float scores = 2;
711
803
  }
712
804
 
805
+ // Citation metadata.
806
+ message CitationMetadata {
807
+ // Citations for segments.
808
+ repeated Citation citations = 1;
809
+ }
810
+
811
+ // Citation info for a segment.
812
+ message Citation {
813
+ // Index indicates the start of the segment, measured in bytes/unicode.
814
+ int64 start_index = 1;
815
+
816
+ // End of the attributed segment, exclusive.
817
+ int64 end_index = 2;
818
+
819
+ // Citation sources for the attributed segment.
820
+ repeated CitationSource sources = 3;
821
+ }
822
+
823
+ // Citation source.
824
+ message CitationSource {
825
+ // Document reference index from SummaryWithMetadata.references.
826
+ // It is 0-indexed and the value will be zero if the reference_index is
827
+ // not set explicitly.
828
+ int64 reference_index = 4;
829
+ }
830
+
831
+ // Document reference.
832
+ message Reference {
833
+ // Title of the document.
834
+ string title = 1;
835
+
836
+ // Required.
837
+ // [Document.name][google.cloud.discoveryengine.v1beta.Document.name] of
838
+ // the document. Full resource name of the referenced document, in the
839
+ // format
840
+ // `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
841
+ string document = 2 [
842
+ (google.api.field_behavior) = REQUIRED,
843
+ (google.api.resource_reference) = {
844
+ type: "discoveryengine.googleapis.com/Document"
845
+ }
846
+ ];
847
+
848
+ // Cloud Storage or HTTP uri for the document.
849
+ string uri = 3;
850
+ }
851
+
852
+ // Summary with metadata information.
853
+ message SummaryWithMetadata {
854
+ // Summary text with no citation information.
855
+ string summary = 1;
856
+
857
+ // Citation metadata for given summary.
858
+ CitationMetadata citation_metadata = 2;
859
+
860
+ // Document References.
861
+ repeated Reference references = 3;
862
+ }
863
+
713
864
  // An Enum for summary-skipped reasons.
714
865
  enum SummarySkippedReason {
715
866
  // Default value. The summary skipped reason is not specified.
@@ -758,6 +909,9 @@ message SearchResponse {
758
909
  // A collection of Safety Attribute categories and their associated
759
910
  // confidence scores.
760
911
  SafetyAttributes safety_attributes = 3;
912
+
913
+ // Summary with metadata information.
914
+ SummaryWithMetadata summary_with_metadata = 4;
761
915
  }
762
916
 
763
917
  // Information describing query expansion including whether expansion has
@@ -0,0 +1,151 @@
1
+ // Copyright 2022 Google LLC
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ syntax = "proto3";
16
+
17
+ package google.cloud.discoveryengine.v1beta;
18
+
19
+ import "google/api/annotations.proto";
20
+ import "google/api/client.proto";
21
+ import "google/api/field_behavior.proto";
22
+ import "google/api/resource.proto";
23
+ import "google/cloud/discoveryengine/v1beta/import_config.proto";
24
+ import "google/longrunning/operations.proto";
25
+ import "google/protobuf/timestamp.proto";
26
+ import "google/rpc/status.proto";
27
+
28
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
29
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
30
+ option java_multiple_files = true;
31
+ option java_outer_classname = "SearchTuningServiceProto";
32
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
33
+ option objc_class_prefix = "DISCOVERYENGINE";
34
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
35
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
36
+
37
+ // Service for search tuning.
38
+ service SearchTuningService {
39
+ option (google.api.default_host) = "discoveryengine.googleapis.com";
40
+ option (google.api.oauth_scopes) =
41
+ "https://www.googleapis.com/auth/cloud-platform";
42
+
43
+ // Trains a custom model.
44
+ rpc TrainCustomModel(TrainCustomModelRequest)
45
+ returns (google.longrunning.Operation) {
46
+ option (google.api.http) = {
47
+ post: "/v1beta/{data_store=projects/*/locations/*/collections/*/dataStores/*}:trainCustomModel"
48
+ body: "*"
49
+ };
50
+ option (google.longrunning.operation_info) = {
51
+ response_type: "google.cloud.discoveryengine.v1beta.TrainCustomModelResponse"
52
+ metadata_type: "google.cloud.discoveryengine.v1beta.TrainCustomModelMetadata"
53
+ };
54
+ }
55
+ }
56
+
57
+ // Request message for
58
+ // [SearchTuningService.TrainCustomModel][google.cloud.discoveryengine.v1beta.SearchTuningService.TrainCustomModel]
59
+ // method.
60
+ message TrainCustomModelRequest {
61
+ // Cloud Storage training data input.
62
+ message GcsTrainingInput {
63
+ // The Cloud Storage corpus data which could be associated in train data.
64
+ // The data path format is `gs://<bucket_to_data>/<jsonl_file_name>`.
65
+ // A newline delimited jsonl/ndjson file.
66
+ //
67
+ // For search-tuning model, each line should have the _id, title
68
+ // and text. Example:
69
+ // `{"_id": "doc1", title: "relevant doc", "text": "relevant text"}`
70
+ string corpus_data_path = 1;
71
+
72
+ // The gcs query data which could be associated in train data.
73
+ // The data path format is `gs://<bucket_to_data>/<jsonl_file_name>`.
74
+ // A newline delimited jsonl/ndjson file.
75
+ //
76
+ // For search-tuning model, each line should have the _id
77
+ // and text. Example: {"_id": "query1", "text": "example query"}
78
+ string query_data_path = 2;
79
+
80
+ // Cloud Storage training data path whose format should be
81
+ // `gs://<bucket_to_data>/<tsv_file_name>`. The file should be in tsv
82
+ // format. Each line should have the doc_id and query_id and score (number).
83
+ //
84
+ // For search-tuning model, it should have the query-id corpus-id
85
+ // score as tsv file header. The score should be a number in `[0, inf+)`.
86
+ // The larger the number is, the more relevant the pair is. Example:
87
+ //
88
+ // * `query-id\tcorpus-id\tscore`
89
+ // * `query1\tdoc1\t1`
90
+ string train_data_path = 3;
91
+
92
+ // Cloud Storage test data. Same format as train_data_path. If not provided,
93
+ // a random 80/20 train/test split will be performed on train_data_path.
94
+ string test_data_path = 4;
95
+ }
96
+
97
+ // Model training input.
98
+ oneof training_input {
99
+ // Cloud Storage training input.
100
+ GcsTrainingInput gcs_training_input = 2;
101
+ }
102
+
103
+ // Required. The resource name of the Data Store, such as
104
+ // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store`.
105
+ // This field is used to identify the data store where to train the models.
106
+ string data_store = 1 [
107
+ (google.api.field_behavior) = REQUIRED,
108
+ (google.api.resource_reference) = {
109
+ type: "discoveryengine.googleapis.com/DataStore"
110
+ }
111
+ ];
112
+
113
+ // Model to be trained. Supported values are:
114
+ //
115
+ // * **search-tuning**: Fine tuning the search system based on data provided.
116
+ string model_type = 3;
117
+
118
+ // The desired location of errors incurred during the data ingestion and
119
+ // training.
120
+ ImportErrorConfig error_config = 4;
121
+ }
122
+
123
+ // Response of the
124
+ // [TrainCustomModelRequest][google.cloud.discoveryengine.v1beta.TrainCustomModelRequest].
125
+ // This message is returned by the google.longrunning.Operations.response field.
126
+ message TrainCustomModelResponse {
127
+ // A sample of errors encountered while processing the data.
128
+ repeated google.rpc.Status error_samples = 1;
129
+
130
+ // Echoes the destination for the complete errors in the request if set.
131
+ ImportErrorConfig error_config = 2;
132
+
133
+ // The trained model status. Possible values are:
134
+ //
135
+ // * **bad-data**: The training data quality is bad.
136
+ // * **no-improvement**: Tuning didn't improve performance. Won't deploy.
137
+ // * **in-progress**: Model training is in progress.
138
+ // * **ready**: The model is ready for serving.
139
+ string model_status = 3;
140
+ }
141
+
142
+ // Metadata related to the progress of the TrainCustomModel operation. This is
143
+ // returned by the google.longrunning.Operation.metadata field.
144
+ message TrainCustomModelMetadata {
145
+ // Operation create time.
146
+ google.protobuf.Timestamp create_time = 1;
147
+
148
+ // Operation last update time. If the operation is done, this is also the
149
+ // finish time.
150
+ google.protobuf.Timestamp update_time = 2;
151
+ }