@google-cloud/discoveryengine 1.6.0 → 1.7.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 (142) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +24 -0
  3. package/build/protos/google/cloud/discoveryengine/v1/common.proto +13 -1
  4. package/build/protos/google/cloud/discoveryengine/v1/conversational_search_service.proto +5 -0
  5. package/build/protos/google/cloud/discoveryengine/v1/data_store.proto +17 -0
  6. package/build/protos/google/cloud/discoveryengine/v1/document.proto +9 -0
  7. package/build/protos/google/cloud/discoveryengine/v1/document_service.proto +6 -0
  8. package/build/protos/google/cloud/discoveryengine/v1/engine.proto +2 -2
  9. package/build/protos/google/cloud/discoveryengine/v1/import_config.proto +284 -22
  10. package/build/protos/google/cloud/discoveryengine/v1/purge_config.proto +3 -0
  11. package/build/protos/google/cloud/discoveryengine/v1/recommendation_service.proto +228 -0
  12. package/build/protos/google/cloud/discoveryengine/v1/search_service.proto +125 -21
  13. package/build/protos/google/cloud/discoveryengine/v1/user_event.proto +16 -11
  14. package/build/protos/google/cloud/discoveryengine/v1alpha/answer.proto +328 -0
  15. package/build/protos/google/cloud/discoveryengine/v1alpha/chunk.proto +41 -1
  16. package/build/protos/google/cloud/discoveryengine/v1alpha/common.proto +21 -1
  17. package/build/protos/google/cloud/discoveryengine/v1alpha/conversational_search_service.proto +574 -0
  18. package/build/protos/google/cloud/discoveryengine/v1alpha/document.proto +19 -0
  19. package/build/protos/google/cloud/discoveryengine/v1alpha/document_processing_config.proto +3 -6
  20. package/build/protos/google/cloud/discoveryengine/v1alpha/document_service.proto +64 -0
  21. package/build/protos/google/cloud/discoveryengine/v1alpha/engine.proto +2 -2
  22. package/build/protos/google/cloud/discoveryengine/v1alpha/grounded_generation_service.proto +120 -0
  23. package/build/protos/google/cloud/discoveryengine/v1alpha/grounding.proto +55 -0
  24. package/build/protos/google/cloud/discoveryengine/v1alpha/import_config.proto +283 -24
  25. package/build/protos/google/cloud/discoveryengine/v1alpha/project.proto +102 -0
  26. package/build/protos/google/cloud/discoveryengine/v1alpha/project_service.proto +171 -0
  27. package/build/protos/google/cloud/discoveryengine/v1alpha/schema.proto +21 -0
  28. package/build/protos/google/cloud/discoveryengine/v1alpha/search_service.proto +158 -24
  29. package/build/protos/google/cloud/discoveryengine/v1alpha/search_tuning_service.proto +9 -3
  30. package/build/protos/google/cloud/discoveryengine/v1alpha/serving_config_service.proto +2 -1
  31. package/build/protos/google/cloud/discoveryengine/v1alpha/session.proto +94 -0
  32. package/build/protos/google/cloud/discoveryengine/v1alpha/user_event.proto +1 -1
  33. package/build/protos/google/cloud/discoveryengine/v1beta/answer.proto +328 -0
  34. package/build/protos/google/cloud/discoveryengine/v1beta/common.proto +30 -1
  35. package/build/protos/google/cloud/discoveryengine/v1beta/conversational_search_service.proto +559 -0
  36. package/build/protos/google/cloud/discoveryengine/v1beta/document_processing_config.proto +3 -6
  37. package/build/protos/google/cloud/discoveryengine/v1beta/document_service.proto +6 -0
  38. package/build/protos/google/cloud/discoveryengine/v1beta/engine.proto +2 -2
  39. package/build/protos/google/cloud/discoveryengine/v1beta/engine_service.proto +93 -0
  40. package/build/protos/google/cloud/discoveryengine/v1beta/grounded_generation_service.proto +120 -0
  41. package/build/protos/google/cloud/discoveryengine/v1beta/grounding.proto +55 -0
  42. package/build/protos/google/cloud/discoveryengine/v1beta/import_config.proto +283 -24
  43. package/build/protos/google/cloud/discoveryengine/v1beta/rank_service.proto +115 -0
  44. package/build/protos/google/cloud/discoveryengine/v1beta/search_service.proto +142 -22
  45. package/build/protos/google/cloud/discoveryengine/v1beta/search_tuning_service.proto +7 -1
  46. package/build/protos/google/cloud/discoveryengine/v1beta/session.proto +94 -0
  47. package/build/protos/google/cloud/discoveryengine/v1beta/user_event.proto +1 -1
  48. package/build/protos/protos.d.ts +44799 -26093
  49. package/build/protos/protos.js +120465 -74222
  50. package/build/protos/protos.json +8911 -4556
  51. package/build/src/index.d.ts +4 -1
  52. package/build/src/index.js +4 -1
  53. package/build/src/v1/conversational_search_service_client.d.ts +4 -0
  54. package/build/src/v1/document_service_client.d.ts +47 -19
  55. package/build/src/v1/index.d.ts +1 -0
  56. package/build/src/v1/index.js +3 -1
  57. package/build/src/v1/recommendation_service_client.d.ts +1087 -0
  58. package/build/src/v1/recommendation_service_client.js +1432 -0
  59. package/build/src/v1/recommendation_service_client_config.json +43 -0
  60. package/build/src/v1/search_service_client.d.ts +27 -9
  61. package/build/src/v1/search_service_client.js +18 -6
  62. package/build/src/v1/search_service_client_config.json +5 -5
  63. package/build/src/v1alpha/acl_config_service_client.d.ts +330 -0
  64. package/build/src/v1alpha/acl_config_service_client.js +454 -0
  65. package/build/src/v1alpha/chunk_service_client.d.ts +330 -0
  66. package/build/src/v1alpha/chunk_service_client.js +454 -0
  67. package/build/src/v1alpha/completion_service_client.d.ts +330 -0
  68. package/build/src/v1alpha/completion_service_client.js +457 -0
  69. package/build/src/v1alpha/conversational_search_service_client.d.ts +674 -0
  70. package/build/src/v1alpha/conversational_search_service_client.js +724 -0
  71. package/build/src/v1alpha/conversational_search_service_client_config.json +35 -0
  72. package/build/src/v1alpha/data_store_service_client.d.ts +330 -0
  73. package/build/src/v1alpha/data_store_service_client.js +457 -0
  74. package/build/src/v1alpha/document_service_client.d.ts +410 -21
  75. package/build/src/v1alpha/document_service_client.js +479 -0
  76. package/build/src/v1alpha/document_service_client_config.json +5 -0
  77. package/build/src/v1alpha/engine_service_client.d.ts +330 -0
  78. package/build/src/v1alpha/engine_service_client.js +457 -0
  79. package/build/src/v1alpha/estimate_billing_service_client.d.ts +330 -0
  80. package/build/src/v1alpha/estimate_billing_service_client.js +457 -0
  81. package/build/src/v1alpha/grounded_generation_service_client.d.ts +1574 -0
  82. package/build/src/v1alpha/grounded_generation_service_client.js +2248 -0
  83. package/build/src/v1alpha/grounded_generation_service_client_config.json +43 -0
  84. package/build/src/v1alpha/index.d.ts +3 -1
  85. package/build/src/v1alpha/index.js +7 -3
  86. package/build/src/v1alpha/project_service_client.d.ts +1756 -0
  87. package/build/src/v1alpha/project_service_client.js +2500 -0
  88. package/build/src/v1alpha/project_service_client_config.json +38 -0
  89. package/build/src/v1alpha/rank_service_client.d.ts +330 -0
  90. package/build/src/v1alpha/rank_service_client.js +454 -0
  91. package/build/src/v1alpha/rank_service_client_config.json +15 -2
  92. package/build/src/v1alpha/recommendation_service_client.d.ts +330 -0
  93. package/build/src/v1alpha/recommendation_service_client.js +454 -0
  94. package/build/src/v1alpha/schema_service_client.d.ts +330 -0
  95. package/build/src/v1alpha/schema_service_client.js +457 -0
  96. package/build/src/v1alpha/search_service_client.d.ts +360 -15
  97. package/build/src/v1alpha/search_service_client.js +474 -10
  98. package/build/src/v1alpha/search_service_client_config.json +5 -5
  99. package/build/src/v1alpha/search_tuning_service_client.d.ts +330 -0
  100. package/build/src/v1alpha/search_tuning_service_client.js +457 -0
  101. package/build/src/v1alpha/serving_config_service_client.d.ts +317 -1
  102. package/build/src/v1alpha/serving_config_service_client.js +434 -1
  103. package/build/src/v1alpha/site_search_engine_service_client.d.ts +330 -0
  104. package/build/src/v1alpha/site_search_engine_service_client.js +457 -0
  105. package/build/src/v1alpha/user_event_service_client.d.ts +330 -0
  106. package/build/src/v1alpha/user_event_service_client.js +457 -0
  107. package/build/src/v1beta/completion_service_client.d.ts +315 -0
  108. package/build/src/v1beta/completion_service_client.js +432 -0
  109. package/build/src/v1beta/conversational_search_service_client.d.ts +659 -0
  110. package/build/src/v1beta/conversational_search_service_client.js +702 -0
  111. package/build/src/v1beta/conversational_search_service_client_config.json +35 -0
  112. package/build/src/v1beta/data_store_service_client.d.ts +315 -0
  113. package/build/src/v1beta/data_store_service_client.js +432 -0
  114. package/build/src/v1beta/document_service_client.d.ts +361 -21
  115. package/build/src/v1beta/document_service_client.js +432 -0
  116. package/build/src/v1beta/engine_service_client.d.ts +410 -0
  117. package/build/src/v1beta/engine_service_client.js +518 -0
  118. package/build/src/v1beta/engine_service_client_config.json +12 -0
  119. package/build/src/v1beta/grounded_generation_service_client.d.ts +1406 -0
  120. package/build/src/v1beta/grounded_generation_service_client.js +2014 -0
  121. package/build/src/v1beta/grounded_generation_service_client_config.json +43 -0
  122. package/build/src/v1beta/index.d.ts +2 -0
  123. package/build/src/v1beta/index.js +5 -1
  124. package/build/src/v1beta/rank_service_client.d.ts +1416 -0
  125. package/build/src/v1beta/rank_service_client.js +2015 -0
  126. package/build/src/v1beta/rank_service_client_config.json +43 -0
  127. package/build/src/v1beta/recommendation_service_client.d.ts +315 -0
  128. package/build/src/v1beta/recommendation_service_client.js +432 -0
  129. package/build/src/v1beta/schema_service_client.d.ts +315 -0
  130. package/build/src/v1beta/schema_service_client.js +432 -0
  131. package/build/src/v1beta/search_service_client.d.ts +342 -12
  132. package/build/src/v1beta/search_service_client.js +450 -8
  133. package/build/src/v1beta/search_service_client_config.json +5 -5
  134. package/build/src/v1beta/search_tuning_service_client.d.ts +315 -0
  135. package/build/src/v1beta/search_tuning_service_client.js +432 -0
  136. package/build/src/v1beta/serving_config_service_client.d.ts +315 -0
  137. package/build/src/v1beta/serving_config_service_client.js +432 -0
  138. package/build/src/v1beta/site_search_engine_service_client.d.ts +315 -0
  139. package/build/src/v1beta/site_search_engine_service_client.js +432 -0
  140. package/build/src/v1beta/user_event_service_client.d.ts +315 -0
  141. package/build/src/v1beta/user_event_service_client.js +432 -0
  142. package/package.json +1 -1
@@ -39,6 +39,18 @@ option (google.api.resource_definition) = {
39
39
  type: "discoveryengine.googleapis.com/Location"
40
40
  pattern: "projects/{project}/locations/{location}"
41
41
  };
42
+ option (google.api.resource_definition) = {
43
+ type: "discoveryengine.googleapis.com/GroundingConfig"
44
+ pattern: "projects/{project}/locations/{location}/groundingConfigs/{grounding_config}"
45
+ };
46
+ option (google.api.resource_definition) = {
47
+ type: "discoveryengine.googleapis.com/RankingConfig"
48
+ pattern: "projects/{project}/locations/{location}/rankingConfigs/{ranking_config}"
49
+ };
50
+ option (google.api.resource_definition) = {
51
+ type: "healthcare.googleapis.com/FhirStore"
52
+ pattern: "projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}"
53
+ };
42
54
 
43
55
  // The industry vertical associated with the
44
56
  // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
@@ -52,6 +64,9 @@ enum IndustryVertical {
52
64
 
53
65
  // The media industry vertical.
54
66
  MEDIA = 2;
67
+
68
+ // The healthcare FHIR vertical.
69
+ HEALTHCARE_FHIR = 7;
55
70
  }
56
71
 
57
72
  // The type of solution.
@@ -67,10 +82,15 @@ enum SolutionType {
67
82
 
68
83
  // Used for use cases related to the Generative AI agent.
69
84
  SOLUTION_TYPE_CHAT = 3;
85
+
86
+ // Used for use cases related to the Generative Chat agent.
87
+ // It's used for Generative chat engine only, the associated data stores
88
+ // must enrolled with `SOLUTION_TYPE_CHAT` solution.
89
+ SOLUTION_TYPE_GENERATIVE_CHAT = 4;
70
90
  }
71
91
 
72
92
  // Tiers of search features. Different tiers might have different
73
- // pricing. To learn more, please check the pricing documentation.
93
+ // pricing. To learn more, check the pricing documentation.
74
94
  enum SearchTier {
75
95
  // Default value when the enum is unspecified. This is invalid to use.
76
96
  SEARCH_TIER_UNSPECIFIED = 0;
@@ -20,8 +20,11 @@ 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/v1alpha/answer.proto";
24
+ import "google/cloud/discoveryengine/v1alpha/common.proto";
23
25
  import "google/cloud/discoveryengine/v1alpha/conversation.proto";
24
26
  import "google/cloud/discoveryengine/v1alpha/search_service.proto";
27
+ import "google/cloud/discoveryengine/v1alpha/session.proto";
25
28
  import "google/protobuf/empty.proto";
26
29
  import "google/protobuf/field_mask.proto";
27
30
 
@@ -147,6 +150,123 @@ service ConversationalSearchService {
147
150
  };
148
151
  option (google.api.method_signature) = "parent";
149
152
  }
153
+
154
+ // Answer query method.
155
+ rpc AnswerQuery(AnswerQueryRequest) returns (AnswerQueryResponse) {
156
+ option (google.api.http) = {
157
+ post: "/v1alpha/{serving_config=projects/*/locations/*/dataStores/*/servingConfigs/*}:answer"
158
+ body: "*"
159
+ additional_bindings {
160
+ post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/dataStores/*/servingConfigs/*}:answer"
161
+ body: "*"
162
+ }
163
+ additional_bindings {
164
+ post: "/v1alpha/{serving_config=projects/*/locations/*/collections/*/engines/*/servingConfigs/*}:answer"
165
+ body: "*"
166
+ }
167
+ };
168
+ }
169
+
170
+ // Gets a Answer.
171
+ rpc GetAnswer(GetAnswerRequest) returns (Answer) {
172
+ option (google.api.http) = {
173
+ get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/sessions/*/answers/*}"
174
+ additional_bindings {
175
+ get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*/answers/*}"
176
+ }
177
+ additional_bindings {
178
+ get: "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/sessions/*/answers/*}"
179
+ }
180
+ };
181
+ option (google.api.method_signature) = "name";
182
+ }
183
+
184
+ // Creates a Session.
185
+ //
186
+ // If the [Session][google.cloud.discoveryengine.v1alpha.Session] to create
187
+ // already exists, an ALREADY_EXISTS error is returned.
188
+ rpc CreateSession(CreateSessionRequest) returns (Session) {
189
+ option (google.api.http) = {
190
+ post: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/sessions"
191
+ body: "session"
192
+ additional_bindings {
193
+ post: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions"
194
+ body: "session"
195
+ }
196
+ additional_bindings {
197
+ post: "/v1alpha/{parent=projects/*/locations/*/collections/*/engines/*}/sessions"
198
+ body: "session"
199
+ }
200
+ };
201
+ option (google.api.method_signature) = "parent,session";
202
+ }
203
+
204
+ // Deletes a Session.
205
+ //
206
+ // If the [Session][google.cloud.discoveryengine.v1alpha.Session] to delete
207
+ // does not exist, a NOT_FOUND error is returned.
208
+ rpc DeleteSession(DeleteSessionRequest) returns (google.protobuf.Empty) {
209
+ option (google.api.http) = {
210
+ delete: "/v1alpha/{name=projects/*/locations/*/dataStores/*/sessions/*}"
211
+ additional_bindings {
212
+ delete: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}"
213
+ }
214
+ additional_bindings {
215
+ delete: "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}"
216
+ }
217
+ };
218
+ option (google.api.method_signature) = "name";
219
+ }
220
+
221
+ // Updates a Session.
222
+ //
223
+ // [Session][google.cloud.discoveryengine.v1alpha.Session] action type cannot
224
+ // be changed. If the [Session][google.cloud.discoveryengine.v1alpha.Session]
225
+ // to update does not exist, a NOT_FOUND error is returned.
226
+ rpc UpdateSession(UpdateSessionRequest) returns (Session) {
227
+ option (google.api.http) = {
228
+ patch: "/v1alpha/{session.name=projects/*/locations/*/dataStores/*/sessions/*}"
229
+ body: "session"
230
+ additional_bindings {
231
+ patch: "/v1alpha/{session.name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}"
232
+ body: "session"
233
+ }
234
+ additional_bindings {
235
+ patch: "/v1alpha/{session.name=projects/*/locations/*/collections/*/engines/*/sessions/*}"
236
+ body: "session"
237
+ }
238
+ };
239
+ option (google.api.method_signature) = "session,update_mask";
240
+ }
241
+
242
+ // Gets a Session.
243
+ rpc GetSession(GetSessionRequest) returns (Session) {
244
+ option (google.api.http) = {
245
+ get: "/v1alpha/{name=projects/*/locations/*/dataStores/*/sessions/*}"
246
+ additional_bindings {
247
+ get: "/v1alpha/{name=projects/*/locations/*/collections/*/dataStores/*/sessions/*}"
248
+ }
249
+ additional_bindings {
250
+ get: "/v1alpha/{name=projects/*/locations/*/collections/*/engines/*/sessions/*}"
251
+ }
252
+ };
253
+ option (google.api.method_signature) = "name";
254
+ }
255
+
256
+ // Lists all Sessions by their parent
257
+ // [DataStore][google.cloud.discoveryengine.v1alpha.DataStore].
258
+ rpc ListSessions(ListSessionsRequest) returns (ListSessionsResponse) {
259
+ option (google.api.http) = {
260
+ get: "/v1alpha/{parent=projects/*/locations/*/dataStores/*}/sessions"
261
+ additional_bindings {
262
+ get: "/v1alpha/{parent=projects/*/locations/*/collections/*/dataStores/*}/sessions"
263
+ }
264
+ additional_bindings {
265
+ get: "/v1alpha/{parent=projects/*/locations/*/collections/*/engines/*}/sessions"
266
+ }
267
+ };
268
+ option (google.api.method_signature) = "parent";
269
+ }
150
270
  }
151
271
 
152
272
  // Request message for
@@ -348,3 +468,457 @@ message ListConversationsResponse {
348
468
  // Pagination token, if not returned indicates the last page.
349
469
  string next_page_token = 2;
350
470
  }
471
+
472
+ // Request message for
473
+ // [ConversationalSearchService.AnswerQuery][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.AnswerQuery]
474
+ // method.
475
+ message AnswerQueryRequest {
476
+ // Safety specification.
477
+ message SafetySpec {
478
+ // Enable the safety filtering on the answer response. It is false by
479
+ // default.
480
+ bool enable = 1;
481
+ }
482
+
483
+ // Related questions specification.
484
+ message RelatedQuestionsSpec {
485
+ // Enable related questions feature if true.
486
+ bool enable = 1;
487
+ }
488
+
489
+ // Answer generation specification.
490
+ message AnswerGenerationSpec {
491
+ // Answer Generation Model specification.
492
+ message ModelSpec {
493
+ // Model version. If not set, it will use the default stable model.
494
+ // Allowed values are: stable, preview.
495
+ string model_version = 1;
496
+ }
497
+
498
+ // Answer generation prompt specification.
499
+ message PromptSpec {
500
+ // Customized preamble.
501
+ string preamble = 1;
502
+ }
503
+
504
+ // Answer generation model specification.
505
+ ModelSpec model_spec = 1;
506
+
507
+ // Answer generation prompt specification.
508
+ PromptSpec prompt_spec = 2;
509
+
510
+ // Specifies whether to include citation metadata in the answer. The default
511
+ // value is `false`.
512
+ bool include_citations = 3;
513
+
514
+ // Language code for Answer. Use language tags defined by
515
+ // [BCP47](https://www.rfc-editor.org/rfc/bcp/bcp47.txt).
516
+ // Note: This is an experimental feature.
517
+ string answer_language_code = 4;
518
+
519
+ // Specifies whether to filter out adversarial queries. The default value
520
+ // is `false`.
521
+ //
522
+ // Google employs search-query classification to detect adversarial
523
+ // queries. No answer is returned if the search query is classified as an
524
+ // adversarial query. For example, a user might ask a question regarding
525
+ // negative comments about the company or submit a query designed to
526
+ // generate unsafe, policy-violating output. If this field is set to
527
+ // `true`, we skip generating answers for adversarial queries and return
528
+ // fallback messages instead.
529
+ bool ignore_adversarial_query = 5;
530
+
531
+ // Specifies whether to filter out queries that are not answer-seeking.
532
+ // The default value is `false`.
533
+ //
534
+ // Google employs search-query classification to detect answer-seeking
535
+ // queries. No answer is returned if the search query is classified as a
536
+ // non-answer seeking query. If this field is set to `true`, we skip
537
+ // generating answers for non-answer seeking queries and return
538
+ // fallback messages instead.
539
+ bool ignore_non_answer_seeking_query = 6;
540
+ }
541
+
542
+ // Search specification.
543
+ message SearchSpec {
544
+ // Search parameters.
545
+ message SearchParams {
546
+ // Number of search results to return.
547
+ // The default value is 10.
548
+ int32 max_return_results = 1;
549
+
550
+ // The filter syntax consists of an expression language for constructing
551
+ // a predicate from one or more fields of the documents being filtered.
552
+ // Filter expression is case-sensitive. This will be used to filter
553
+ // search results which may affect the Answer response.
554
+ //
555
+ // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
556
+ //
557
+ // Filtering in Vertex AI Search is done by mapping the LHS filter key
558
+ // to a key property defined in the Vertex AI Search backend -- this
559
+ // mapping is defined by the customer in their schema. For example a
560
+ // media customers might have a field 'name' in their schema. In this
561
+ // case the filter would look like this: filter --> name:'ANY("king
562
+ // kong")'
563
+ //
564
+ // For more information about filtering including syntax and filter
565
+ // operators, see
566
+ // [Filter](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
567
+ string filter = 2;
568
+
569
+ // Boost specification to boost certain documents in search results which
570
+ // may affect the answer query response. For more information on boosting,
571
+ // see [Boosting](https://cloud.google.com/retail/docs/boosting#boost)
572
+ SearchRequest.BoostSpec boost_spec = 3;
573
+
574
+ // The order in which documents are returned. Documents can be ordered
575
+ // by a field in an
576
+ // [Document][google.cloud.discoveryengine.v1alpha.Document] object. Leave
577
+ // it unset if ordered by relevance. `order_by` expression is
578
+ // case-sensitive. For more information on ordering, see
579
+ // [Ordering](https://cloud.google.com/retail/docs/filter-and-order#order)
580
+ //
581
+ // If this field is unrecognizable, an `INVALID_ARGUMENT` is returned.
582
+ string order_by = 4;
583
+
584
+ // Specifies the search result mode. If unspecified, the
585
+ // search result mode is based on
586
+ // [DataStore.DocumentProcessingConfig.chunking_config][]:
587
+ // * If [DataStore.DocumentProcessingConfig.chunking_config][] is
588
+ // specified,
589
+ // it defaults to `CHUNKS`.
590
+ // * Otherwise, it defaults to `DOCUMENTS`.
591
+ // See [parse and chunk
592
+ // documents](https://cloud.google.com/generative-ai-app-builder/docs/parse-chunk-documents)
593
+ SearchRequest.ContentSearchSpec.SearchResultMode search_result_mode = 5;
594
+
595
+ // Custom fine tuning configs.
596
+ CustomFineTuningSpec custom_fine_tuning_spec = 6;
597
+ }
598
+
599
+ // Search result list.
600
+ message SearchResultList {
601
+ // Search result.
602
+ message SearchResult {
603
+ // Unstructured document information.
604
+ message UnstructuredDocumentInfo {
605
+ // Document context.
606
+ message DocumentContext {
607
+ // Page identifier.
608
+ string page_identifier = 1;
609
+
610
+ // Document content.
611
+ string content = 2;
612
+ }
613
+
614
+ // Extractive segment.
615
+ // [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#extractive-segments)
616
+ message ExtractiveSegment {
617
+ // Page identifier.
618
+ string page_identifier = 1;
619
+
620
+ // Extractive segment content.
621
+ string content = 2;
622
+ }
623
+
624
+ // Extractive answer.
625
+ // [Guide](https://cloud.google.com/generative-ai-app-builder/docs/snippets#get-answers)
626
+ message ExtractiveAnswer {
627
+ // Page identifier.
628
+ string page_identifier = 1;
629
+
630
+ // Extractive answer content.
631
+ string content = 2;
632
+ }
633
+
634
+ // Document resource name.
635
+ string document = 1 [(google.api.resource_reference) = {
636
+ type: "discoveryengine.googleapis.com/Document"
637
+ }];
638
+
639
+ // URI for the document.
640
+ string uri = 2;
641
+
642
+ // Title.
643
+ string title = 3;
644
+
645
+ // List of document contexts.
646
+ repeated DocumentContext document_contexts = 4;
647
+
648
+ // List of extractive segments.
649
+ repeated ExtractiveSegment extractive_segments = 5;
650
+
651
+ // List of extractive answers.
652
+ repeated ExtractiveAnswer extractive_answers = 6;
653
+ }
654
+
655
+ // Chunk information.
656
+ message ChunkInfo {
657
+ // Chunk resource name.
658
+ string chunk = 1 [(google.api.resource_reference) = {
659
+ type: "discoveryengine.googleapis.com/Chunk"
660
+ }];
661
+
662
+ // Chunk textual content.
663
+ string content = 2;
664
+ }
665
+
666
+ // Search result content.
667
+ oneof content {
668
+ // Unstructured document information.
669
+ UnstructuredDocumentInfo unstructured_document_info = 1;
670
+
671
+ // Chunk information.
672
+ ChunkInfo chunk_info = 2;
673
+ }
674
+ }
675
+
676
+ // Search results.
677
+ repeated SearchResult search_results = 1;
678
+ }
679
+
680
+ // Search parameters to control the search behavior.
681
+ // Or provide search result list to generate answer.
682
+ oneof input {
683
+ // Search parameters.
684
+ SearchParams search_params = 1;
685
+
686
+ // Search result list.
687
+ SearchResultList search_result_list = 2;
688
+ }
689
+ }
690
+
691
+ // Query understanding specification.
692
+ message QueryUnderstandingSpec {
693
+ // Query classification specification.
694
+ message QueryClassificationSpec {
695
+ // Query classification types.
696
+ enum Type {
697
+ // Unspecified query classification type.
698
+ TYPE_UNSPECIFIED = 0;
699
+
700
+ // Adversarial query classification type.
701
+ ADVERSARIAL_QUERY = 1;
702
+
703
+ // Non-answer-seeking query classification type.
704
+ NON_ANSWER_SEEKING_QUERY = 2;
705
+ }
706
+
707
+ // Enabled query classification types.
708
+ repeated Type types = 1;
709
+ }
710
+
711
+ // Query rephraser specification.
712
+ message QueryRephraserSpec {
713
+ // Disable query rephraser.
714
+ bool disable = 1;
715
+
716
+ // Max rephrase steps.
717
+ // The max number is 10 steps.
718
+ // If not set or set to < 1, it will be set to 1 by default.
719
+ int32 max_rephrase_steps = 2;
720
+ }
721
+
722
+ // Query classification specification.
723
+ QueryClassificationSpec query_classification_spec = 1;
724
+
725
+ // Query rephraser specification.
726
+ QueryRephraserSpec query_rephraser_spec = 2;
727
+ }
728
+
729
+ // Required. The resource name of the Search serving config, such as
730
+ // `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
731
+ // or
732
+ // `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`.
733
+ // This field is used to identify the serving configuration name, set
734
+ // of models used to make the search.
735
+ string serving_config = 1 [
736
+ (google.api.field_behavior) = REQUIRED,
737
+ (google.api.resource_reference) = {
738
+ type: "discoveryengine.googleapis.com/ServingConfig"
739
+ }
740
+ ];
741
+
742
+ // Required. Current user query.
743
+ Query query = 2 [(google.api.field_behavior) = REQUIRED];
744
+
745
+ // The session resource name. Not required.
746
+ //
747
+ // When session field is not set, the API is in sessionless mode.
748
+ //
749
+ // We support auto session mode: users can use the wildcard symbol “-” as
750
+ // session id. A new id will be automatically generated and assigned.
751
+ string session = 3 [(google.api.resource_reference) = {
752
+ type: "discoveryengine.googleapis.com/Session"
753
+ }];
754
+
755
+ // Model specification.
756
+ SafetySpec safety_spec = 4;
757
+
758
+ // Related questions specification.
759
+ RelatedQuestionsSpec related_questions_spec = 5;
760
+
761
+ // Answer generation specification.
762
+ AnswerGenerationSpec answer_generation_spec = 7;
763
+
764
+ // Search specification.
765
+ SearchSpec search_spec = 8;
766
+
767
+ // Query understanding specification.
768
+ QueryUnderstandingSpec query_understanding_spec = 9;
769
+
770
+ // Asynchronous mode control.
771
+ //
772
+ // If enabled, the response will be returned with answer/session resource
773
+ // name without final answer. The API users need to do the polling to get
774
+ // the latest status of answer/session by calling
775
+ // [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.GetAnswer]
776
+ // or
777
+ // [ConversationalSearchService.GetSession][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.GetSession]
778
+ // method.
779
+ bool asynchronous_mode = 10;
780
+
781
+ // A unique identifier for tracking visitors. For example, this could be
782
+ // implemented with an HTTP cookie, which should be able to uniquely identify
783
+ // a visitor on a single device. This unique identifier should not change if
784
+ // the visitor logs in or out of the website.
785
+ //
786
+ // This field should NOT have a fixed value such as `unknown_visitor`.
787
+ //
788
+ // The field must be a UTF-8 encoded string with a length limit of 128
789
+ // characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
790
+ string user_pseudo_id = 12;
791
+ }
792
+
793
+ // Response message for
794
+ // [ConversationalSearchService.AnswerQuery][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.AnswerQuery]
795
+ // method.
796
+ message AnswerQueryResponse {
797
+ // Answer resource object.
798
+ // If [AnswerQueryRequest.StepSpec.max_step_count][] is greater than 1,
799
+ // use [Answer.name][google.cloud.discoveryengine.v1alpha.Answer.name] to
800
+ // fetch answer information using
801
+ // [ConversationalSearchService.GetAnswer][google.cloud.discoveryengine.v1alpha.ConversationalSearchService.GetAnswer]
802
+ // API.
803
+ Answer answer = 1;
804
+
805
+ // Session resource object.
806
+ // It will be only available when session field is set and valid in the
807
+ // [AnswerQueryRequest][google.cloud.discoveryengine.v1alpha.AnswerQueryRequest]
808
+ // request.
809
+ Session session = 2;
810
+ }
811
+
812
+ // Request for GetAnswer method.
813
+ message GetAnswerRequest {
814
+ // Required. The resource name of the Answer to get. Format:
815
+ // `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
816
+ string name = 1 [
817
+ (google.api.field_behavior) = REQUIRED,
818
+ (google.api.resource_reference) = {
819
+ type: "discoveryengine.googleapis.com/Answer"
820
+ }
821
+ ];
822
+ }
823
+
824
+ // Request for CreateSession method.
825
+ message CreateSessionRequest {
826
+ // Required. Full resource name of parent data store. Format:
827
+ // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
828
+ string parent = 1 [
829
+ (google.api.field_behavior) = REQUIRED,
830
+ (google.api.resource_reference) = {
831
+ type: "discoveryengine.googleapis.com/DataStore"
832
+ }
833
+ ];
834
+
835
+ // Required. The session to create.
836
+ Session session = 2 [(google.api.field_behavior) = REQUIRED];
837
+ }
838
+
839
+ // Request for UpdateSession method.
840
+ message UpdateSessionRequest {
841
+ // Required. The Session to update.
842
+ Session session = 1 [(google.api.field_behavior) = REQUIRED];
843
+
844
+ // Indicates which fields in the provided
845
+ // [Session][google.cloud.discoveryengine.v1alpha.Session] to update. The
846
+ // following are NOT supported:
847
+ //
848
+ // * [Session.name][google.cloud.discoveryengine.v1alpha.Session.name]
849
+ //
850
+ // If not set or empty, all supported fields are updated.
851
+ google.protobuf.FieldMask update_mask = 2;
852
+ }
853
+
854
+ // Request for DeleteSession method.
855
+ message DeleteSessionRequest {
856
+ // Required. The resource name of the Session to delete. Format:
857
+ // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
858
+ string name = 1 [
859
+ (google.api.field_behavior) = REQUIRED,
860
+ (google.api.resource_reference) = {
861
+ type: "discoveryengine.googleapis.com/Session"
862
+ }
863
+ ];
864
+ }
865
+
866
+ // Request for GetSession method.
867
+ message GetSessionRequest {
868
+ // Required. The resource name of the Session to get. Format:
869
+ // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
870
+ string name = 1 [
871
+ (google.api.field_behavior) = REQUIRED,
872
+ (google.api.resource_reference) = {
873
+ type: "discoveryengine.googleapis.com/Session"
874
+ }
875
+ ];
876
+ }
877
+
878
+ // Request for ListSessions method.
879
+ message ListSessionsRequest {
880
+ // Required. The data store resource name. Format:
881
+ // `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
882
+ string parent = 1 [
883
+ (google.api.field_behavior) = REQUIRED,
884
+ (google.api.resource_reference) = {
885
+ type: "discoveryengine.googleapis.com/DataStore"
886
+ }
887
+ ];
888
+
889
+ // Maximum number of results to return. If unspecified, defaults
890
+ // to 50. Max allowed value is 1000.
891
+ int32 page_size = 2;
892
+
893
+ // A page token, received from a previous `ListSessions` call.
894
+ // Provide this to retrieve the subsequent page.
895
+ string page_token = 3;
896
+
897
+ // A filter to apply on the list results. The supported features are:
898
+ // user_pseudo_id, state.
899
+ //
900
+ // Example:
901
+ // "user_pseudo_id = some_id"
902
+ string filter = 4;
903
+
904
+ // A comma-separated list of fields to order by, sorted in ascending order.
905
+ // Use "desc" after a field name for descending.
906
+ // Supported fields:
907
+ // * `update_time`
908
+ // * `create_time`
909
+ // * `session_name`
910
+ //
911
+ // Example:
912
+ // "update_time desc"
913
+ // "create_time"
914
+ string order_by = 5;
915
+ }
916
+
917
+ // Response for ListSessions method.
918
+ message ListSessionsResponse {
919
+ // All the Sessions for a given data store.
920
+ repeated Session sessions = 1;
921
+
922
+ // Pagination token, if not returned indicates the last page.
923
+ string next_page_token = 2;
924
+ }
@@ -202,3 +202,22 @@ message Document {
202
202
  google.protobuf.Timestamp index_time = 13
203
203
  [(google.api.field_behavior) = OUTPUT_ONLY];
204
204
  }
205
+
206
+ // Document captures all raw metadata information of items to be recommended or
207
+ // searched.
208
+ message ProcessedDocument {
209
+ // Output format of the processed document.
210
+ oneof processed_data_format {
211
+ // The JSON string representation of the processed document.
212
+ string json_data = 2;
213
+ }
214
+
215
+ // Required. Full resource name of the referenced document, in the format
216
+ // `projects/*/locations/*/collections/*/dataStores/*/branches/*/documents/*`.
217
+ string document = 1 [
218
+ (google.api.field_behavior) = REQUIRED,
219
+ (google.api.resource_reference) = {
220
+ type: "discoveryengine.googleapis.com/Document"
221
+ }
222
+ ];
223
+ }
@@ -72,12 +72,9 @@ message DocumentProcessingConfig {
72
72
 
73
73
  // The OCR parsing configurations for documents.
74
74
  message OcrParsingConfig {
75
- // Apply additional enhanced OCR processing to a list of document
76
- // elements.
77
- //
78
- // Supported values:
79
- // * `table`: advanced table parsing model.
80
- repeated string enhanced_document_elements = 1;
75
+ // [DEPRECATED] This field is deprecated. To use the additional enhanced
76
+ // document elements processing, please switch to `layout_parsing_config`.
77
+ repeated string enhanced_document_elements = 1 [deprecated = true];
81
78
 
82
79
  // If true, will use native text instead of OCR text on pages containing
83
80
  // native text.