google-cloud-discovery_engine-v1beta 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +30 -20
  3. data/lib/google/cloud/discovery_engine/v1beta/completion_service/client.rb +186 -6
  4. data/lib/google/cloud/discovery_engine/v1beta/completion_service/operations.rb +12 -15
  5. data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +62 -0
  6. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +179 -6
  7. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/operations.rb +43 -38
  8. data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +131 -31
  9. data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +35 -12
  10. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +35 -12
  11. data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/service_stub.rb +54 -32
  12. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +48 -27
  13. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +48 -27
  14. data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/service_stub.rb +118 -80
  15. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/client.rb +31 -6
  16. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/operations.rb +12 -15
  17. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/client.rb +31 -6
  18. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/operations.rb +43 -38
  19. data/lib/google/cloud/discovery_engine/v1beta/data_store_service/rest/service_stub.rb +54 -32
  20. data/lib/google/cloud/discovery_engine/v1beta/document_service/client.rb +31 -9
  21. data/lib/google/cloud/discovery_engine/v1beta/document_service/operations.rb +12 -15
  22. data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +25 -0
  23. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/client.rb +31 -9
  24. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/operations.rb +43 -38
  25. data/lib/google/cloud/discovery_engine/v1beta/document_service/rest/service_stub.rb +78 -50
  26. data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +35 -12
  27. data/lib/google/cloud/discovery_engine/v1beta/engine_service/operations.rb +12 -15
  28. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +35 -12
  29. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/operations.rb +43 -38
  30. data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/service_stub.rb +78 -50
  31. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/client.rb +31 -5
  32. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/operations.rb +12 -15
  33. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/client.rb +31 -5
  34. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/operations.rb +43 -38
  35. data/lib/google/cloud/discovery_engine/v1beta/evaluation_service/rest/service_stub.rb +46 -26
  36. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +244 -6
  37. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +85 -0
  38. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +152 -6
  39. data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +83 -7
  40. data/lib/google/cloud/discovery_engine/v1beta/project_service/client.rb +29 -2
  41. data/lib/google/cloud/discovery_engine/v1beta/project_service/operations.rb +12 -15
  42. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/client.rb +29 -2
  43. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/operations.rb +43 -38
  44. data/lib/google/cloud/discovery_engine/v1beta/project_service/rest/service_stub.rb +22 -8
  45. data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +29 -3
  46. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +29 -3
  47. data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/service_stub.rb +22 -8
  48. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/client.rb +28 -2
  49. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/client.rb +28 -2
  50. data/lib/google/cloud/discovery_engine/v1beta/recommendation_service/rest/service_stub.rb +22 -8
  51. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/client.rb +30 -7
  52. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/operations.rb +12 -15
  53. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/client.rb +30 -7
  54. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/operations.rb +43 -38
  55. data/lib/google/cloud/discovery_engine/v1beta/sample_query_service/rest/service_stub.rb +62 -38
  56. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/client.rb +29 -6
  57. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/client.rb +29 -6
  58. data/lib/google/cloud/discovery_engine/v1beta/sample_query_set_service/rest/service_stub.rb +54 -32
  59. data/lib/google/cloud/discovery_engine/v1beta/schema_service/client.rb +32 -6
  60. data/lib/google/cloud/discovery_engine/v1beta/schema_service/operations.rb +12 -15
  61. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/client.rb +32 -6
  62. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/operations.rb +43 -38
  63. data/lib/google/cloud/discovery_engine/v1beta/schema_service/rest/service_stub.rb +54 -32
  64. data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +427 -3
  65. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +417 -3
  66. data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +99 -7
  67. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/client.rb +29 -3
  68. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/operations.rb +12 -15
  69. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/client.rb +29 -3
  70. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/operations.rb +43 -38
  71. data/lib/google/cloud/discovery_engine/v1beta/search_tuning_service/rest/service_stub.rb +30 -14
  72. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +31 -6
  73. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +31 -6
  74. data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/service_stub.rb +38 -20
  75. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +361 -14
  76. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/operations.rb +12 -15
  77. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/paths.rb +49 -0
  78. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +340 -14
  79. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/operations.rb +43 -38
  80. data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/service_stub.rb +308 -73
  81. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +31 -6
  82. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/operations.rb +12 -15
  83. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +31 -6
  84. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/operations.rb +43 -38
  85. data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/service_stub.rb +46 -26
  86. data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
  87. data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
  88. data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
  89. data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +18 -1
  90. data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +2 -0
  91. data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +1 -1
  92. data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +4 -1
  93. data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
  94. data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +7 -1
  95. data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +2 -1
  96. data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
  97. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +24 -1
  98. data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +4 -0
  99. data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +2 -1
  100. data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +3 -1
  101. data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +14 -0
  102. data/lib/google/cloud/discoveryengine/v1beta/serving_config_pb.rb +2 -2
  103. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +2 -1
  104. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_pb.rb +10 -1
  105. data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_services_pb.rb +7 -0
  106. data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
  107. data/proto_docs/google/api/client.rb +39 -0
  108. data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +20 -6
  109. data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +268 -0
  110. data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +9 -0
  111. data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +6 -6
  112. data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +95 -15
  113. data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +8 -3
  114. data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +131 -0
  115. data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +7 -5
  116. data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +19 -0
  117. data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +5 -1
  118. data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +4 -4
  119. data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +396 -1
  120. data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +10 -0
  121. data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +1 -1
  122. data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +1 -1
  123. data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +1 -1
  124. data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +71 -0
  125. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +16 -0
  126. data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +2 -2
  127. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +17 -0
  128. data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine_service.rb +147 -1
  129. data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +9 -1
  130. data/proto_docs/google/longrunning/operations.rb +19 -14
  131. metadata +5 -5
@@ -30,7 +30,8 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
33
+ # @private
34
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:, logger:
34
35
  # These require statements are intentionally placed here to initialize
35
36
  # the REST modules only when it's required.
36
37
  require "gapic/rest"
@@ -40,7 +41,9 @@ module Google
40
41
  universe_domain: universe_domain,
41
42
  credentials: credentials,
42
43
  numeric_enums: true,
43
- raise_faraday_errors: false
44
+ service_name: self.class,
45
+ raise_faraday_errors: false,
46
+ logger: logger
44
47
  end
45
48
 
46
49
  ##
@@ -61,6 +64,15 @@ module Google
61
64
  @client_stub.endpoint
62
65
  end
63
66
 
67
+ ##
68
+ # The logger used for request/response debug logging.
69
+ #
70
+ # @return [Logger]
71
+ #
72
+ def logger stub: false
73
+ stub ? @client_stub.stub_logger : @client_stub.logger
74
+ end
75
+
64
76
  ##
65
77
  # Baseline implementation for the create_control REST call
66
78
  #
@@ -87,16 +99,18 @@ module Google
87
99
 
88
100
  response = @client_stub.make_http_request(
89
101
  verb,
90
- uri: uri,
91
- body: body || "",
92
- params: query_string_params,
102
+ uri: uri,
103
+ body: body || "",
104
+ params: query_string_params,
105
+ method_name: "create_control",
93
106
  options: options
94
107
  )
95
108
  operation = ::Gapic::Rest::TransportOperation.new response
96
109
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Control.decode_json response.body, ignore_unknown_fields: true
97
-
98
- yield result, operation if block_given?
99
- result
110
+ catch :response do
111
+ yield result, operation if block_given?
112
+ result
113
+ end
100
114
  end
101
115
 
102
116
  ##
@@ -125,16 +139,18 @@ module Google
125
139
 
126
140
  response = @client_stub.make_http_request(
127
141
  verb,
128
- uri: uri,
129
- body: body || "",
130
- params: query_string_params,
142
+ uri: uri,
143
+ body: body || "",
144
+ params: query_string_params,
145
+ method_name: "delete_control",
131
146
  options: options
132
147
  )
133
148
  operation = ::Gapic::Rest::TransportOperation.new response
134
149
  result = ::Google::Protobuf::Empty.decode_json response.body, ignore_unknown_fields: true
135
-
136
- yield result, operation if block_given?
137
- result
150
+ catch :response do
151
+ yield result, operation if block_given?
152
+ result
153
+ end
138
154
  end
139
155
 
140
156
  ##
@@ -163,16 +179,18 @@ module Google
163
179
 
164
180
  response = @client_stub.make_http_request(
165
181
  verb,
166
- uri: uri,
167
- body: body || "",
168
- params: query_string_params,
182
+ uri: uri,
183
+ body: body || "",
184
+ params: query_string_params,
185
+ method_name: "update_control",
169
186
  options: options
170
187
  )
171
188
  operation = ::Gapic::Rest::TransportOperation.new response
172
189
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Control.decode_json response.body, ignore_unknown_fields: true
173
-
174
- yield result, operation if block_given?
175
- result
190
+ catch :response do
191
+ yield result, operation if block_given?
192
+ result
193
+ end
176
194
  end
177
195
 
178
196
  ##
@@ -201,16 +219,18 @@ module Google
201
219
 
202
220
  response = @client_stub.make_http_request(
203
221
  verb,
204
- uri: uri,
205
- body: body || "",
206
- params: query_string_params,
222
+ uri: uri,
223
+ body: body || "",
224
+ params: query_string_params,
225
+ method_name: "get_control",
207
226
  options: options
208
227
  )
209
228
  operation = ::Gapic::Rest::TransportOperation.new response
210
229
  result = ::Google::Cloud::DiscoveryEngine::V1beta::Control.decode_json response.body, ignore_unknown_fields: true
211
-
212
- yield result, operation if block_given?
213
- result
230
+ catch :response do
231
+ yield result, operation if block_given?
232
+ result
233
+ end
214
234
  end
215
235
 
216
236
  ##
@@ -239,16 +259,18 @@ module Google
239
259
 
240
260
  response = @client_stub.make_http_request(
241
261
  verb,
242
- uri: uri,
243
- body: body || "",
244
- params: query_string_params,
262
+ uri: uri,
263
+ body: body || "",
264
+ params: query_string_params,
265
+ method_name: "list_controls",
245
266
  options: options
246
267
  )
247
268
  operation = ::Gapic::Rest::TransportOperation.new response
248
269
  result = ::Google::Cloud::DiscoveryEngine::V1beta::ListControlsResponse.decode_json response.body, ignore_unknown_fields: true
249
-
250
- yield result, operation if block_given?
251
- result
270
+ catch :response do
271
+ yield result, operation if block_given?
272
+ result
273
+ end
252
274
  end
253
275
 
254
276
  ##
@@ -163,14 +163,26 @@ module Google
163
163
  universe_domain: @config.universe_domain,
164
164
  channel_args: @config.channel_args,
165
165
  interceptors: @config.interceptors,
166
- channel_pool_config: @config.channel_pool
166
+ channel_pool_config: @config.channel_pool,
167
+ logger: @config.logger
167
168
  )
168
169
 
170
+ @conversational_search_service_stub.stub_logger&.info do |entry|
171
+ entry.set_system_name
172
+ entry.set_service
173
+ entry.message = "Created client for #{entry.service}"
174
+ entry.set_credentials_fields credentials
175
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
176
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
177
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
178
+ end
179
+
169
180
  @location_client = Google::Cloud::Location::Locations::Client.new do |config|
170
181
  config.credentials = credentials
171
182
  config.quota_project = @quota_project_id
172
183
  config.endpoint = @conversational_search_service_stub.endpoint
173
184
  config.universe_domain = @conversational_search_service_stub.universe_domain
185
+ config.logger = @conversational_search_service_stub.logger if config.respond_to? :logger=
174
186
  end
175
187
  end
176
188
 
@@ -181,6 +193,15 @@ module Google
181
193
  #
182
194
  attr_reader :location_client
183
195
 
196
+ ##
197
+ # The logger used for request/response debug logging.
198
+ #
199
+ # @return [Logger]
200
+ #
201
+ def logger
202
+ @conversational_search_service_stub.logger
203
+ end
204
+
184
205
  # Service calls
185
206
 
186
207
  ##
@@ -203,16 +224,16 @@ module Google
203
224
  #
204
225
  # @param name [::String]
205
226
  # Required. The resource name of the Conversation to get. Format:
206
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
227
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
207
228
  # Use
208
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
229
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
209
230
  # to activate auto session mode, which automatically creates a new
210
231
  # conversation inside a ConverseConversation session.
211
232
  # @param query [::Google::Cloud::DiscoveryEngine::V1beta::TextInput, ::Hash]
212
233
  # Required. Current user input.
213
234
  # @param serving_config [::String]
214
235
  # The resource name of the Serving Config to use. Format:
215
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
236
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
216
237
  # If this is not set, the default serving config will be used.
217
238
  # @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
218
239
  # The conversation to be used by auto session only. The name field will be
@@ -321,7 +342,6 @@ module Google
321
342
 
322
343
  @conversational_search_service_stub.call_rpc :converse_conversation, request, options: options do |response, operation|
323
344
  yield response, operation if block_given?
324
- return response
325
345
  end
326
346
  rescue ::GRPC::BadStatus => e
327
347
  raise ::Google::Cloud::Error.from_error(e)
@@ -350,7 +370,7 @@ module Google
350
370
  #
351
371
  # @param parent [::String]
352
372
  # Required. Full resource name of parent data store. Format:
353
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
373
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
354
374
  # @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
355
375
  # Required. The conversation to create.
356
376
  #
@@ -413,7 +433,6 @@ module Google
413
433
 
414
434
  @conversational_search_service_stub.call_rpc :create_conversation, request, options: options do |response, operation|
415
435
  yield response, operation if block_given?
416
- return response
417
436
  end
418
437
  rescue ::GRPC::BadStatus => e
419
438
  raise ::Google::Cloud::Error.from_error(e)
@@ -442,7 +461,7 @@ module Google
442
461
  #
443
462
  # @param name [::String]
444
463
  # Required. The resource name of the Conversation to delete. Format:
445
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
464
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
446
465
  #
447
466
  # @yield [response, operation] Access the result along with the RPC operation
448
467
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -503,7 +522,6 @@ module Google
503
522
 
504
523
  @conversational_search_service_stub.call_rpc :delete_conversation, request, options: options do |response, operation|
505
524
  yield response, operation if block_given?
506
- return response
507
525
  end
508
526
  rescue ::GRPC::BadStatus => e
509
527
  raise ::Google::Cloud::Error.from_error(e)
@@ -602,7 +620,6 @@ module Google
602
620
 
603
621
  @conversational_search_service_stub.call_rpc :update_conversation, request, options: options do |response, operation|
604
622
  yield response, operation if block_given?
605
- return response
606
623
  end
607
624
  rescue ::GRPC::BadStatus => e
608
625
  raise ::Google::Cloud::Error.from_error(e)
@@ -628,7 +645,7 @@ module Google
628
645
  #
629
646
  # @param name [::String]
630
647
  # Required. The resource name of the Conversation to get. Format:
631
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
648
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
632
649
  #
633
650
  # @yield [response, operation] Access the result along with the RPC operation
634
651
  # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Conversation]
@@ -689,7 +706,6 @@ module Google
689
706
 
690
707
  @conversational_search_service_stub.call_rpc :get_conversation, request, options: options do |response, operation|
691
708
  yield response, operation if block_given?
692
- return response
693
709
  end
694
710
  rescue ::GRPC::BadStatus => e
695
711
  raise ::Google::Cloud::Error.from_error(e)
@@ -716,7 +732,7 @@ module Google
716
732
  #
717
733
  # @param parent [::String]
718
734
  # Required. The data store resource name. Format:
719
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
735
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
720
736
  # @param page_size [::Integer]
721
737
  # Maximum number of results to return. If unspecified, defaults
722
738
  # to 50. Max allowed value is 1000.
@@ -805,7 +821,7 @@ module Google
805
821
  @conversational_search_service_stub.call_rpc :list_conversations, request, options: options do |response, operation|
806
822
  response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_conversations, request, response, operation, options
807
823
  yield response, operation if block_given?
808
- return response
824
+ throw :response, response
809
825
  end
810
826
  rescue ::GRPC::BadStatus => e
811
827
  raise ::Google::Cloud::Error.from_error(e)
@@ -824,7 +840,7 @@ module Google
824
840
  # @param options [::Gapic::CallOptions, ::Hash]
825
841
  # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
826
842
  #
827
- # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
843
+ # @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
828
844
  # Pass arguments to `answer_query` via keyword arguments. Note that at
829
845
  # least one keyword argument is required. To specify no parameters, or to keep all
830
846
  # the default parameter values, pass an empty Hash as a request object (see above).
@@ -849,6 +865,8 @@ module Google
849
865
  # Model specification.
850
866
  # @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash]
851
867
  # Related questions specification.
868
+ # @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::GroundingSpec, ::Hash]
869
+ # Optional. Grounding specification.
852
870
  # @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec, ::Hash]
853
871
  # Answer generation specification.
854
872
  # @param search_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec, ::Hash]
@@ -856,6 +874,9 @@ module Google
856
874
  # @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash]
857
875
  # Query understanding specification.
858
876
  # @param asynchronous_mode [::Boolean]
877
+ # Deprecated: This field is deprecated. Streaming Answer API will be
878
+ # supported.
879
+ #
859
880
  # Asynchronous mode control.
860
881
  #
861
882
  # If enabled, the response will be returned with answer/session resource
@@ -953,7 +974,6 @@ module Google
953
974
 
954
975
  @conversational_search_service_stub.call_rpc :answer_query, request, options: options do |response, operation|
955
976
  yield response, operation if block_given?
956
- return response
957
977
  end
958
978
  rescue ::GRPC::BadStatus => e
959
979
  raise ::Google::Cloud::Error.from_error(e)
@@ -979,7 +999,7 @@ module Google
979
999
  #
980
1000
  # @param name [::String]
981
1001
  # Required. The resource name of the Answer to get. Format:
982
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
1002
+ # `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
983
1003
  #
984
1004
  # @yield [response, operation] Access the result along with the RPC operation
985
1005
  # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Answer]
@@ -1040,7 +1060,6 @@ module Google
1040
1060
 
1041
1061
  @conversational_search_service_stub.call_rpc :get_answer, request, options: options do |response, operation|
1042
1062
  yield response, operation if block_given?
1043
- return response
1044
1063
  end
1045
1064
  rescue ::GRPC::BadStatus => e
1046
1065
  raise ::Google::Cloud::Error.from_error(e)
@@ -1069,7 +1088,7 @@ module Google
1069
1088
  #
1070
1089
  # @param parent [::String]
1071
1090
  # Required. Full resource name of parent data store. Format:
1072
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
1091
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
1073
1092
  # @param session [::Google::Cloud::DiscoveryEngine::V1beta::Session, ::Hash]
1074
1093
  # Required. The session to create.
1075
1094
  #
@@ -1132,7 +1151,6 @@ module Google
1132
1151
 
1133
1152
  @conversational_search_service_stub.call_rpc :create_session, request, options: options do |response, operation|
1134
1153
  yield response, operation if block_given?
1135
- return response
1136
1154
  end
1137
1155
  rescue ::GRPC::BadStatus => e
1138
1156
  raise ::Google::Cloud::Error.from_error(e)
@@ -1161,7 +1179,7 @@ module Google
1161
1179
  #
1162
1180
  # @param name [::String]
1163
1181
  # Required. The resource name of the Session to delete. Format:
1164
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1182
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1165
1183
  #
1166
1184
  # @yield [response, operation] Access the result along with the RPC operation
1167
1185
  # @yieldparam response [::Google::Protobuf::Empty]
@@ -1222,7 +1240,6 @@ module Google
1222
1240
 
1223
1241
  @conversational_search_service_stub.call_rpc :delete_session, request, options: options do |response, operation|
1224
1242
  yield response, operation if block_given?
1225
- return response
1226
1243
  end
1227
1244
  rescue ::GRPC::BadStatus => e
1228
1245
  raise ::Google::Cloud::Error.from_error(e)
@@ -1320,7 +1337,6 @@ module Google
1320
1337
 
1321
1338
  @conversational_search_service_stub.call_rpc :update_session, request, options: options do |response, operation|
1322
1339
  yield response, operation if block_given?
1323
- return response
1324
1340
  end
1325
1341
  rescue ::GRPC::BadStatus => e
1326
1342
  raise ::Google::Cloud::Error.from_error(e)
@@ -1346,7 +1362,7 @@ module Google
1346
1362
  #
1347
1363
  # @param name [::String]
1348
1364
  # Required. The resource name of the Session to get. Format:
1349
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1365
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
1350
1366
  #
1351
1367
  # @yield [response, operation] Access the result along with the RPC operation
1352
1368
  # @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Session]
@@ -1407,7 +1423,6 @@ module Google
1407
1423
 
1408
1424
  @conversational_search_service_stub.call_rpc :get_session, request, options: options do |response, operation|
1409
1425
  yield response, operation if block_given?
1410
- return response
1411
1426
  end
1412
1427
  rescue ::GRPC::BadStatus => e
1413
1428
  raise ::Google::Cloud::Error.from_error(e)
@@ -1434,7 +1449,7 @@ module Google
1434
1449
  #
1435
1450
  # @param parent [::String]
1436
1451
  # Required. The data store resource name. Format:
1437
- # `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
1452
+ # `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
1438
1453
  # @param page_size [::Integer]
1439
1454
  # Maximum number of results to return. If unspecified, defaults
1440
1455
  # to 50. Max allowed value is 1000.
@@ -1523,7 +1538,7 @@ module Google
1523
1538
  @conversational_search_service_stub.call_rpc :list_sessions, request, options: options do |response, operation|
1524
1539
  response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, request, response, operation, options
1525
1540
  yield response, operation if block_given?
1526
- return response
1541
+ throw :response, response
1527
1542
  end
1528
1543
  rescue ::GRPC::BadStatus => e
1529
1544
  raise ::Google::Cloud::Error.from_error(e)
@@ -1612,6 +1627,11 @@ module Google
1612
1627
  # default endpoint URL. The default value of nil uses the environment
1613
1628
  # universe (usually the default "googleapis.com" universe).
1614
1629
  # @return [::String,nil]
1630
+ # @!attribute [rw] logger
1631
+ # A custom logger to use for request/response debug logging, or the value
1632
+ # `:default` (the default) to construct a default logger, or `nil` to
1633
+ # explicitly disable logging.
1634
+ # @return [::Logger,:default,nil]
1615
1635
  #
1616
1636
  class Configuration
1617
1637
  extend ::Gapic::Config
@@ -1636,6 +1656,7 @@ module Google
1636
1656
  config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1637
1657
  config_attr :quota_project, nil, ::String, nil
1638
1658
  config_attr :universe_domain, nil, ::String, nil
1659
+ config_attr :logger, :default, ::Logger, nil, :default
1639
1660
 
1640
1661
  # @private
1641
1662
  def initialize parent_config = nil