@google-cloud/discoveryengine 1.9.0 → 1.10.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 (66) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +2 -0
  3. package/build/protos/google/cloud/discoveryengine/v1/answer.proto +13 -0
  4. package/build/protos/google/cloud/discoveryengine/v1/chunk.proto +119 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/common.proto +0 -5
  6. package/build/protos/google/cloud/discoveryengine/v1/completion.proto +31 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/completion_service.proto +38 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +35 -0
  9. package/build/protos/google/cloud/discoveryengine/v1/document.proto +1 -1
  10. package/build/protos/google/cloud/discoveryengine/v1/document_processing_config.proto +37 -2
  11. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +108 -0
  12. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +38 -0
  13. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +200 -4
  14. package/build/protos/google/cloud/discoveryengine/v1/user_event_service.proto +3 -0
  15. package/build/protos/protos.d.ts +3851 -1527
  16. package/build/protos/protos.js +14056 -8213
  17. package/build/protos/protos.json +548 -8
  18. package/build/src/v1/completion_service_client.d.ts +220 -0
  19. package/build/src/v1/completion_service_client.js +260 -0
  20. package/build/src/v1/completion_service_client_config.json +10 -0
  21. package/build/src/v1/control_service_client.d.ts +129 -1
  22. package/build/src/v1/control_service_client.js +176 -0
  23. package/build/src/v1/conversational_search_service_client.d.ts +147 -1
  24. package/build/src/v1/conversational_search_service_client.js +176 -0
  25. package/build/src/v1/data_store_service_client.d.ts +129 -1
  26. package/build/src/v1/data_store_service_client.js +176 -0
  27. package/build/src/v1/document_service_client.d.ts +131 -1
  28. package/build/src/v1/document_service_client.js +176 -0
  29. package/build/src/v1/engine_service_client.d.ts +129 -1
  30. package/build/src/v1/engine_service_client.js +176 -0
  31. package/build/src/v1/grounded_generation_service_client.d.ts +129 -0
  32. package/build/src/v1/grounded_generation_service_client.js +176 -0
  33. package/build/src/v1/project_service_client.d.ts +129 -0
  34. package/build/src/v1/project_service_client.js +176 -0
  35. package/build/src/v1/rank_service_client.d.ts +129 -0
  36. package/build/src/v1/rank_service_client.js +176 -0
  37. package/build/src/v1/recommendation_service_client.d.ts +129 -0
  38. package/build/src/v1/recommendation_service_client.js +176 -0
  39. package/build/src/v1/schema_service_client.d.ts +129 -1
  40. package/build/src/v1/schema_service_client.js +176 -0
  41. package/build/src/v1/search_service_client.d.ts +252 -1
  42. package/build/src/v1/search_service_client.js +258 -0
  43. package/build/src/v1/site_search_engine_service_client.d.ts +129 -1
  44. package/build/src/v1/site_search_engine_service_client.js +176 -0
  45. package/build/src/v1/user_event_service_client.d.ts +129 -0
  46. package/build/src/v1/user_event_service_client.js +176 -0
  47. package/build/src/v1alpha/chunk_service_client.d.ts +0 -1
  48. package/build/src/v1alpha/control_service_client.d.ts +0 -1
  49. package/build/src/v1alpha/conversational_search_service_client.d.ts +0 -1
  50. package/build/src/v1alpha/data_store_service_client.d.ts +0 -1
  51. package/build/src/v1alpha/document_service_client.d.ts +0 -1
  52. package/build/src/v1alpha/engine_service_client.d.ts +0 -1
  53. package/build/src/v1alpha/schema_service_client.d.ts +0 -1
  54. package/build/src/v1alpha/search_service_client.d.ts +0 -1
  55. package/build/src/v1alpha/serving_config_service_client.d.ts +0 -1
  56. package/build/src/v1alpha/site_search_engine_service_client.d.ts +0 -1
  57. package/build/src/v1beta/control_service_client.d.ts +0 -1
  58. package/build/src/v1beta/conversational_search_service_client.d.ts +0 -1
  59. package/build/src/v1beta/data_store_service_client.d.ts +0 -1
  60. package/build/src/v1beta/document_service_client.d.ts +0 -1
  61. package/build/src/v1beta/engine_service_client.d.ts +0 -1
  62. package/build/src/v1beta/schema_service_client.d.ts +0 -1
  63. package/build/src/v1beta/search_service_client.d.ts +0 -1
  64. package/build/src/v1beta/serving_config_service_client.d.ts +0 -1
  65. package/build/src/v1beta/site_search_engine_service_client.d.ts +0 -1
  66. package/package.json +1 -1
@@ -20,6 +20,7 @@ import "google/api/annotations.proto";
20
20
  import "google/api/client.proto";
21
21
  import "google/api/field_behavior.proto";
22
22
  import "google/api/resource.proto";
23
+ import "google/cloud/discoveryengine/v1/chunk.proto";
23
24
  import "google/cloud/discoveryengine/v1/common.proto";
24
25
  import "google/cloud/discoveryengine/v1/document.proto";
25
26
  import "google/protobuf/struct.proto";
@@ -70,8 +71,8 @@ message SearchRequest {
70
71
  }
71
72
 
72
73
  // A struct to define data stores to filter on in a search call and
73
- // configurations for those data stores. A maximum of 1 DataStoreSpec per
74
- // data_store is allowed. Otherwise, an `INVALID_ARGUMENT` error is returned.
74
+ // configurations for those data stores. Otherwise, an `INVALID_ARGUMENT`
75
+ // error is returned.
75
76
  message DataStoreSpec {
76
77
  // Required. Full resource name of
77
78
  // [DataStore][google.cloud.discoveryengine.v1.DataStore], such as
@@ -150,6 +151,9 @@ message SearchRequest {
150
151
  // Maximum facet values that are returned for this facet. If
151
152
  // unspecified, defaults to 20. The maximum allowed value is 300. Values
152
153
  // above 300 are coerced to 300.
154
+ // For aggregation in healthcare search, when the [FacetKey.key] is
155
+ // "healthcare_aggregation_key", the limit will be overridden to
156
+ // 10,000 internally, regardless of the value set here.
153
157
  //
154
158
  // If this field is negative, an `INVALID_ARGUMENT` is returned.
155
159
  int32 limit = 2;
@@ -367,8 +371,9 @@ message SearchRequest {
367
371
  //
368
372
  // At most 10 results for documents mode, or 50 for chunks mode, can be
369
373
  // used to generate a summary. The chunks mode is used when
370
- // [SearchRequest.ContentSearchSpec.search_result_mode][] is set to
371
- // [CHUNKS][SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
374
+ // [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.search_result_mode]
375
+ // is set to
376
+ // [CHUNKS][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
372
377
  int32 summary_result_count = 1;
373
378
 
374
379
  // Specifies whether to include citations in the summary. The default
@@ -491,6 +496,41 @@ message SearchRequest {
491
496
  int32 num_next_segments = 5;
492
497
  }
493
498
 
499
+ // Specifies the chunk spec to be returned from the search response.
500
+ // Only available if the
501
+ // [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.search_result_mode]
502
+ // is set to
503
+ // [CHUNKS][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]
504
+ message ChunkSpec {
505
+ // The number of previous chunks to be returned of the current chunk. The
506
+ // maximum allowed value is 3.
507
+ // If not specified, no previous chunks will be returned.
508
+ int32 num_previous_chunks = 1;
509
+
510
+ // The number of next chunks to be returned of the current chunk. The
511
+ // maximum allowed value is 3.
512
+ // If not specified, no next chunks will be returned.
513
+ int32 num_next_chunks = 2;
514
+ }
515
+
516
+ // Specifies the search result mode. If unspecified, the
517
+ // search result mode is based on
518
+ // [DataStore.DocumentProcessingConfig.chunking_config][]:
519
+ // * If [DataStore.DocumentProcessingConfig.chunking_config][] is specified,
520
+ // it defaults to `CHUNKS`.
521
+ // * Otherwise, it defaults to `DOCUMENTS`.
522
+ enum SearchResultMode {
523
+ // Default value.
524
+ SEARCH_RESULT_MODE_UNSPECIFIED = 0;
525
+
526
+ // Returns documents in the search result.
527
+ DOCUMENTS = 1;
528
+
529
+ // Returns chunks in the search result. Only available if the
530
+ // [DataStore.DocumentProcessingConfig.chunking_config][] is specified.
531
+ CHUNKS = 2;
532
+ }
533
+
494
534
  // If `snippetSpec` is not specified, snippets are not included in the
495
535
  // search response.
496
536
  SnippetSpec snippet_spec = 1;
@@ -502,6 +542,85 @@ message SearchRequest {
502
542
  // If there is no extractive_content_spec provided, there will be no
503
543
  // extractive answer in the search response.
504
544
  ExtractiveContentSpec extractive_content_spec = 3;
545
+
546
+ // Specifies the search result mode. If unspecified, the
547
+ // search result mode is based on
548
+ // [DataStore.DocumentProcessingConfig.chunking_config][]:
549
+ // * If [DataStore.DocumentProcessingConfig.chunking_config][] is specified,
550
+ // it defaults to `CHUNKS`.
551
+ // * Otherwise, it defaults to `DOCUMENTS`.
552
+ SearchResultMode search_result_mode = 4;
553
+
554
+ // Specifies the chunk spec to be returned from the search response.
555
+ // Only available if the
556
+ // [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.search_result_mode]
557
+ // is set to
558
+ // [CHUNKS][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS]
559
+ ChunkSpec chunk_spec = 5;
560
+ }
561
+
562
+ // Specification for search as you type in search requests.
563
+ message SearchAsYouTypeSpec {
564
+ // Enum describing under which condition search as you type should occur.
565
+ enum Condition {
566
+ // Server behavior defaults to
567
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition.DISABLED].
568
+ CONDITION_UNSPECIFIED = 0;
569
+
570
+ // Disables Search As You Type.
571
+ DISABLED = 1;
572
+
573
+ // Enables Search As You Type.
574
+ ENABLED = 2;
575
+ }
576
+
577
+ // The condition under which search as you type should occur.
578
+ // Default to
579
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1.SearchRequest.SearchAsYouTypeSpec.Condition.DISABLED].
580
+ Condition condition = 1;
581
+ }
582
+
583
+ // Session specification.
584
+ //
585
+ // Multi-turn Search feature is currently at private GA stage. Please use
586
+ // v1alpha or v1beta version instead before we launch this feature to public
587
+ // GA. Or ask for allowlisting through Google Support team.
588
+ message SessionSpec {
589
+ // If set, the search result gets stored to the "turn" specified by this
590
+ // query ID.
591
+ //
592
+ // Example: Let's say the session looks like this:
593
+ // session {
594
+ // name: ".../sessions/xxx"
595
+ // turns {
596
+ // query { text: "What is foo?" query_id: ".../questions/yyy" }
597
+ // answer: "Foo is ..."
598
+ // }
599
+ // turns {
600
+ // query { text: "How about bar then?" query_id: ".../questions/zzz" }
601
+ // }
602
+ // }
603
+ //
604
+ // The user can call /search API with a request like this:
605
+ //
606
+ // session: ".../sessions/xxx"
607
+ // session_spec { query_id: ".../questions/zzz" }
608
+ //
609
+ // Then, the API stores the search result, associated with the last turn.
610
+ // The stored search result can be used by a subsequent /answer API call
611
+ // (with the session ID and the query ID specified). Also, it is possible
612
+ // to call /search and /answer in parallel with the same session ID & query
613
+ // ID.
614
+ string query_id = 1;
615
+
616
+ // The number of top search results to persist. The persisted search results
617
+ // can be used for the subsequent /answer api call.
618
+ //
619
+ // This field is simliar to the `summary_result_count` field in
620
+ // [SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count].
621
+ //
622
+ // At most 10 results for documents mode, or 50 for chunks mode.
623
+ optional int32 search_result_persistence_count = 2;
505
624
  }
506
625
 
507
626
  // Required. The resource name of the Search serving config, such as
@@ -617,6 +736,13 @@ message SearchRequest {
617
736
  // is used to deduce `device_type` for analytics.
618
737
  UserInfo user_info = 21;
619
738
 
739
+ // The BCP-47 language code, such as "en-US" or "sr-Latn". For more
740
+ // information, see [Standard
741
+ // fields](https://cloud.google.com/apis/design/standard_fields). This field
742
+ // helps to better interpret the query. If a value isn't specified, the query
743
+ // language code is automatically detected, which may not be accurate.
744
+ string language_code = 35;
745
+
620
746
  // Facet specifications for faceted search. If empty, no facets are returned.
621
747
  //
622
748
  // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
@@ -694,6 +820,46 @@ message SearchRequest {
694
820
  // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
695
821
  // for more details.
696
822
  map<string, string> user_labels = 22;
823
+
824
+ // Search as you type configuration. Only supported for the
825
+ // [IndustryVertical.MEDIA][google.cloud.discoveryengine.v1.IndustryVertical.MEDIA]
826
+ // vertical.
827
+ SearchAsYouTypeSpec search_as_you_type_spec = 31;
828
+
829
+ // The session resource name. Optional.
830
+ //
831
+ // Session allows users to do multi-turn /search API calls or coordination
832
+ // between /search API calls and /answer API calls.
833
+ //
834
+ // Example #1 (multi-turn /search API calls):
835
+ // 1. Call /search API with the auto-session mode (see below).
836
+ // 2. Call /search API with the session ID generated in the first call.
837
+ // Here, the previous search query gets considered in query
838
+ // standing. I.e., if the first query is "How did Alphabet do in 2022?"
839
+ // and the current query is "How about 2023?", the current query will
840
+ // be interpreted as "How did Alphabet do in 2023?".
841
+ //
842
+ // Example #2 (coordination between /search API calls and /answer API calls):
843
+ // 1. Call /search API with the auto-session mode (see below).
844
+ // 2. Call /answer API with the session ID generated in the first call.
845
+ // Here, the answer generation happens in the context of the search
846
+ // results from the first search call.
847
+ //
848
+ // Auto-session mode: when `projects/.../sessions/-` is used, a new session
849
+ // gets automatically created. Otherwise, users can use the create-session API
850
+ // to create a session manually.
851
+ //
852
+ // Multi-turn Search feature is currently at private GA stage. Please use
853
+ // v1alpha or v1beta version instead before we launch this feature to public
854
+ // GA. Or ask for allowlisting through Google Support team.
855
+ string session = 41 [(google.api.resource_reference) = {
856
+ type: "discoveryengine.googleapis.com/Session"
857
+ }];
858
+
859
+ // Session specification.
860
+ //
861
+ // Can be used only when `session` is set.
862
+ SessionSpec session_spec = 42;
697
863
  }
698
864
 
699
865
  // Response message for
@@ -709,6 +875,12 @@ message SearchResponse {
709
875
  // The document data snippet in the search response. Only fields that are
710
876
  // marked as `retrievable` are populated.
711
877
  Document document = 2;
878
+
879
+ // The chunk data in the search response if the
880
+ // [SearchRequest.ContentSearchSpec.search_result_mode][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.search_result_mode]
881
+ // is set to
882
+ // [CHUNKS][google.cloud.discoveryengine.v1.SearchRequest.ContentSearchSpec.SearchResultMode.CHUNKS].
883
+ Chunk chunk = 18;
712
884
  }
713
885
 
714
886
  // A facet result.
@@ -890,6 +1062,23 @@ message SearchResponse {
890
1062
  int64 pinned_result_count = 2;
891
1063
  }
892
1064
 
1065
+ // Information about the session.
1066
+ message SessionInfo {
1067
+ // Name of the session.
1068
+ // If the auto-session mode is used (when
1069
+ // [SearchRequest.session][google.cloud.discoveryengine.v1.SearchRequest.session]
1070
+ // ends with "-"), this field holds the newly generated session name.
1071
+ string name = 1;
1072
+
1073
+ // Query ID that corresponds to this search API call.
1074
+ // One session can have multiple turns, each with a unique query ID.
1075
+ //
1076
+ // By specifying the session name and this query ID in the Answer API call,
1077
+ // the answer generation happens in the context of the search results from
1078
+ // this search call.
1079
+ string query_id = 2;
1080
+ }
1081
+
893
1082
  // A list of matched documents. The order represents the ranking.
894
1083
  repeated SearchResult results = 1;
895
1084
 
@@ -936,4 +1125,11 @@ message SearchResponse {
936
1125
 
937
1126
  // Query expansion information for the returned results.
938
1127
  QueryExpansionInfo query_expansion_info = 14;
1128
+
1129
+ // Session information.
1130
+ //
1131
+ // Only set if
1132
+ // [SearchRequest.session][google.cloud.discoveryengine.v1.SearchRequest.session]
1133
+ // is provided. See its description for more details.
1134
+ SessionInfo session_info = 19;
939
1135
  }
@@ -67,6 +67,9 @@ service UserEventService {
67
67
  additional_bindings {
68
68
  get: "/v1/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collect"
69
69
  }
70
+ additional_bindings {
71
+ get: "/v1/{parent=projects/*/locations/*}/userEvents:collect"
72
+ }
70
73
  };
71
74
  }
72
75