@google-cloud/discoveryengine 1.11.0 → 1.13.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 (67) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +7 -0
  3. package/build/protos/google/cloud/discoveryengine/v1alpha/answer.proto +55 -2
  4. package/build/protos/google/cloud/discoveryengine/v1alpha/chunk.proto +1 -1
  5. package/build/protos/google/cloud/discoveryengine/v1alpha/completion.proto +31 -0
  6. package/build/protos/google/cloud/discoveryengine/v1alpha/completion_service.proto +38 -0
  7. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +28 -9
  8. package/build/protos/google/cloud/discoveryengine/v1alpha/custom_tuning_model.proto +7 -1
  9. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store.proto +23 -0
  10. package/build/protos/google/cloud/discoveryengine/v1alpha/data_store_service.proto +11 -1
  11. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +4 -1
  12. package/build/protos/google/cloud/discoveryengine/v1alpha/document_processing_config.proto +6 -2
  13. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +1 -1
  14. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +114 -0
  15. package/build/protos/google/cloud/discoveryengine/v1alpha/purge_config.proto +57 -0
  16. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +5 -0
  17. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +407 -11
  18. package/build/protos/google/cloud/discoveryengine/v1alpha/serving_config.proto +14 -5
  19. package/build/protos/google/cloud/discoveryengine/v1alpha/site_search_engine_service.proto +126 -0
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event_service.proto +3 -0
  21. package/build/protos/google/cloud/discoveryengine/v1beta/answer.proto +14 -0
  22. package/build/protos/google/cloud/discoveryengine/v1beta/completion.proto +31 -0
  23. package/build/protos/google/cloud/discoveryengine/v1beta/completion_service.proto +38 -0
  24. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +19 -0
  25. package/build/protos/google/cloud/discoveryengine/v1beta/custom_tuning_model.proto +7 -1
  26. package/build/protos/google/cloud/discoveryengine/v1beta/data_store.proto +23 -0
  27. package/build/protos/google/cloud/discoveryengine/v1beta/data_store_service.proto +10 -0
  28. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +108 -0
  29. package/build/protos/google/cloud/discoveryengine/v1beta/purge_config.proto +111 -0
  30. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +303 -0
  31. package/build/protos/google/cloud/discoveryengine/v1beta/user_event_service.proto +24 -0
  32. package/build/protos/protos.d.ts +22409 -16038
  33. package/build/protos/protos.js +38744 -22699
  34. package/build/protos/protos.json +1506 -49
  35. package/build/src/v1alpha/completion_service_client.d.ts +91 -0
  36. package/build/src/v1alpha/completion_service_client.js +90 -0
  37. package/build/src/v1alpha/completion_service_client_config.json +10 -0
  38. package/build/src/v1alpha/conversational_search_service_client.d.ts +18 -0
  39. package/build/src/v1alpha/data_store_service_client.d.ts +12 -3
  40. package/build/src/v1alpha/data_store_service_client.js +8 -2
  41. package/build/src/v1alpha/document_service_client.d.ts +4 -0
  42. package/build/src/v1alpha/document_service_client.js +6 -0
  43. package/build/src/v1alpha/engine_service_client.js +6 -0
  44. package/build/src/v1alpha/estimate_billing_service_client.js +6 -0
  45. package/build/src/v1alpha/evaluation_service_client.js +6 -0
  46. package/build/src/v1alpha/project_service_client.js +6 -0
  47. package/build/src/v1alpha/sample_query_service_client.js +6 -0
  48. package/build/src/v1alpha/schema_service_client.js +6 -0
  49. package/build/src/v1alpha/search_service_client.d.ts +219 -21
  50. package/build/src/v1alpha/search_service_client.js +146 -14
  51. package/build/src/v1alpha/search_tuning_service_client.js +6 -0
  52. package/build/src/v1alpha/site_search_engine_service_client.d.ts +101 -0
  53. package/build/src/v1alpha/site_search_engine_service_client.js +70 -0
  54. package/build/src/v1alpha/site_search_engine_service_client_config.json +8 -0
  55. package/build/src/v1alpha/user_event_service_client.js +6 -0
  56. package/build/src/v1beta/completion_service_client.d.ts +91 -0
  57. package/build/src/v1beta/completion_service_client.js +84 -0
  58. package/build/src/v1beta/completion_service_client_config.json +10 -0
  59. package/build/src/v1beta/conversational_search_service_client.d.ts +18 -0
  60. package/build/src/v1beta/data_store_service_client.d.ts +9 -0
  61. package/build/src/v1beta/document_service_client.d.ts +2 -0
  62. package/build/src/v1beta/search_service_client.d.ts +147 -0
  63. package/build/src/v1beta/search_service_client.js +98 -0
  64. package/build/src/v1beta/user_event_service_client.d.ts +75 -0
  65. package/build/src/v1beta/user_event_service_client.js +42 -0
  66. package/build/src/v1beta/user_event_service_client_config.json +5 -0
  67. package/package.json +2 -2
@@ -120,6 +120,22 @@ message PurgeErrorConfig {
120
120
  // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
121
121
  // method.
122
122
  message PurgeDocumentsRequest {
123
+ // The inline source for the input config for
124
+ // [DocumentService.PurgeDocuments][google.cloud.discoveryengine.v1alpha.DocumentService.PurgeDocuments]
125
+ // method.
126
+ message InlineSource {
127
+ // Required. A list of full resource name of documents to purge. In the
128
+ // format
129
+ // `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
130
+ // Recommended max of 100 items.
131
+ repeated string documents = 1 [
132
+ (google.api.field_behavior) = REQUIRED,
133
+ (google.api.resource_reference) = {
134
+ type: "discoveryengine.googleapis.com/Document"
135
+ }
136
+ ];
137
+ }
138
+
123
139
  // The desired input source for the purging documents based on document ids.
124
140
  oneof source {
125
141
  // Cloud Storage location for the input content.
@@ -127,6 +143,9 @@ message PurgeDocumentsRequest {
127
143
  // * `document_id`: One valid
128
144
  // [Document.id][google.cloud.discoveryengine.v1alpha.Document.id] per line.
129
145
  GcsSource gcs_source = 5;
146
+
147
+ // Inline source for the input content for purge.
148
+ InlineSource inline_source = 6;
130
149
  }
131
150
 
132
151
  // Required. The parent resource name, such as
@@ -223,3 +242,41 @@ message PurgeSuggestionDenyListEntriesMetadata {
223
242
  // finish time.
224
243
  google.protobuf.Timestamp update_time = 2;
225
244
  }
245
+
246
+ // Request message for
247
+ // [CompletionService.PurgeCompletionSuggestions][google.cloud.discoveryengine.v1alpha.CompletionService.PurgeCompletionSuggestions]
248
+ // method.
249
+ message PurgeCompletionSuggestionsRequest {
250
+ // Required. The parent data store resource name for which to purge completion
251
+ // suggestions. Follows pattern
252
+ // projects/*/locations/*/collections/*/dataStores/*.
253
+ string parent = 1 [
254
+ (google.api.field_behavior) = REQUIRED,
255
+ (google.api.resource_reference) = {
256
+ type: "discoveryengine.googleapis.com/DataStore"
257
+ }
258
+ ];
259
+ }
260
+
261
+ // Response message for
262
+ // [CompletionService.PurgeCompletionSuggestions][google.cloud.discoveryengine.v1alpha.CompletionService.PurgeCompletionSuggestions]
263
+ // method.
264
+ message PurgeCompletionSuggestionsResponse {
265
+ // Whether the completion suggestions were successfully purged.
266
+ bool purge_succeeded = 1;
267
+
268
+ // A sample of errors encountered while processing the request.
269
+ repeated google.rpc.Status error_samples = 2;
270
+ }
271
+
272
+ // Metadata related to the progress of the PurgeCompletionSuggestions
273
+ // operation. This is returned by the google.longrunning.Operation.metadata
274
+ // field.
275
+ message PurgeCompletionSuggestionsMetadata {
276
+ // Operation create time.
277
+ google.protobuf.Timestamp create_time = 1;
278
+
279
+ // Operation last update time. If the operation is done, this is also the
280
+ // finish time.
281
+ google.protobuf.Timestamp update_time = 2;
282
+ }
@@ -192,6 +192,11 @@ message FieldConfig {
192
192
  // Retrieve value from page map.
193
193
  PAGEMAP = 2;
194
194
 
195
+ // Retrieve value from the attributes set by
196
+ // [SiteSearchEngineService.SetUriPatternDocumentData][google.cloud.discoveryengine.v1alpha.SiteSearchEngineService.SetUriPatternDocumentData]
197
+ // API.
198
+ URI_PATTERN_MAPPING = 3;
199
+
195
200
  // Retrieve value from schema.org data.
196
201
  SCHEMA_ORG = 4;
197
202
  }
@@ -71,8 +71,8 @@ message SearchRequest {
71
71
  }
72
72
 
73
73
  // A struct to define data stores to filter on in a search call and
74
- // configurations for those data stores. A maximum of 1 DataStoreSpec per
75
- // 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.
76
76
  message DataStoreSpec {
77
77
  // Required. Full resource name of
78
78
  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore], such as
@@ -151,6 +151,9 @@ message SearchRequest {
151
151
  // Maximum facet values that are returned for this facet. If
152
152
  // unspecified, defaults to 20. The maximum allowed value is 300. Values
153
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.
154
157
  //
155
158
  // If this field is negative, an `INVALID_ARGUMENT` is returned.
156
159
  int32 limit = 2;
@@ -495,6 +498,14 @@ message SearchRequest {
495
498
  // fallback messages instead.
496
499
  bool ignore_non_summary_seeking_query = 4;
497
500
 
501
+ // Specifies whether to filter out queries that have low relevance. The
502
+ // default value is `false`.
503
+ //
504
+ // If this field is set to `false`, all search results are used regardless
505
+ // of relevance to generate answers. If set to `true`, only queries with
506
+ // high relevance search results will generate answers.
507
+ bool ignore_low_relevant_content = 9;
508
+
498
509
  // If specified, the spec will be used to modify the prompt provided to
499
510
  // the LLM.
500
511
  ModelPromptSpec model_prompt_spec = 5;
@@ -642,6 +653,119 @@ message SearchRequest {
642
653
  repeated EmbeddingVector embedding_vectors = 1;
643
654
  }
644
655
 
656
+ // Specification to enable natural language understanding capabilities for
657
+ // search requests.
658
+ message NaturalLanguageQueryUnderstandingSpec {
659
+ // Enum describing under which condition filter extraction should occur.
660
+ enum FilterExtractionCondition {
661
+ // Server behavior defaults to [Condition.DISABLED][].
662
+ CONDITION_UNSPECIFIED = 0;
663
+
664
+ // Disables NL filter extraction.
665
+ DISABLED = 1;
666
+
667
+ // Enables NL filter extraction.
668
+ ENABLED = 2;
669
+ }
670
+
671
+ // The condition under which filter extraction should occur.
672
+ // Default to [Condition.DISABLED][].
673
+ FilterExtractionCondition filter_extraction_condition = 1;
674
+
675
+ // Field names used for location-based filtering, where geolocation filters
676
+ // are detected in natural language search queries.
677
+ // Only valid when the FilterExtractionCondition is set to `ENABLED`.
678
+ //
679
+ // If this field is set, it overrides the field names set in
680
+ // [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1alpha.ServingConfig.geo_search_query_detection_field_names].
681
+ repeated string geo_search_query_detection_field_names = 2;
682
+ }
683
+
684
+ // Specification for search as you type in search requests.
685
+ message SearchAsYouTypeSpec {
686
+ // Enum describing under which condition search as you type should occur.
687
+ enum Condition {
688
+ // Server behavior defaults to
689
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.SearchAsYouTypeSpec.Condition.DISABLED].
690
+ CONDITION_UNSPECIFIED = 0;
691
+
692
+ // Disables Search As You Type.
693
+ DISABLED = 1;
694
+
695
+ // Enables Search As You Type.
696
+ ENABLED = 2;
697
+ }
698
+
699
+ // The condition under which search as you type should occur.
700
+ // Default to
701
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1alpha.SearchRequest.SearchAsYouTypeSpec.Condition.DISABLED].
702
+ Condition condition = 1;
703
+ }
704
+
705
+ // Session specification.
706
+ //
707
+ // Multi-turn Search feature is currently at private GA stage. Please use
708
+ // v1alpha or v1beta version instead before we launch this feature to public
709
+ // GA. Or ask for allowlisting through Google Support team.
710
+ message SessionSpec {
711
+ // If set, the search result gets stored to the "turn" specified by this
712
+ // query ID.
713
+ //
714
+ // Example: Let's say the session looks like this:
715
+ // session {
716
+ // name: ".../sessions/xxx"
717
+ // turns {
718
+ // query { text: "What is foo?" query_id: ".../questions/yyy" }
719
+ // answer: "Foo is ..."
720
+ // }
721
+ // turns {
722
+ // query { text: "How about bar then?" query_id: ".../questions/zzz" }
723
+ // }
724
+ // }
725
+ //
726
+ // The user can call /search API with a request like this:
727
+ //
728
+ // session: ".../sessions/xxx"
729
+ // session_spec { query_id: ".../questions/zzz" }
730
+ //
731
+ // Then, the API stores the search result, associated with the last turn.
732
+ // The stored search result can be used by a subsequent /answer API call
733
+ // (with the session ID and the query ID specified). Also, it is possible
734
+ // to call /search and /answer in parallel with the same session ID & query
735
+ // ID.
736
+ string query_id = 1;
737
+
738
+ // The number of top search results to persist. The persisted search results
739
+ // can be used for the subsequent /answer api call.
740
+ //
741
+ // This field is simliar to the `summary_result_count` field in
742
+ // [SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count].
743
+ //
744
+ // At most 10 results for documents mode, or 50 for chunks mode.
745
+ optional int32 search_result_persistence_count = 2;
746
+ }
747
+
748
+ // The relevance threshold of the search results. The higher relevance
749
+ // threshold is, the higher relevant results are shown and the less number of
750
+ // results are returned.
751
+ enum RelevanceThreshold {
752
+ // Default value. In this case, server behavior defaults to Google defined
753
+ // threshold.
754
+ RELEVANCE_THRESHOLD_UNSPECIFIED = 0;
755
+
756
+ // Lowest relevance threshold.
757
+ LOWEST = 1;
758
+
759
+ // Low relevance threshold.
760
+ LOW = 2;
761
+
762
+ // Medium relevance threshold.
763
+ MEDIUM = 3;
764
+
765
+ // High relevance threshold.
766
+ HIGH = 4;
767
+ }
768
+
645
769
  // Required. The resource name of the Search serving config, such as
646
770
  // `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
647
771
  // or
@@ -744,9 +868,12 @@ message SearchRequest {
744
868
  // object. Leave it unset if ordered by relevance. `order_by` expression is
745
869
  // case-sensitive.
746
870
  //
747
- // For more information on ordering for retail search, see
748
- // [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
749
- //
871
+ // For more information on ordering the website search results, see
872
+ // [Order web search
873
+ // results](https://cloud.google.com/generative-ai-app-builder/docs/order-web-search-results).
874
+ // For more information on ordering the healthcare search results, see
875
+ // [Order healthcare search
876
+ // results](https://cloud.google.com/generative-ai-app-builder/docs/order-hc-results).
750
877
  // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
751
878
  string order_by = 8;
752
879
 
@@ -756,6 +883,19 @@ message SearchRequest {
756
883
  // is used to deduce `device_type` for analytics.
757
884
  UserInfo user_info = 21;
758
885
 
886
+ // The BCP-47 language code, such as "en-US" or "sr-Latn". For more
887
+ // information, see [Standard
888
+ // fields](https://cloud.google.com/apis/design/standard_fields). This field
889
+ // helps to better interpret the query. If a value isn't specified, the query
890
+ // language code is automatically detected, which may not be accurate.
891
+ string language_code = 35;
892
+
893
+ // The Unicode country/region code (CLDR) of a location, such as "US" and
894
+ // "419". For more information, see [Standard
895
+ // fields](https://cloud.google.com/apis/design/standard_fields). If set,
896
+ // then results will be boosted based on the region_code provided.
897
+ string region_code = 36;
898
+
759
899
  // Facet specifications for faceted search. If empty, no facets are returned.
760
900
  //
761
901
  // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
@@ -827,20 +967,26 @@ message SearchRequest {
827
967
  // documents. This overrides
828
968
  // [ServingConfig.ranking_expression][google.cloud.discoveryengine.v1alpha.ServingConfig.ranking_expression].
829
969
  // The ranking expression is a single function or multiple functions that are
830
- // joint by "+".
970
+ // joined by "+".
971
+ //
831
972
  // * ranking_expression = function, { " + ", function };
973
+ //
832
974
  // Supported functions:
975
+ //
833
976
  // * double * relevance_score
834
977
  // * double * dotProduct(embedding_field_path)
978
+ //
835
979
  // Function variables:
836
- // `relevance_score`: pre-defined keywords, used for measure relevance
980
+ //
981
+ // * `relevance_score`: pre-defined keywords, used for measure relevance
837
982
  // between query and document.
838
- // `embedding_field_path`: the document embedding field
983
+ // * `embedding_field_path`: the document embedding field
839
984
  // used with query embedding vector.
840
- // `dotProduct`: embedding function between embedding_field_path and query
985
+ // * `dotProduct`: embedding function between embedding_field_path and query
841
986
  // embedding vector.
842
987
  //
843
988
  // Example ranking expression:
989
+ //
844
990
  // If document has an embedding field doc_embedding, the ranking expression
845
991
  // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
846
992
  string ranking_expression = 26;
@@ -868,8 +1014,62 @@ message SearchRequest {
868
1014
  // for more details.
869
1015
  map<string, string> user_labels = 22;
870
1016
 
1017
+ // If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional
1018
+ // natural language query understanding will be done.
1019
+ NaturalLanguageQueryUnderstandingSpec
1020
+ natural_language_query_understanding_spec = 28;
1021
+
1022
+ // Search as you type configuration. Only supported for the
1023
+ // [IndustryVertical.MEDIA][google.cloud.discoveryengine.v1alpha.IndustryVertical.MEDIA]
1024
+ // vertical.
1025
+ SearchAsYouTypeSpec search_as_you_type_spec = 31;
1026
+
871
1027
  // Custom fine tuning configs.
1028
+ // If set, it has higher priority than the configs set in
1029
+ // [ServingConfig.custom_fine_tuning_spec][google.cloud.discoveryengine.v1alpha.ServingConfig.custom_fine_tuning_spec].
872
1030
  CustomFineTuningSpec custom_fine_tuning_spec = 34;
1031
+
1032
+ // The session resource name. Optional.
1033
+ //
1034
+ // Session allows users to do multi-turn /search API calls or coordination
1035
+ // between /search API calls and /answer API calls.
1036
+ //
1037
+ // Example #1 (multi-turn /search API calls):
1038
+ // 1. Call /search API with the auto-session mode (see below).
1039
+ // 2. Call /search API with the session ID generated in the first call.
1040
+ // Here, the previous search query gets considered in query
1041
+ // standing. I.e., if the first query is "How did Alphabet do in 2022?"
1042
+ // and the current query is "How about 2023?", the current query will
1043
+ // be interpreted as "How did Alphabet do in 2023?".
1044
+ //
1045
+ // Example #2 (coordination between /search API calls and /answer API calls):
1046
+ // 1. Call /search API with the auto-session mode (see below).
1047
+ // 2. Call /answer API with the session ID generated in the first call.
1048
+ // Here, the answer generation happens in the context of the search
1049
+ // results from the first search call.
1050
+ //
1051
+ // Auto-session mode: when `projects/.../sessions/-` is used, a new session
1052
+ // gets automatically created. Otherwise, users can use the create-session API
1053
+ // to create a session manually.
1054
+ //
1055
+ // Multi-turn Search feature is currently at private GA stage. Please use
1056
+ // v1alpha or v1beta version instead before we launch this feature to public
1057
+ // GA. Or ask for allowlisting through Google Support team.
1058
+ string session = 41 [(google.api.resource_reference) = {
1059
+ type: "discoveryengine.googleapis.com/Session"
1060
+ }];
1061
+
1062
+ // Session specification.
1063
+ //
1064
+ // Can be used only when `session` is set.
1065
+ SessionSpec session_spec = 42;
1066
+
1067
+ // The relevance threshold of the search results.
1068
+ //
1069
+ // Default to Google defined threshold, leveraging a balance of
1070
+ // precision and recall to deliver both highly accurate results and
1071
+ // comprehensive coverage of relevant information.
1072
+ RelevanceThreshold relevance_threshold = 44;
873
1073
  }
874
1074
 
875
1075
  // Response message for
@@ -1036,14 +1236,14 @@ message SearchResponse {
1036
1236
 
1037
1237
  // The adversarial query ignored case.
1038
1238
  //
1039
- // Only populated when
1239
+ // Only used when
1040
1240
  // [SummarySpec.ignore_adversarial_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_adversarial_query]
1041
1241
  // is set to `true`.
1042
1242
  ADVERSARIAL_QUERY_IGNORED = 1;
1043
1243
 
1044
1244
  // The non-summary seeking query ignored case.
1045
1245
  //
1046
- // Only populated when
1246
+ // Only used when
1047
1247
  // [SummarySpec.ignore_non_summary_seeking_query][google.cloud.discoveryengine.v1alpha.SearchRequest.ContentSearchSpec.SummarySpec.ignore_non_summary_seeking_query]
1048
1248
  // is set to `true`.
1049
1249
  NON_SUMMARY_SEEKING_QUERY_IGNORED = 2;
@@ -1065,6 +1265,20 @@ message SearchResponse {
1065
1265
  //
1066
1266
  // Google skips the summary if the LLM addon is not enabled.
1067
1267
  LLM_ADDON_NOT_ENABLED = 5;
1268
+
1269
+ // The no relevant content case.
1270
+ //
1271
+ // Google skips the summary if there is no relevant content in the
1272
+ // retrieved search results.
1273
+ NO_RELEVANT_CONTENT = 6;
1274
+
1275
+ // The jail-breaking query ignored case.
1276
+ //
1277
+ // For example, "Reply in the tone of a competing company's CEO".
1278
+ // Only used when
1279
+ // [SearchRequest.ContentSearchSpec.SummarySpec.ignore_jail_breaking_query]
1280
+ // is set to `true`.
1281
+ JAIL_BREAKING_QUERY_IGNORED = 7;
1068
1282
  }
1069
1283
 
1070
1284
  // The summary content.
@@ -1105,6 +1319,173 @@ message SearchResponse {
1105
1319
  int64 pinned_result_count = 2;
1106
1320
  }
1107
1321
 
1322
+ // Information describing what natural language understanding was
1323
+ // done on the input query.
1324
+ message NaturalLanguageQueryUnderstandingInfo {
1325
+ // The filters that were extracted from the input query represented in a
1326
+ // structured form.
1327
+ message StructuredExtractedFilter {
1328
+ // Constraint expression of a string field.
1329
+ message StringConstraint {
1330
+ // Name of the string field as defined in the schema.
1331
+ string field_name = 1;
1332
+
1333
+ // Values of the string field. The record will only be returned if the
1334
+ // field value matches one of the values specified here.
1335
+ repeated string values = 2;
1336
+ }
1337
+
1338
+ // Constraint expression of a number field. Example: price < 100.
1339
+ message NumberConstraint {
1340
+ // The comparison operation that was performed.
1341
+ enum Comparison {
1342
+ // Undefined comparison operator.
1343
+ COMPARISON_UNSPECIFIED = 0;
1344
+
1345
+ // Denotes equality `=` operator.
1346
+ EQUALS = 1;
1347
+
1348
+ // Denotes less than or equal to `<=` operator.
1349
+ LESS_THAN_EQUALS = 2;
1350
+
1351
+ // Denotes less than `<` operator.
1352
+ LESS_THAN = 3;
1353
+
1354
+ // Denotes greater than or equal to `>=` operator.
1355
+ GREATER_THAN_EQUALS = 4;
1356
+
1357
+ // Denotes greater than `>` operator.
1358
+ GREATER_THAN = 5;
1359
+ }
1360
+
1361
+ // Name of the numerical field as defined in the schema.
1362
+ string field_name = 1;
1363
+
1364
+ // The comparison operation performed between the field value and the
1365
+ // value specified in the constraint.
1366
+ Comparison comparison = 2;
1367
+
1368
+ // The value specified in the numerical constraint.
1369
+ double value = 3;
1370
+ }
1371
+
1372
+ // Constraint of a geolocation field.
1373
+ // Name of the geolocation field as defined in the schema.
1374
+ message GeolocationConstraint {
1375
+ // The name of the geolocation field as defined in the schema.
1376
+ string field_name = 1;
1377
+
1378
+ // The reference address that was inferred from the input query. The
1379
+ // proximity of the reference address to the geolocation field will be
1380
+ // used to filter the results.
1381
+ string address = 2;
1382
+
1383
+ // The latitude of the geolocation inferred from the input query.
1384
+ double latitude = 4;
1385
+
1386
+ // The longitude of the geolocation inferred from the input query.
1387
+ double longitude = 5;
1388
+
1389
+ // The radius in meters around the address. The record is returned if
1390
+ // the location of the geolocation field is within the radius.
1391
+ float radius_in_meters = 3;
1392
+ }
1393
+
1394
+ // Logical `And` operator.
1395
+ message AndExpression {
1396
+ // The expressions that were ANDed together.
1397
+ repeated Expression expressions = 1;
1398
+ }
1399
+
1400
+ // Logical `Or` operator.
1401
+ message OrExpression {
1402
+ // The expressions that were ORed together.
1403
+ repeated Expression expressions = 1;
1404
+ }
1405
+
1406
+ // The expression denoting the filter that was extracted from the input
1407
+ // query.
1408
+ message Expression {
1409
+ // The expression type.
1410
+ oneof expr {
1411
+ // String constraint expression.
1412
+ StringConstraint string_constraint = 1;
1413
+
1414
+ // Numerical constraint expression.
1415
+ NumberConstraint number_constraint = 2;
1416
+
1417
+ // Geolocation constraint expression.
1418
+ GeolocationConstraint geolocation_constraint = 3;
1419
+
1420
+ // Logical "And" compound operator connecting multiple expressions.
1421
+ AndExpression and_expr = 4;
1422
+
1423
+ // Logical "Or" compound operator connecting multiple expressions.
1424
+ OrExpression or_expr = 5;
1425
+ }
1426
+ }
1427
+
1428
+ // The expression denoting the filter that was extracted from the input
1429
+ // query in a structured form. It can be a simple expression denoting a
1430
+ // single string, numerical or geolocation constraint or a compound
1431
+ // expression which is a combination of multiple expressions connected
1432
+ // using logical (OR and AND) operators.
1433
+ Expression expression = 1;
1434
+ }
1435
+
1436
+ // The filters that were extracted from the input query.
1437
+ string extracted_filters = 1;
1438
+
1439
+ // Rewritten input query minus the extracted filters.
1440
+ string rewritten_query = 2;
1441
+
1442
+ // The filters that were extracted from the input query represented in a
1443
+ // structured form.
1444
+ StructuredExtractedFilter structured_extracted_filter = 3;
1445
+ }
1446
+
1447
+ // Information about the session.
1448
+ message SessionInfo {
1449
+ // Name of the session.
1450
+ // If the auto-session mode is used (when
1451
+ // [SearchRequest.session][google.cloud.discoveryengine.v1alpha.SearchRequest.session]
1452
+ // ends with "-"), this field holds the newly generated session name.
1453
+ string name = 1;
1454
+
1455
+ // Query ID that corresponds to this search API call.
1456
+ // One session can have multiple turns, each with a unique query ID.
1457
+ //
1458
+ // By specifying the session name and this query ID in the Answer API call,
1459
+ // the answer generation happens in the context of the search results from
1460
+ // this search call.
1461
+ string query_id = 2;
1462
+ }
1463
+
1464
+ // OneBoxResult is a holder for all results of specific type that we want
1465
+ // to display in UI differently.
1466
+ message OneBoxResult {
1467
+ // The type of One Box result.
1468
+ enum OneBoxType {
1469
+ // Default value. Should not be used.
1470
+ ONE_BOX_TYPE_UNSPECIFIED = 0;
1471
+
1472
+ // One Box result contains people results.
1473
+ PEOPLE = 1;
1474
+
1475
+ // One Box result contains organization results.
1476
+ ORGANIZATION = 2;
1477
+
1478
+ // One Box result contains slack results.
1479
+ SLACK = 3;
1480
+ }
1481
+
1482
+ // The type of One Box result.
1483
+ OneBoxType one_box_type = 1;
1484
+
1485
+ // The search results for this One Box.
1486
+ repeated SearchResult search_results = 2;
1487
+ }
1488
+
1108
1489
  // A list of matched documents. The order represents the ranking.
1109
1490
  repeated SearchResult results = 1;
1110
1491
 
@@ -1160,4 +1541,19 @@ message SearchResponse {
1160
1541
 
1161
1542
  // Query expansion information for the returned results.
1162
1543
  QueryExpansionInfo query_expansion_info = 14;
1544
+
1545
+ // Natural language query understanding information for the returned results.
1546
+ NaturalLanguageQueryUnderstandingInfo
1547
+ natural_language_query_understanding_info = 15;
1548
+
1549
+ // Session information.
1550
+ //
1551
+ // Only set if
1552
+ // [SearchRequest.session][google.cloud.discoveryengine.v1alpha.SearchRequest.session]
1553
+ // is provided. See its description for more details.
1554
+ SessionInfo session_info = 19;
1555
+
1556
+ // A list of One Box results. There can be multiple One Box results of
1557
+ // different types.
1558
+ repeated OneBoxResult one_box_results = 20;
1163
1559
  }
@@ -171,27 +171,36 @@ message ServingConfig {
171
171
  //
172
172
  // The ranking expression is a single function or multiple functions that are
173
173
  // joined by "+".
174
+ //
174
175
  // * ranking_expression = function, { " + ", function };
176
+ //
175
177
  // Supported functions:
178
+ //
176
179
  // * double * relevance_score
177
180
  // * double * dotProduct(embedding_field_path)
181
+ //
178
182
  // Function variables:
179
- // relevance_score: pre-defined keywords, used for measure relevance between
180
- // query and document.
181
- // embedding_field_path: the document embedding field
183
+ //
184
+ // * `relevance_score`: pre-defined keywords, used for measure relevance
185
+ // between query and document.
186
+ // * `embedding_field_path`: the document embedding field
182
187
  // used with query embedding vector.
183
- // dotProduct: embedding function between embedding_field_path and query
188
+ // * `dotProduct`: embedding function between embedding_field_path and query
184
189
  // embedding vector.
185
190
  //
186
191
  // Example ranking expression:
192
+ //
187
193
  // If document has an embedding field doc_embedding, the ranking expression
188
- // could be 0.5 * relevance_score + 0.3 * dotProduct(doc_embedding).
194
+ // could be `0.5 * relevance_score + 0.3 * dotProduct(doc_embedding)`.
189
195
  string ranking_expression = 21;
190
196
 
191
197
  // Guided search configs.
192
198
  GuidedSearchSpec guided_search_spec = 22;
193
199
 
194
200
  // Custom fine tuning configs.
201
+ // If
202
+ // [SearchRequest.custom_fine_tuning_spec][google.cloud.discoveryengine.v1alpha.SearchRequest.custom_fine_tuning_spec]
203
+ // is set, it has higher priority than the configs set here.
195
204
  CustomFineTuningSpec custom_fine_tuning_spec = 24;
196
205
 
197
206
  // Output only. ServingConfig created timestamp.