@google-cloud/discoveryengine 1.3.0 → 1.4.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 (131) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +63 -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/common.proto +0 -5
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/conversation.proto +3 -0
  21. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +39 -0
  22. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +1 -1
  23. package/build/protos/google/cloud/discoveryengine/v1alpha/engine_service.proto +1 -1
  24. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +97 -0
  25. package/build/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto +147 -0
  26. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine.proto +164 -0
  27. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +540 -0
  28. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +59 -8
  29. package/build/protos/google/cloud/discoveryengine/v1beta/completion.proto +52 -0
  30. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +51 -4
  31. package/build/protos/google/cloud/discoveryengine/v1beta/conversation.proto +3 -0
  32. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +40 -1
  33. package/build/protos/google/cloud/discoveryengine/v1beta/data_store.proto +98 -0
  34. package/build/protos/google/cloud/discoveryengine/v1beta/data_store_service.proto +306 -0
  35. package/build/protos/google/cloud/discoveryengine/v1beta/document.proto +1 -1
  36. package/build/protos/google/cloud/discoveryengine/v1beta/engine.proto +220 -0
  37. package/build/protos/google/cloud/discoveryengine/v1beta/engine_service.proto +244 -0
  38. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +64 -0
  39. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +38 -0
  40. package/build/protos/google/cloud/discoveryengine/v1beta/recommendation_service.proto +26 -3
  41. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +150 -11
  42. package/build/protos/google/cloud/discoveryengine/v1beta/serving_config.proto +264 -0
  43. package/build/protos/google/cloud/discoveryengine/v1beta/serving_config_service.proto +147 -0
  44. package/build/protos/google/cloud/discoveryengine/v1beta/site_search_engine.proto +170 -0
  45. package/build/protos/google/cloud/discoveryengine/v1beta/site_search_engine_service.proto +695 -0
  46. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +4 -3
  47. package/build/protos/protos.d.ts +42822 -21397
  48. package/build/protos/protos.js +110509 -61572
  49. package/build/protos/protos.json +11779 -6752
  50. package/build/src/index.d.ts +10 -1
  51. package/build/src/index.js +11 -2
  52. package/build/src/v1/completion_service_client.d.ts +489 -7
  53. package/build/src/v1/completion_service_client.js +716 -12
  54. package/build/src/v1/completion_service_client_config.json +10 -0
  55. package/build/src/v1/conversational_search_service_client.d.ts +341 -3
  56. package/build/src/v1/conversational_search_service_client.js +467 -10
  57. package/build/src/v1/data_store_service_client.d.ts +1286 -0
  58. package/build/src/v1/data_store_service_client.js +1768 -0
  59. package/build/src/v1/data_store_service_client_config.json +46 -0
  60. package/build/src/v1/document_service_client.d.ts +347 -2
  61. package/build/src/v1/document_service_client.js +507 -10
  62. package/build/src/v1/engine_service_client.d.ts +1211 -0
  63. package/build/src/v1/engine_service_client.js +1731 -0
  64. package/build/src/v1/engine_service_client_config.json +46 -0
  65. package/build/src/v1/index.d.ts +3 -0
  66. package/build/src/v1/index.js +8 -2
  67. package/build/src/v1/schema_service_client.d.ts +272 -2
  68. package/build/src/v1/schema_service_client.js +403 -10
  69. package/build/src/v1/search_service_client.d.ts +515 -11
  70. package/build/src/v1/search_service_client.js +649 -16
  71. package/build/src/v1/site_search_engine_service_client.d.ts +1564 -0
  72. package/build/src/v1/site_search_engine_service_client.js +2075 -0
  73. package/build/src/v1/site_search_engine_service_client_config.json +74 -0
  74. package/build/src/v1/user_event_service_client.d.ts +272 -2
  75. package/build/src/v1/user_event_service_client.js +403 -10
  76. package/build/src/v1alpha/completion_service_client.d.ts +230 -2
  77. package/build/src/v1alpha/completion_service_client.js +339 -10
  78. package/build/src/v1alpha/conversational_search_service_client.d.ts +247 -2
  79. package/build/src/v1alpha/conversational_search_service_client.js +339 -10
  80. package/build/src/v1alpha/data_store_service_client.d.ts +230 -2
  81. package/build/src/v1alpha/data_store_service_client.js +347 -12
  82. package/build/src/v1alpha/document_service_client.d.ts +230 -2
  83. package/build/src/v1alpha/document_service_client.js +347 -12
  84. package/build/src/v1alpha/engine_service_client.d.ts +231 -3
  85. package/build/src/v1alpha/engine_service_client.js +347 -12
  86. package/build/src/v1alpha/index.d.ts +1 -0
  87. package/build/src/v1alpha/index.js +4 -2
  88. package/build/src/v1alpha/recommendation_service_client.d.ts +230 -2
  89. package/build/src/v1alpha/recommendation_service_client.js +339 -10
  90. package/build/src/v1alpha/schema_service_client.d.ts +230 -2
  91. package/build/src/v1alpha/schema_service_client.js +347 -12
  92. package/build/src/v1alpha/search_service_client.d.ts +269 -2
  93. package/build/src/v1alpha/search_service_client.js +365 -10
  94. package/build/src/v1alpha/search_tuning_service_client.d.ts +977 -0
  95. package/build/src/v1alpha/search_tuning_service_client.js +1479 -0
  96. package/build/src/v1alpha/search_tuning_service_client_config.json +30 -0
  97. package/build/src/v1alpha/site_search_engine_service_client.d.ts +750 -3
  98. package/build/src/v1alpha/site_search_engine_service_client.js +838 -14
  99. package/build/src/v1alpha/site_search_engine_service_client_config.json +44 -0
  100. package/build/src/v1alpha/user_event_service_client.d.ts +230 -2
  101. package/build/src/v1alpha/user_event_service_client.js +347 -12
  102. package/build/src/v1beta/completion_service_client.d.ts +633 -7
  103. package/build/src/v1beta/completion_service_client.js +912 -12
  104. package/build/src/v1beta/completion_service_client_config.json +10 -0
  105. package/build/src/v1beta/conversational_search_service_client.d.ts +341 -3
  106. package/build/src/v1beta/conversational_search_service_client.js +467 -10
  107. package/build/src/v1beta/data_store_service_client.d.ts +1433 -0
  108. package/build/src/v1beta/data_store_service_client.js +1966 -0
  109. package/build/src/v1beta/data_store_service_client_config.json +46 -0
  110. package/build/src/v1beta/document_service_client.d.ts +491 -2
  111. package/build/src/v1beta/document_service_client.js +707 -12
  112. package/build/src/v1beta/engine_service_client.d.ts +1357 -0
  113. package/build/src/v1beta/engine_service_client.js +1928 -0
  114. package/build/src/v1beta/engine_service_client_config.json +46 -0
  115. package/build/src/v1beta/index.d.ts +4 -0
  116. package/build/src/v1beta/index.js +10 -2
  117. package/build/src/v1beta/recommendation_service_client.d.ts +420 -5
  118. package/build/src/v1beta/recommendation_service_client.js +571 -10
  119. package/build/src/v1beta/schema_service_client.d.ts +416 -2
  120. package/build/src/v1beta/schema_service_client.js +603 -12
  121. package/build/src/v1beta/search_service_client.d.ts +539 -29
  122. package/build/src/v1beta/search_service_client.js +665 -28
  123. package/build/src/v1beta/serving_config_service_client.d.ts +1102 -0
  124. package/build/src/v1beta/serving_config_service_client.js +1563 -0
  125. package/build/src/v1beta/serving_config_service_client_config.json +38 -0
  126. package/build/src/v1beta/site_search_engine_service_client.d.ts +1712 -0
  127. package/build/src/v1beta/site_search_engine_service_client.js +2271 -0
  128. package/build/src/v1beta/site_search_engine_service_client_config.json +74 -0
  129. package/build/src/v1beta/user_event_service_client.d.ts +416 -2
  130. package/build/src/v1beta/user_event_service_client.js +603 -12
  131. 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
  }
@@ -317,6 +321,28 @@ message SearchRequest {
317
321
  // A specification for configuring a summary returned in a search
318
322
  // response.
319
323
  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 model version used to generate the summary.
334
+ //
335
+ // Supported values are:
336
+ //
337
+ // * `stable`: string. Default value when no value is specified. Uses a
338
+ // generally available, fine-tuned version of the text-bison@001
339
+ // model.
340
+ // * `preview`: string. (Public preview) Uses a fine-tuned version of
341
+ // the text-bison@002 model. This model works only for summaries in
342
+ // English.
343
+ string version = 1;
344
+ }
345
+
320
346
  // The number of top results to generate the summary from. If the number
321
347
  // of results returned is less than `summaryResultCount`, the summary is
322
348
  // generated from all of the results.
@@ -368,9 +394,18 @@ message SearchRequest {
368
394
  // fallback messages instead.
369
395
  bool ignore_non_summary_seeking_query = 4;
370
396
 
397
+ // If specified, the spec will be used to modify the prompt provided to
398
+ // the LLM.
399
+ ModelPromptSpec model_prompt_spec = 5;
400
+
371
401
  // Language code for Summary. Use language tags defined by
372
- // [BCP47][https://www.rfc-editor.org/rfc/bcp/bcp47.txt].
402
+ // [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
403
+ // Note: This is an experimental feature.
373
404
  string language_code = 6;
405
+
406
+ // If specified, the spec will be used to modify the model specification
407
+ // provided to the LLM.
408
+ ModelSpec model_spec = 7;
374
409
  }
375
410
 
376
411
  // A specification for configuring the extractive content in a search
@@ -387,7 +422,7 @@ message SearchRequest {
387
422
  // `max_extractive_answer_count`, return all of the answers. Otherwise,
388
423
  // return the `max_extractive_answer_count`.
389
424
  //
390
- // At most one answer is returned for each
425
+ // At most five answers are returned for each
391
426
  // [SearchResult][google.cloud.discoveryengine.v1beta.SearchResponse.SearchResult].
392
427
  int32 max_extractive_answer_count = 1;
393
428
 
@@ -412,6 +447,9 @@ message SearchRequest {
412
447
 
413
448
  // Specifies whether to return the confidence score from the extractive
414
449
  // segments in each search result. The default value is `false`.
450
+ //
451
+ // Note: this is a priavte preview feature and only works for allowlisted
452
+ // users, please reach out to Cloud Support team if you want to use it.
415
453
  bool return_extractive_segment_score = 3;
416
454
 
417
455
  // Specifies whether to also include the adjacent from each selected
@@ -455,6 +493,8 @@ message SearchRequest {
455
493
  }
456
494
 
457
495
  // Required. The resource name of the Search serving config, such as
496
+ // `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
497
+ // or
458
498
  // `projects/*/locations/global/collections/default_collection/dataStores/default_data_store/servingConfigs/default_serving_config`.
459
499
  // This field is used to identify the serving configuration name, set
460
500
  // of models used to make the search.
@@ -512,12 +552,37 @@ message SearchRequest {
512
552
  // expression is case-sensitive.
513
553
  //
514
554
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
555
+ //
556
+ // Filtering in Vertex AI Search is done by mapping the LHS filter key to a
557
+ // key property defined in the Vertex AI Search backend -- this mapping is
558
+ // defined by the customer in their schema. For example a media customer might
559
+ // have a field 'name' in their schema. In this case the filter would look
560
+ // like this: filter --> name:'ANY("king kong")'
561
+ //
562
+ // For more information about filtering including syntax and filter
563
+ // operators, see
564
+ // [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
515
565
  string filter = 7;
516
566
 
567
+ // The default filter that is applied when a user performs a search without
568
+ // checking any filters on the search page.
569
+ //
570
+ // The filter applied to every search request when quality improvement such as
571
+ // query expansion is needed. In the case a query does not have a sufficient
572
+ // amount of results this filter will be used to determine whether or not to
573
+ // enable the query expansion flow. The original filter will still be used for
574
+ // the query expanded search.
575
+ // This field is strongly recommended to achieve high search quality.
576
+ //
577
+ // For more information about filter syntax, see
578
+ // [SearchRequest.filter][google.cloud.discoveryengine.v1beta.SearchRequest.filter].
579
+ string canonical_filter = 29;
580
+
517
581
  // The order in which documents are returned. Documents can be ordered by
518
582
  // a field in an [Document][google.cloud.discoveryengine.v1beta.Document]
519
583
  // object. Leave it unset if ordered by relevance. `order_by` expression is
520
- // case-sensitive.
584
+ // case-sensitive. For more information on ordering, see
585
+ // [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
521
586
  //
522
587
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
523
588
  string order_by = 8;
@@ -535,6 +600,8 @@ message SearchRequest {
535
600
  repeated FacetSpec facet_specs = 9;
536
601
 
537
602
  // Boost specification to boost certain documents.
603
+ // For more information on boosting, see
604
+ // [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
538
605
  BoostSpec boost_spec = 10;
539
606
 
540
607
  // Additional search parameters.
@@ -543,9 +610,17 @@ message SearchRequest {
543
610
  //
544
611
  // * `user_country_code`: string. Default empty. If set to non-empty, results
545
612
  // are restricted or boosted based on the location provided.
613
+ // Example:
614
+ // user_country_code: "au"
615
+ //
616
+ // For available codes see [Country
617
+ // Codes](https://developers.google.com/custom-search/docs/json_api_reference#countryCodes)
618
+ //
546
619
  // * `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.
620
+ // depending on the value. The only valid non-default value is 1,
621
+ // which enables image searching.
622
+ // Example:
623
+ // search_type: 1
549
624
  map<string, google.protobuf.Value> params = 11;
550
625
 
551
626
  // The query expansion specification that specifies the conditions under which
@@ -577,16 +652,18 @@ message SearchRequest {
577
652
 
578
653
  // Uses the provided embedding to do additional semantic document retrieval.
579
654
  // 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][].
655
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.vector][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.vector]
656
+ // and the document embedding that is provided in
657
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.field_path][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path].
583
658
  //
584
- // If [SearchRequest.embedding_spec.embedding_vectors.field_path][] is not
585
- // provided, it will use [ServingConfig.embedding_config.field_paths][].
659
+ // If
660
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.field_path][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.field_path]
661
+ // is not provided, it will use [ServingConfig.EmbeddingConfig.field_path][].
586
662
  EmbeddingSpec embedding_spec = 23;
587
663
 
588
664
  // The ranking expression controls the customized ranking on retrieval
589
- // documents. This overrides [ServingConfig.ranking_expression][].
665
+ // documents. This overrides
666
+ // [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1beta.ServingConfig.ranking_expression].
590
667
  // The ranking expression is a single function or multiple functions that are
591
668
  // joint by "+".
592
669
  // * ranking_expression = function, { " + ", function };
@@ -710,6 +787,65 @@ message SearchResponse {
710
787
  repeated float scores = 2;
711
788
  }
712
789
 
790
+ // Citation metadata.
791
+ message CitationMetadata {
792
+ // Citations for segments.
793
+ repeated Citation citations = 1;
794
+ }
795
+
796
+ // Citation info for a segment.
797
+ message Citation {
798
+ // Index indicates the start of the segment, measured in bytes/unicode.
799
+ int64 start_index = 1;
800
+
801
+ // End of the attributed segment, exclusive.
802
+ int64 end_index = 2;
803
+
804
+ // Citation sources for the attributed segment.
805
+ repeated CitationSource sources = 3;
806
+ }
807
+
808
+ // Citation source.
809
+ message CitationSource {
810
+ // Document reference index from SummaryWithMetadata.references.
811
+ // It is 0-indexed and the value will be zero if the reference_index is
812
+ // not set explicitly.
813
+ int64 reference_index = 4;
814
+ }
815
+
816
+ // Document reference.
817
+ message Reference {
818
+ // Title of the document.
819
+ string title = 1;
820
+
821
+ // Required.
822
+ // [Document.name][google.cloud.discoveryengine.v1beta.Document.name] of
823
+ // the document. Full resource name of the referenced document, in the
824
+ // format
825
+ // `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
826
+ string document = 2 [
827
+ (google.api.field_behavior) = REQUIRED,
828
+ (google.api.resource_reference) = {
829
+ type: "discoveryengine.googleapis.com/Document"
830
+ }
831
+ ];
832
+
833
+ // Cloud Storage or HTTP uri for the document.
834
+ string uri = 3;
835
+ }
836
+
837
+ // Summary with metadata information.
838
+ message SummaryWithMetadata {
839
+ // Summary text with no citation information.
840
+ string summary = 1;
841
+
842
+ // Citation metadata for given summary.
843
+ CitationMetadata citation_metadata = 2;
844
+
845
+ // Document References.
846
+ repeated Reference references = 3;
847
+ }
848
+
713
849
  // An Enum for summary-skipped reasons.
714
850
  enum SummarySkippedReason {
715
851
  // Default value. The summary skipped reason is not specified.
@@ -758,6 +894,9 @@ message SearchResponse {
758
894
  // A collection of Safety Attribute categories and their associated
759
895
  // confidence scores.
760
896
  SafetyAttributes safety_attributes = 3;
897
+
898
+ // Summary with metadata information.
899
+ SummaryWithMetadata summary_with_metadata = 4;
761
900
  }
762
901
 
763
902
  // Information describing query expansion including whether expansion has
@@ -0,0 +1,264 @@
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/field_behavior.proto";
20
+ import "google/api/resource.proto";
21
+ import "google/cloud/discoveryengine/v1beta/common.proto";
22
+ import "google/cloud/discoveryengine/v1beta/search_service.proto";
23
+ import "google/protobuf/timestamp.proto";
24
+
25
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
26
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
27
+ option java_multiple_files = true;
28
+ option java_outer_classname = "ServingConfigProto";
29
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
30
+ option objc_class_prefix = "DISCOVERYENGINE";
31
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
32
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
33
+
34
+ // Configures metadata that is used to generate serving time results (e.g.
35
+ // search results or recommendation predictions).
36
+ // The ServingConfig is passed in the search and predict request and generates
37
+ // results.
38
+ message ServingConfig {
39
+ option (google.api.resource) = {
40
+ type: "discoveryengine.googleapis.com/ServingConfig"
41
+ pattern: "projects/{project}/locations/{location}/dataStores/{data_store}/servingConfigs/{serving_config}"
42
+ pattern: "projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config}"
43
+ pattern: "projects/{project}/locations/{location}/collections/{collection}/engines/{engine}/servingConfigs/{serving_config}"
44
+ };
45
+
46
+ // Specifies the configurations needed for Media Discovery. Currently we
47
+ // support:
48
+ //
49
+ // * `demote_content_watched`: Threshold for watched content demotion.
50
+ // Customers can specify if using watched content demotion or use viewed
51
+ // detail page. Using the content watched demotion, customers need to specify
52
+ // the watched minutes or percentage exceeds the threshold, the content will
53
+ // be demoted in the recommendation result.
54
+ // * `promote_fresh_content`: cutoff days for fresh content promotion.
55
+ // Customers can specify if using content freshness promotion. If the content
56
+ // was published within the cutoff days, the content will be promoted in the
57
+ // recommendation result.
58
+ // Can only be set if
59
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
60
+ // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
61
+ message MediaConfig {
62
+ // Specify the threshold for demoting watched content, the threshold can be
63
+ // either percentage or minutes value.
64
+ // This must be set for `media-complete` event type.
65
+ oneof demote_content_watched {
66
+ // Specifies the content watched percentage threshold for demotion.
67
+ // Threshold value must be between [0, 1.0] inclusive.
68
+ float content_watched_percentage_threshold = 2;
69
+
70
+ // Specifies the content watched minutes threshold for demotion.
71
+ float content_watched_seconds_threshold = 5;
72
+ }
73
+
74
+ // Specifies the event type used for demoting recommendation result.
75
+ // Currently supported values:
76
+ //
77
+ // * `view-item`: Item viewed.
78
+ // * `media-play`: Start/resume watching a video, playing a song, etc.
79
+ // * `media-complete`: Finished or stopped midway through a video, song,
80
+ // etc.
81
+ //
82
+ // If unset, watch history demotion will not be applied. Content freshness
83
+ // demotion will still be applied.
84
+ string demotion_event_type = 1;
85
+
86
+ // Specifies the content freshness used for recommendation result.
87
+ // Contents will be demoted if contents were published for more than content
88
+ // freshness cutoff days.
89
+ int32 content_freshness_cutoff_days = 4;
90
+ }
91
+
92
+ // Specifies the configurations needed for Generic Discovery.Currently we
93
+ // support:
94
+ //
95
+ // * `content_search_spec`: configuration for generic content search.
96
+ message GenericConfig {
97
+ // Specifies the expected behavior of content search.
98
+ // Only valid for content-search enabled data store.
99
+ SearchRequest.ContentSearchSpec content_search_spec = 1;
100
+ }
101
+
102
+ // Industry vertical specific config.
103
+ oneof vertical_config {
104
+ // The MediaConfig of the serving configuration.
105
+ MediaConfig media_config = 7;
106
+
107
+ // The GenericConfig of the serving configuration.
108
+ GenericConfig generic_config = 10;
109
+ }
110
+
111
+ // Immutable. Fully qualified name
112
+ // `projects/{project}/locations/{location}/collections/{collection_id}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
113
+ string name = 1 [(google.api.field_behavior) = IMMUTABLE];
114
+
115
+ // Required. The human readable serving config display name. Used in Discovery
116
+ // UI.
117
+ //
118
+ // This field must be a UTF-8 encoded string with a length limit of 128
119
+ // characters. Otherwise, an INVALID_ARGUMENT error is returned.
120
+ string display_name = 2 [(google.api.field_behavior) = REQUIRED];
121
+
122
+ // Required. Immutable. Specifies the solution type that a serving config can
123
+ // be associated with.
124
+ SolutionType solution_type = 3 [
125
+ (google.api.field_behavior) = REQUIRED,
126
+ (google.api.field_behavior) = IMMUTABLE
127
+ ];
128
+
129
+ // The id of the model to use at serving time.
130
+ // Currently only RecommendationModels are supported.
131
+ // Can be changed but only to a compatible model (e.g.
132
+ // others-you-may-like CTR to others-you-may-like CVR).
133
+ //
134
+ // Required when
135
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
136
+ // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
137
+ string model_id = 4;
138
+
139
+ // How much diversity to use in recommendation model results e.g.
140
+ // `medium-diversity` or `high-diversity`. Currently supported values:
141
+ //
142
+ // * `no-diversity`
143
+ // * `low-diversity`
144
+ // * `medium-diversity`
145
+ // * `high-diversity`
146
+ // * `auto-diversity`
147
+ //
148
+ // If not specified, we choose default based on recommendation model
149
+ // type. Default value: `no-diversity`.
150
+ //
151
+ // Can only be set if
152
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
153
+ // [SOLUTION_TYPE_RECOMMENDATION][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_RECOMMENDATION].
154
+ string diversity_level = 5;
155
+
156
+ // Bring your own embedding config. The config is used for search semantic
157
+ // retrieval. The retrieval is based on the dot product of
158
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.vector][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.vector]
159
+ // and the document embeddings that are provided by this EmbeddingConfig. If
160
+ // [SearchRequest.EmbeddingSpec.EmbeddingVector.vector][google.cloud.discoveryengine.v1beta.SearchRequest.EmbeddingSpec.EmbeddingVector.vector]
161
+ // is provided, it overrides this
162
+ // [ServingConfig.embedding_config][google.cloud.discoveryengine.v1beta.ServingConfig.embedding_config].
163
+ EmbeddingConfig embedding_config = 20;
164
+
165
+ // The ranking expression controls the customized ranking on retrieval
166
+ // documents. To leverage this, document embedding is required. The ranking
167
+ // expression setting in ServingConfig applies to all search requests served
168
+ // by the serving config. However, if [SearchRequest.ranking_expression][] is
169
+ // specified, it overrides the ServingConfig ranking expression.
170
+ //
171
+ // The ranking expression is a single function or multiple functions that are
172
+ // joined by "+".
173
+ // * ranking_expression = function, { " + ", function };
174
+ // Supported functions:
175
+ // * double * relevance_score
176
+ // * double * dotProduct(embedding_field_path)
177
+ // Function variables:
178
+ // relevance_score: pre-defined keywords, used for measure relevance between
179
+ // query and document.
180
+ // embedding_field_path: the document embedding field
181
+ // used with query embedding vector.
182
+ // dotProduct: embedding function between embedding_field_path and query
183
+ // embedding vector.
184
+ //
185
+ // Example ranking expression:
186
+ // If document has an embedding field doc_embedding, the ranking expression
187
+ // could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).
188
+ string ranking_expression = 21;
189
+
190
+ // Output only. ServingConfig created timestamp.
191
+ google.protobuf.Timestamp create_time = 8
192
+ [(google.api.field_behavior) = OUTPUT_ONLY];
193
+
194
+ // Output only. ServingConfig updated timestamp.
195
+ google.protobuf.Timestamp update_time = 9
196
+ [(google.api.field_behavior) = OUTPUT_ONLY];
197
+
198
+ // Filter controls to use in serving path.
199
+ // All triggered filter controls will be applied.
200
+ // Filter controls must be in the same data store as the serving config.
201
+ // Maximum of 20 filter controls.
202
+ repeated string filter_control_ids = 11;
203
+
204
+ // Boost controls to use in serving path.
205
+ // All triggered boost controls will be applied.
206
+ // Boost controls must be in the same data store as the serving config.
207
+ // Maximum of 20 boost controls.
208
+ repeated string boost_control_ids = 12;
209
+
210
+ // IDs of the redirect controls. Only the first triggered redirect
211
+ // action is applied, even if multiple apply. Maximum number of
212
+ // specifications is 100.
213
+ //
214
+ // Can only be set if
215
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
216
+ // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH].
217
+ repeated string redirect_control_ids = 14;
218
+
219
+ // Condition synonyms specifications. If multiple synonyms conditions
220
+ // match, all matching synonyms controls in the list will execute.
221
+ // Maximum number of specifications is 100.
222
+ //
223
+ // Can only be set if
224
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
225
+ // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH].
226
+ repeated string synonyms_control_ids = 15;
227
+
228
+ // Condition oneway synonyms specifications. If multiple oneway synonyms
229
+ // conditions match, all matching oneway synonyms controls in the list
230
+ // will execute. Maximum number of specifications is 100.
231
+ //
232
+ // Can only be set if
233
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
234
+ // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH].
235
+ repeated string oneway_synonyms_control_ids = 16;
236
+
237
+ // Condition do not associate specifications. If multiple do not
238
+ // associate conditions match, all matching do not associate controls in
239
+ // the list will execute.
240
+ // Order does not matter.
241
+ // Maximum number of specifications is 100.
242
+ //
243
+ // Can only be set if
244
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
245
+ // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH].
246
+ repeated string dissociate_control_ids = 17;
247
+
248
+ // Condition replacement specifications.
249
+ // Applied according to the order in the list.
250
+ // A previously replaced term can not be re-replaced.
251
+ // Maximum number of specifications is 100.
252
+ //
253
+ // Can only be set if
254
+ // [SolutionType][google.cloud.discoveryengine.v1beta.SolutionType] is
255
+ // [SOLUTION_TYPE_SEARCH][google.cloud.discoveryengine.v1beta.SolutionType.SOLUTION_TYPE_SEARCH].
256
+ repeated string replacement_control_ids = 18;
257
+
258
+ // Condition ignore specifications. If multiple ignore
259
+ // conditions match, all matching ignore controls in the list will
260
+ // execute.
261
+ // Order does not matter.
262
+ // Maximum number of specifications is 100.
263
+ repeated string ignore_control_ids = 19;
264
+ }
@@ -0,0 +1,147 @@
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/serving_config.proto";
24
+ import "google/protobuf/field_mask.proto";
25
+
26
+ option csharp_namespace = "Google.Cloud.DiscoveryEngine.V1Beta";
27
+ option go_package = "cloud.google.com/go/discoveryengine/apiv1beta/discoveryenginepb;discoveryenginepb";
28
+ option java_multiple_files = true;
29
+ option java_outer_classname = "ServingConfigServiceProto";
30
+ option java_package = "com.google.cloud.discoveryengine.v1beta";
31
+ option objc_class_prefix = "DISCOVERYENGINE";
32
+ option php_namespace = "Google\\Cloud\\DiscoveryEngine\\V1beta";
33
+ option ruby_package = "Google::Cloud::DiscoveryEngine::V1beta";
34
+
35
+ // Service for modifying ServingConfig.
36
+ service ServingConfigService {
37
+ option (google.api.default_host) = "discoveryengine.googleapis.com";
38
+ option (google.api.oauth_scopes) =
39
+ "https://www.googleapis.com/auth/cloud-platform";
40
+
41
+ // Updates a ServingConfig.
42
+ //
43
+ // Returns a NOT_FOUND error if the ServingConfig does not exist.
44
+ rpc UpdateServingConfig(UpdateServingConfigRequest) returns (ServingConfig) {
45
+ option (google.api.http) = {
46
+ patch: "/v1beta/{serving_config.name=projects/*/locations/*/dataStores/*/servingConfigs/*}"
47
+ body: "serving_config"
48
+ additional_bindings {
49
+ patch: "/v1beta/{serving_config.name=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}"
50
+ body: "serving_config"
51
+ }
52
+ additional_bindings {
53
+ patch: "/v1beta/{serving_config.name=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}"
54
+ body: "serving_config"
55
+ }
56
+ };
57
+ option (google.api.method_signature) = "serving_config,update_mask";
58
+ }
59
+
60
+ // Gets a ServingConfig.
61
+ //
62
+ // Returns a NotFound error if the ServingConfig does not exist.
63
+ rpc GetServingConfig(GetServingConfigRequest) returns (ServingConfig) {
64
+ option (google.api.http) = {
65
+ get: "/v1beta/{name=projects/*/locations/*/dataStores/*/servingConfigs/*}"
66
+ additional_bindings {
67
+ get: "/v1beta/{name=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}"
68
+ }
69
+ additional_bindings {
70
+ get: "/v1beta/{name=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}"
71
+ }
72
+ };
73
+ option (google.api.method_signature) = "name";
74
+ }
75
+
76
+ // Lists all ServingConfigs linked to this dataStore.
77
+ rpc ListServingConfigs(ListServingConfigsRequest)
78
+ returns (ListServingConfigsResponse) {
79
+ option (google.api.http) = {
80
+ get: "/v1beta/{parent=projects/*/locations/*/dataStores/*}/servingConfigs"
81
+ additional_bindings {
82
+ get: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/servingConfigs"
83
+ }
84
+ additional_bindings {
85
+ get: "/v1beta/{parent=projects/*/locations/*/collections/*/engines/*}/servingConfigs"
86
+ }
87
+ };
88
+ option (google.api.method_signature) = "parent";
89
+ }
90
+ }
91
+
92
+ // Request for UpdateServingConfig method.
93
+ message UpdateServingConfigRequest {
94
+ // Required. The ServingConfig to update.
95
+ ServingConfig serving_config = 1 [(google.api.field_behavior) = REQUIRED];
96
+
97
+ // Indicates which fields in the provided
98
+ // [ServingConfig][google.cloud.discoveryengine.v1beta.ServingConfig] to
99
+ // update. The following are NOT supported:
100
+ //
101
+ // * [ServingConfig.name][google.cloud.discoveryengine.v1beta.ServingConfig.name]
102
+ //
103
+ // If not set, all supported fields are updated.
104
+ google.protobuf.FieldMask update_mask = 2;
105
+ }
106
+
107
+ // Request for GetServingConfig method.
108
+ message GetServingConfigRequest {
109
+ // Required. The resource name of the ServingConfig to get. Format:
110
+ // `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}/servingConfigs/{serving_config_id}`
111
+ string name = 1 [
112
+ (google.api.field_behavior) = REQUIRED,
113
+ (google.api.resource_reference) = {
114
+ type: "discoveryengine.googleapis.com/ServingConfig"
115
+ }
116
+ ];
117
+ }
118
+
119
+ // Request for ListServingConfigs method.
120
+ message ListServingConfigsRequest {
121
+ // Required. The dataStore resource name. Format:
122
+ // `projects/{project_number}/locations/{location}/collections/{collection}/dataStores/{data_store}`
123
+ string parent = 1 [
124
+ (google.api.field_behavior) = REQUIRED,
125
+ (google.api.resource_reference) = {
126
+ type: "discoveryengine.googleapis.com/DataStore"
127
+ }
128
+ ];
129
+
130
+ // Optional. Maximum number of results to return. If unspecified, defaults
131
+ // to 100. If a value greater than 100 is provided, at most 100 results are
132
+ // returned.
133
+ int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL];
134
+
135
+ // Optional. A page token, received from a previous `ListServingConfigs` call.
136
+ // Provide this to retrieve the subsequent page.
137
+ string page_token = 3 [(google.api.field_behavior) = OPTIONAL];
138
+ }
139
+
140
+ // Response for ListServingConfigs method.
141
+ message ListServingConfigsResponse {
142
+ // All the ServingConfigs for a given dataStore.
143
+ repeated ServingConfig serving_configs = 1;
144
+
145
+ // Pagination token, if not returned indicates the last page.
146
+ string next_page_token = 2;
147
+ }