@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
@@ -645,6 +645,98 @@ message SearchRequest {
645
645
  repeated EmbeddingVector embedding_vectors = 1;
646
646
  }
647
647
 
648
+ // Specification to enable natural language understanding capabilities for
649
+ // search requests.
650
+ message NaturalLanguageQueryUnderstandingSpec {
651
+ // Enum describing under which condition filter extraction should occur.
652
+ enum FilterExtractionCondition {
653
+ // Server behavior defaults to [Condition.DISABLED][].
654
+ CONDITION_UNSPECIFIED = 0;
655
+
656
+ // Disables NL filter extraction.
657
+ DISABLED = 1;
658
+
659
+ // Enables NL filter extraction.
660
+ ENABLED = 2;
661
+ }
662
+
663
+ // The condition under which filter extraction should occur.
664
+ // Default to [Condition.DISABLED][].
665
+ FilterExtractionCondition filter_extraction_condition = 1;
666
+
667
+ // Field names used for location-based filtering, where geolocation filters
668
+ // are detected in natural language search queries.
669
+ // Only valid when the FilterExtractionCondition is set to `ENABLED`.
670
+ //
671
+ // If this field is set, it overrides the field names set in
672
+ // [ServingConfig.geo_search_query_detection_field_names][google.cloud.discoveryengine.v1beta.ServingConfig.geo_search_query_detection_field_names].
673
+ repeated string geo_search_query_detection_field_names = 2;
674
+ }
675
+
676
+ // Specification for search as you type in search requests.
677
+ message SearchAsYouTypeSpec {
678
+ // Enum describing under which condition search as you type should occur.
679
+ enum Condition {
680
+ // Server behavior defaults to
681
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.SearchAsYouTypeSpec.Condition.DISABLED].
682
+ CONDITION_UNSPECIFIED = 0;
683
+
684
+ // Disables Search As You Type.
685
+ DISABLED = 1;
686
+
687
+ // Enables Search As You Type.
688
+ ENABLED = 2;
689
+ }
690
+
691
+ // The condition under which search as you type should occur.
692
+ // Default to
693
+ // [Condition.DISABLED][google.cloud.discoveryengine.v1beta.SearchRequest.SearchAsYouTypeSpec.Condition.DISABLED].
694
+ Condition condition = 1;
695
+ }
696
+
697
+ // Session specification.
698
+ //
699
+ // Multi-turn Search feature is currently at private GA stage. Please use
700
+ // v1alpha or v1beta version instead before we launch this feature to public
701
+ // GA. Or ask for allowlisting through Google Support team.
702
+ message SessionSpec {
703
+ // If set, the search result gets stored to the "turn" specified by this
704
+ // query ID.
705
+ //
706
+ // Example: Let's say the session looks like this:
707
+ // session {
708
+ // name: ".../sessions/xxx"
709
+ // turns {
710
+ // query { text: "What is foo?" query_id: ".../questions/yyy" }
711
+ // answer: "Foo is ..."
712
+ // }
713
+ // turns {
714
+ // query { text: "How about bar then?" query_id: ".../questions/zzz" }
715
+ // }
716
+ // }
717
+ //
718
+ // The user can call /search API with a request like this:
719
+ //
720
+ // session: ".../sessions/xxx"
721
+ // session_spec { query_id: ".../questions/zzz" }
722
+ //
723
+ // Then, the API stores the search result, associated with the last turn.
724
+ // The stored search result can be used by a subsequent /answer API call
725
+ // (with the session ID and the query ID specified). Also, it is possible
726
+ // to call /search and /answer in parallel with the same session ID & query
727
+ // ID.
728
+ string query_id = 1;
729
+
730
+ // The number of top search results to persist. The persisted search results
731
+ // can be used for the subsequent /answer api call.
732
+ //
733
+ // This field is simliar to the `summary_result_count` field in
734
+ // [SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count][google.cloud.discoveryengine.v1beta.SearchRequest.ContentSearchSpec.SummarySpec.summary_result_count].
735
+ //
736
+ // At most 10 results for documents mode, or 50 for chunks mode.
737
+ optional int32 search_result_persistence_count = 2;
738
+ }
739
+
648
740
  // Required. The resource name of the Search serving config, such as
649
741
  // `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
650
742
  // or
@@ -758,6 +850,19 @@ message SearchRequest {
758
850
  // is used to deduce `device_type` for analytics.
759
851
  UserInfo user_info = 21;
760
852
 
853
+ // The BCP-47 language code, such as "en-US" or "sr-Latn". For more
854
+ // information, see [Standard
855
+ // fields](https://cloud.google.com/apis/design/standard_fields). This field
856
+ // helps to better interpret the query. If a value isn't specified, the query
857
+ // language code is automatically detected, which may not be accurate.
858
+ string language_code = 35;
859
+
860
+ // The Unicode country/region code (CLDR) of a location, such as "US" and
861
+ // "419". For more information, see [Standard
862
+ // fields](https://cloud.google.com/apis/design/standard_fields). If set,
863
+ // then results will be boosted based on the region_code provided.
864
+ string region_code = 36;
865
+
761
866
  // Facet specifications for faceted search. If empty, no facets are returned.
762
867
  //
763
868
  // A maximum of 100 values are allowed. Otherwise, an `INVALID_ARGUMENT`
@@ -875,6 +980,51 @@ message SearchRequest {
875
980
  // Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
876
981
  // for more details.
877
982
  map<string, string> user_labels = 22;
983
+
984
+ // If `naturalLanguageQueryUnderstandingSpec` is not specified, no additional
985
+ // natural language query understanding will be done.
986
+ NaturalLanguageQueryUnderstandingSpec
987
+ natural_language_query_understanding_spec = 28;
988
+
989
+ // Search as you type configuration. Only supported for the
990
+ // [IndustryVertical.MEDIA][google.cloud.discoveryengine.v1beta.IndustryVertical.MEDIA]
991
+ // vertical.
992
+ SearchAsYouTypeSpec search_as_you_type_spec = 31;
993
+
994
+ // The session resource name. Optional.
995
+ //
996
+ // Session allows users to do multi-turn /search API calls or coordination
997
+ // between /search API calls and /answer API calls.
998
+ //
999
+ // Example #1 (multi-turn /search API calls):
1000
+ // 1. Call /search API with the auto-session mode (see below).
1001
+ // 2. Call /search API with the session ID generated in the first call.
1002
+ // Here, the previous search query gets considered in query
1003
+ // standing. I.e., if the first query is "How did Alphabet do in 2022?"
1004
+ // and the current query is "How about 2023?", the current query will
1005
+ // be interpreted as "How did Alphabet do in 2023?".
1006
+ //
1007
+ // Example #2 (coordination between /search API calls and /answer API calls):
1008
+ // 1. Call /search API with the auto-session mode (see below).
1009
+ // 2. Call /answer API with the session ID generated in the first call.
1010
+ // Here, the answer generation happens in the context of the search
1011
+ // results from the first search call.
1012
+ //
1013
+ // Auto-session mode: when `projects/.../sessions/-` is used, a new session
1014
+ // gets automatically created. Otherwise, users can use the create-session API
1015
+ // to create a session manually.
1016
+ //
1017
+ // Multi-turn Search feature is currently at private GA stage. Please use
1018
+ // v1alpha or v1beta version instead before we launch this feature to public
1019
+ // GA. Or ask for allowlisting through Google Support team.
1020
+ string session = 41 [(google.api.resource_reference) = {
1021
+ type: "discoveryengine.googleapis.com/Session"
1022
+ }];
1023
+
1024
+ // Session specification.
1025
+ //
1026
+ // Can be used only when `session` is set.
1027
+ SessionSpec session_spec = 42;
878
1028
  }
879
1029
 
880
1030
  // Response message for
@@ -1070,6 +1220,12 @@ message SearchResponse {
1070
1220
  //
1071
1221
  // Google skips the summary if the LLM addon is not enabled.
1072
1222
  LLM_ADDON_NOT_ENABLED = 5;
1223
+
1224
+ // The no relevant content case.
1225
+ //
1226
+ // Google skips the summary if there is no relevant content in the
1227
+ // retrieved search results.
1228
+ NO_RELEVANT_CONTENT = 6;
1073
1229
  }
1074
1230
 
1075
1231
  // The summary content.
@@ -1110,6 +1266,142 @@ message SearchResponse {
1110
1266
  int64 pinned_result_count = 2;
1111
1267
  }
1112
1268
 
1269
+ // Information describing what natural language understanding was
1270
+ // done on the input query.
1271
+ message NaturalLanguageQueryUnderstandingInfo {
1272
+ // The filters that were extracted from the input query represented in a
1273
+ // structured form.
1274
+ message StructuredExtractedFilter {
1275
+ // Constraint expression of a string field.
1276
+ message StringConstraint {
1277
+ // Name of the string field as defined in the schema.
1278
+ string field_name = 1;
1279
+
1280
+ // Values of the string field. The record will only be returned if the
1281
+ // field value matches one of the values specified here.
1282
+ repeated string values = 2;
1283
+ }
1284
+
1285
+ // Constraint expression of a number field. Example: price < 100.
1286
+ message NumberConstraint {
1287
+ // The comparison operation that was performed.
1288
+ enum Comparison {
1289
+ // Undefined comparison operator.
1290
+ COMPARISON_UNSPECIFIED = 0;
1291
+
1292
+ // Denotes equality `=` operator.
1293
+ EQUALS = 1;
1294
+
1295
+ // Denotes less than or equal to `<=` operator.
1296
+ LESS_THAN_EQUALS = 2;
1297
+
1298
+ // Denotes less than `<` operator.
1299
+ LESS_THAN = 3;
1300
+
1301
+ // Denotes greater than or equal to `>=` operator.
1302
+ GREATER_THAN_EQUALS = 4;
1303
+
1304
+ // Denotes greater than `>` operator.
1305
+ GREATER_THAN = 5;
1306
+ }
1307
+
1308
+ // Name of the numerical field as defined in the schema.
1309
+ string field_name = 1;
1310
+
1311
+ // The comparison operation performed between the field value and the
1312
+ // value specified in the constraint.
1313
+ Comparison comparison = 2;
1314
+
1315
+ // The value specified in the numerical constraint.
1316
+ double value = 3;
1317
+ }
1318
+
1319
+ // Constraint of a geolocation field.
1320
+ // Name of the geolocation field as defined in the schema.
1321
+ message GeolocationConstraint {
1322
+ // The name of the geolocation field as defined in the schema.
1323
+ string field_name = 1;
1324
+
1325
+ // The reference address that was inferred from the input query. The
1326
+ // proximity of the reference address to the geolocation field will be
1327
+ // used to filter the results.
1328
+ string address = 2;
1329
+
1330
+ // The radius in meters around the address. The record is returned if
1331
+ // the location of the geolocation field is within the radius.
1332
+ float radius_in_meters = 3;
1333
+ }
1334
+
1335
+ // Logical `And` operator.
1336
+ message AndExpression {
1337
+ // The expressions that were ANDed together.
1338
+ repeated Expression expressions = 1;
1339
+ }
1340
+
1341
+ // Logical `Or` operator.
1342
+ message OrExpression {
1343
+ // The expressions that were ORed together.
1344
+ repeated Expression expressions = 1;
1345
+ }
1346
+
1347
+ // The expression denoting the filter that was extracted from the input
1348
+ // query.
1349
+ message Expression {
1350
+ // The expression type.
1351
+ oneof expr {
1352
+ // String constraint expression.
1353
+ StringConstraint string_constraint = 1;
1354
+
1355
+ // Numerical constraint expression.
1356
+ NumberConstraint number_constraint = 2;
1357
+
1358
+ // Geolocation constraint expression.
1359
+ GeolocationConstraint geolocation_constraint = 3;
1360
+
1361
+ // Logical "And" compound operator connecting multiple expressions.
1362
+ AndExpression and_expr = 4;
1363
+
1364
+ // Logical "Or" compound operator connecting multiple expressions.
1365
+ OrExpression or_expr = 5;
1366
+ }
1367
+ }
1368
+
1369
+ // The expression denoting the filter that was extracted from the input
1370
+ // query in a structured form. It can be a simple expression denoting a
1371
+ // single string, numerical or geolocation constraint or a compound
1372
+ // expression which is a combination of multiple expressions connected
1373
+ // using logical (OR and AND) operators.
1374
+ Expression expression = 1;
1375
+ }
1376
+
1377
+ // The filters that were extracted from the input query.
1378
+ string extracted_filters = 1;
1379
+
1380
+ // Rewritten input query minus the extracted filters.
1381
+ string rewritten_query = 2;
1382
+
1383
+ // The filters that were extracted from the input query represented in a
1384
+ // structured form.
1385
+ StructuredExtractedFilter structured_extracted_filter = 3;
1386
+ }
1387
+
1388
+ // Information about the session.
1389
+ message SessionInfo {
1390
+ // Name of the session.
1391
+ // If the auto-session mode is used (when
1392
+ // [SearchRequest.session][google.cloud.discoveryengine.v1beta.SearchRequest.session]
1393
+ // ends with "-"), this field holds the newly generated session name.
1394
+ string name = 1;
1395
+
1396
+ // Query ID that corresponds to this search API call.
1397
+ // One session can have multiple turns, each with a unique query ID.
1398
+ //
1399
+ // By specifying the session name and this query ID in the Answer API call,
1400
+ // the answer generation happens in the context of the search results from
1401
+ // this search call.
1402
+ string query_id = 2;
1403
+ }
1404
+
1113
1405
  // A list of matched documents. The order represents the ranking.
1114
1406
  repeated SearchResult results = 1;
1115
1407
 
@@ -1165,4 +1457,15 @@ message SearchResponse {
1165
1457
 
1166
1458
  // Query expansion information for the returned results.
1167
1459
  QueryExpansionInfo query_expansion_info = 14;
1460
+
1461
+ // Natural language query understanding information for the returned results.
1462
+ NaturalLanguageQueryUnderstandingInfo
1463
+ natural_language_query_understanding_info = 15;
1464
+
1465
+ // Session information.
1466
+ //
1467
+ // Only set if
1468
+ // [SearchRequest.session][google.cloud.discoveryengine.v1beta.SearchRequest.session]
1469
+ // is provided. See its description for more details.
1470
+ SessionInfo session_info = 19;
1168
1471
  }
@@ -22,6 +22,7 @@ import "google/api/field_behavior.proto";
22
22
  import "google/api/httpbody.proto";
23
23
  import "google/api/resource.proto";
24
24
  import "google/cloud/discoveryengine/v1beta/import_config.proto";
25
+ import "google/cloud/discoveryengine/v1beta/purge_config.proto";
25
26
  import "google/cloud/discoveryengine/v1beta/user_event.proto";
26
27
  import "google/longrunning/operations.proto";
27
28
 
@@ -67,6 +68,29 @@ service UserEventService {
67
68
  additional_bindings {
68
69
  get: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:collect"
69
70
  }
71
+ additional_bindings {
72
+ get: "/v1beta/{parent=projects/*/locations/*}/userEvents:collect"
73
+ }
74
+ };
75
+ }
76
+
77
+ // Deletes permanently all user events specified by the filter provided.
78
+ // Depending on the number of events specified by the filter, this operation
79
+ // could take hours or days to complete. To test a filter, use the list
80
+ // command first.
81
+ rpc PurgeUserEvents(PurgeUserEventsRequest)
82
+ returns (google.longrunning.Operation) {
83
+ option (google.api.http) = {
84
+ post: "/v1beta/{parent=projects/*/locations/*/dataStores/*}/userEvents:purge"
85
+ body: "*"
86
+ additional_bindings {
87
+ post: "/v1beta/{parent=projects/*/locations/*/collections/*/dataStores/*}/userEvents:purge"
88
+ body: "*"
89
+ }
90
+ };
91
+ option (google.longrunning.operation_info) = {
92
+ response_type: "google.cloud.discoveryengine.v1beta.PurgeUserEventsResponse"
93
+ metadata_type: "google.cloud.discoveryengine.v1beta.PurgeUserEventsMetadata"
70
94
  };
71
95
  }
72
96