google-cloud-dialogflow-v2 0.27.0 → 0.29.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/google/cloud/dialogflow/v2/agents/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/agents/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/agents/rest/client.rb +176 -0
- data/lib/google/cloud/dialogflow/v2/agents/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/answer_record_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/v2/answer_records/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/answer_records/paths.rb +126 -0
- data/lib/google/cloud/dialogflow/v2/answer_records/rest/client.rb +36 -0
- data/lib/google/cloud/dialogflow/v2/audio_config_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/contexts/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/contexts/rest/client.rb +100 -0
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/client.rb +105 -0
- data/lib/google/cloud/dialogflow/v2/conversation_datasets/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/conversation_models/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/conversation_models/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/client.rb +187 -0
- data/lib/google/cloud/dialogflow/v2/conversation_models/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/conversation_pb.rb +8 -1
- data/lib/google/cloud/dialogflow/v2/conversation_profile_pb.rb +2 -1
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/client.rb +130 -0
- data/lib/google/cloud/dialogflow/v2/conversation_profiles/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/conversation_services_pb.rb +2 -0
- data/lib/google/cloud/dialogflow/v2/conversations/client.rb +127 -1
- data/lib/google/cloud/dialogflow/v2/conversations/rest/client.rb +230 -0
- data/lib/google/cloud/dialogflow/v2/conversations/rest/service_stub.rb +84 -0
- data/lib/google/cloud/dialogflow/v2/documents/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/documents/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/documents/rest/client.rb +174 -0
- data/lib/google/cloud/dialogflow/v2/documents/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/entity_types/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/client.rb +199 -0
- data/lib/google/cloud/dialogflow/v2/entity_types/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/environments/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/environments/rest/client.rb +104 -0
- data/lib/google/cloud/dialogflow/v2/fulfillments/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/fulfillments/rest/client.rb +32 -0
- data/lib/google/cloud/dialogflow/v2/intents/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/intents/operations.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/intents/rest/client.rb +130 -0
- data/lib/google/cloud/dialogflow/v2/intents/rest/operations.rb +75 -0
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/knowledge_bases/rest/client.rb +84 -0
- data/lib/google/cloud/dialogflow/v2/participant_pb.rb +4 -1
- data/lib/google/cloud/dialogflow/v2/participants/client.rb +13 -2
- data/lib/google/cloud/dialogflow/v2/participants/rest/client.rb +135 -1
- data/lib/google/cloud/dialogflow/v2/session_entity_types/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/session_entity_types/rest/client.rb +84 -0
- data/lib/google/cloud/dialogflow/v2/session_pb.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/sessions/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/sessions/rest/client.rb +16 -0
- data/lib/google/cloud/dialogflow/v2/version.rb +1 -1
- data/lib/google/cloud/dialogflow/v2/versions/client.rb +10 -1
- data/lib/google/cloud/dialogflow/v2/versions/rest/client.rb +84 -0
- data/proto_docs/google/api/field_behavior.rb +14 -0
- data/proto_docs/google/cloud/dialogflow/v2/answer_record.rb +25 -0
- data/proto_docs/google/cloud/dialogflow/v2/audio_config.rb +4 -0
- data/proto_docs/google/cloud/dialogflow/v2/conversation.rb +99 -0
- data/proto_docs/google/cloud/dialogflow/v2/conversation_profile.rb +26 -1
- data/proto_docs/google/cloud/dialogflow/v2/participant.rb +53 -1
- data/proto_docs/google/cloud/dialogflow/v2/session.rb +4 -1
- metadata +5 -5
@@ -202,6 +202,26 @@ module Google
|
|
202
202
|
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Dialogflow::V2::ConversationProfile>]
|
203
203
|
#
|
204
204
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
205
|
+
#
|
206
|
+
# @example Basic example
|
207
|
+
# require "google/cloud/dialogflow/v2"
|
208
|
+
#
|
209
|
+
# # Create a client object. The client can be reused for multiple calls.
|
210
|
+
# client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new
|
211
|
+
#
|
212
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
213
|
+
# request = Google::Cloud::Dialogflow::V2::ListConversationProfilesRequest.new
|
214
|
+
#
|
215
|
+
# # Call the list_conversation_profiles method.
|
216
|
+
# result = client.list_conversation_profiles request
|
217
|
+
#
|
218
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
219
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
220
|
+
# result.each do |item|
|
221
|
+
# # Each element is of type ::Google::Cloud::Dialogflow::V2::ConversationProfile.
|
222
|
+
# p item
|
223
|
+
# end
|
224
|
+
#
|
205
225
|
def list_conversation_profiles request, options = nil
|
206
226
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
207
227
|
|
@@ -267,6 +287,22 @@ module Google
|
|
267
287
|
# @return [::Google::Cloud::Dialogflow::V2::ConversationProfile]
|
268
288
|
#
|
269
289
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
290
|
+
#
|
291
|
+
# @example Basic example
|
292
|
+
# require "google/cloud/dialogflow/v2"
|
293
|
+
#
|
294
|
+
# # Create a client object. The client can be reused for multiple calls.
|
295
|
+
# client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new
|
296
|
+
#
|
297
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
298
|
+
# request = Google::Cloud::Dialogflow::V2::GetConversationProfileRequest.new
|
299
|
+
#
|
300
|
+
# # Call the get_conversation_profile method.
|
301
|
+
# result = client.get_conversation_profile request
|
302
|
+
#
|
303
|
+
# # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile.
|
304
|
+
# p result
|
305
|
+
#
|
270
306
|
def get_conversation_profile request, options = nil
|
271
307
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
272
308
|
|
@@ -337,6 +373,22 @@ module Google
|
|
337
373
|
# @return [::Google::Cloud::Dialogflow::V2::ConversationProfile]
|
338
374
|
#
|
339
375
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
376
|
+
#
|
377
|
+
# @example Basic example
|
378
|
+
# require "google/cloud/dialogflow/v2"
|
379
|
+
#
|
380
|
+
# # Create a client object. The client can be reused for multiple calls.
|
381
|
+
# client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new
|
382
|
+
#
|
383
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
384
|
+
# request = Google::Cloud::Dialogflow::V2::CreateConversationProfileRequest.new
|
385
|
+
#
|
386
|
+
# # Call the create_conversation_profile method.
|
387
|
+
# result = client.create_conversation_profile request
|
388
|
+
#
|
389
|
+
# # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile.
|
390
|
+
# p result
|
391
|
+
#
|
340
392
|
def create_conversation_profile request, options = nil
|
341
393
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
342
394
|
|
@@ -406,6 +458,22 @@ module Google
|
|
406
458
|
# @return [::Google::Cloud::Dialogflow::V2::ConversationProfile]
|
407
459
|
#
|
408
460
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
461
|
+
#
|
462
|
+
# @example Basic example
|
463
|
+
# require "google/cloud/dialogflow/v2"
|
464
|
+
#
|
465
|
+
# # Create a client object. The client can be reused for multiple calls.
|
466
|
+
# client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new
|
467
|
+
#
|
468
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
469
|
+
# request = Google::Cloud::Dialogflow::V2::UpdateConversationProfileRequest.new
|
470
|
+
#
|
471
|
+
# # Call the update_conversation_profile method.
|
472
|
+
# result = client.update_conversation_profile request
|
473
|
+
#
|
474
|
+
# # The returned object is of type Google::Cloud::Dialogflow::V2::ConversationProfile.
|
475
|
+
# p result
|
476
|
+
#
|
409
477
|
def update_conversation_profile request, options = nil
|
410
478
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
411
479
|
|
@@ -470,6 +538,22 @@ module Google
|
|
470
538
|
# @return [::Google::Protobuf::Empty]
|
471
539
|
#
|
472
540
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
541
|
+
#
|
542
|
+
# @example Basic example
|
543
|
+
# require "google/cloud/dialogflow/v2"
|
544
|
+
#
|
545
|
+
# # Create a client object. The client can be reused for multiple calls.
|
546
|
+
# client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new
|
547
|
+
#
|
548
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
549
|
+
# request = Google::Cloud::Dialogflow::V2::DeleteConversationProfileRequest.new
|
550
|
+
#
|
551
|
+
# # Call the delete_conversation_profile method.
|
552
|
+
# result = client.delete_conversation_profile request
|
553
|
+
#
|
554
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
555
|
+
# p result
|
556
|
+
#
|
473
557
|
def delete_conversation_profile request, options = nil
|
474
558
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
475
559
|
|
@@ -556,6 +640,29 @@ module Google
|
|
556
640
|
# @return [::Gapic::Operation]
|
557
641
|
#
|
558
642
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
643
|
+
#
|
644
|
+
# @example Basic example
|
645
|
+
# require "google/cloud/dialogflow/v2"
|
646
|
+
#
|
647
|
+
# # Create a client object. The client can be reused for multiple calls.
|
648
|
+
# client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new
|
649
|
+
#
|
650
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
651
|
+
# request = Google::Cloud::Dialogflow::V2::SetSuggestionFeatureConfigRequest.new
|
652
|
+
#
|
653
|
+
# # Call the set_suggestion_feature_config method.
|
654
|
+
# result = client.set_suggestion_feature_config request
|
655
|
+
#
|
656
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
657
|
+
# # check the status of an operation, cancel it, or wait for results.
|
658
|
+
# # Here is how to wait for a response.
|
659
|
+
# result.wait_until_done! timeout: 60
|
660
|
+
# if result.response?
|
661
|
+
# p result.response
|
662
|
+
# else
|
663
|
+
# puts "No response received."
|
664
|
+
# end
|
665
|
+
#
|
559
666
|
def set_suggestion_feature_config request, options = nil
|
560
667
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
561
668
|
|
@@ -636,6 +743,29 @@ module Google
|
|
636
743
|
# @return [::Gapic::Operation]
|
637
744
|
#
|
638
745
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
746
|
+
#
|
747
|
+
# @example Basic example
|
748
|
+
# require "google/cloud/dialogflow/v2"
|
749
|
+
#
|
750
|
+
# # Create a client object. The client can be reused for multiple calls.
|
751
|
+
# client = Google::Cloud::Dialogflow::V2::ConversationProfiles::Rest::Client.new
|
752
|
+
#
|
753
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
754
|
+
# request = Google::Cloud::Dialogflow::V2::ClearSuggestionFeatureConfigRequest.new
|
755
|
+
#
|
756
|
+
# # Call the clear_suggestion_feature_config method.
|
757
|
+
# result = client.clear_suggestion_feature_config request
|
758
|
+
#
|
759
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
760
|
+
# # check the status of an operation, cancel it, or wait for results.
|
761
|
+
# # Here is how to wait for a response.
|
762
|
+
# result.wait_until_done! timeout: 60
|
763
|
+
# if result.response?
|
764
|
+
# p result.response
|
765
|
+
# else
|
766
|
+
# puts "No response received."
|
767
|
+
# end
|
768
|
+
#
|
639
769
|
def clear_suggestion_feature_config request, options = nil
|
640
770
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
641
771
|
|
@@ -136,6 +136,26 @@ module Google
|
|
136
136
|
# @return [::Gapic::Operation]
|
137
137
|
#
|
138
138
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
139
|
+
#
|
140
|
+
# @example Basic example
|
141
|
+
# require "google/longrunning"
|
142
|
+
#
|
143
|
+
# # Create a client object. The client can be reused for multiple calls.
|
144
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
145
|
+
#
|
146
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
147
|
+
# request = Google::Longrunning::ListOperationsRequest.new
|
148
|
+
#
|
149
|
+
# # Call the list_operations method.
|
150
|
+
# result = client.list_operations request
|
151
|
+
#
|
152
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
153
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
154
|
+
# result.each do |item|
|
155
|
+
# # Each element is of type ::Google::Longrunning::Operation.
|
156
|
+
# p item
|
157
|
+
# end
|
158
|
+
#
|
139
159
|
def list_operations request, options = nil
|
140
160
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
141
161
|
|
@@ -201,6 +221,29 @@ module Google
|
|
201
221
|
# @return [::Gapic::Operation]
|
202
222
|
#
|
203
223
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
224
|
+
#
|
225
|
+
# @example Basic example
|
226
|
+
# require "google/longrunning"
|
227
|
+
#
|
228
|
+
# # Create a client object. The client can be reused for multiple calls.
|
229
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
230
|
+
#
|
231
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
232
|
+
# request = Google::Longrunning::GetOperationRequest.new
|
233
|
+
#
|
234
|
+
# # Call the get_operation method.
|
235
|
+
# result = client.get_operation request
|
236
|
+
#
|
237
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
238
|
+
# # check the status of an operation, cancel it, or wait for results.
|
239
|
+
# # Here is how to wait for a response.
|
240
|
+
# result.wait_until_done! timeout: 60
|
241
|
+
# if result.response?
|
242
|
+
# p result.response
|
243
|
+
# else
|
244
|
+
# puts "No response received."
|
245
|
+
# end
|
246
|
+
#
|
204
247
|
def get_operation request, options = nil
|
205
248
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
206
249
|
|
@@ -267,6 +310,22 @@ module Google
|
|
267
310
|
# @return [::Google::Protobuf::Empty]
|
268
311
|
#
|
269
312
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
313
|
+
#
|
314
|
+
# @example Basic example
|
315
|
+
# require "google/longrunning"
|
316
|
+
#
|
317
|
+
# # Create a client object. The client can be reused for multiple calls.
|
318
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
319
|
+
#
|
320
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
321
|
+
# request = Google::Longrunning::DeleteOperationRequest.new
|
322
|
+
#
|
323
|
+
# # Call the delete_operation method.
|
324
|
+
# result = client.delete_operation request
|
325
|
+
#
|
326
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
327
|
+
# p result
|
328
|
+
#
|
270
329
|
def delete_operation request, options = nil
|
271
330
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
272
331
|
|
@@ -338,6 +397,22 @@ module Google
|
|
338
397
|
# @return [::Google::Protobuf::Empty]
|
339
398
|
#
|
340
399
|
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
400
|
+
#
|
401
|
+
# @example Basic example
|
402
|
+
# require "google/longrunning"
|
403
|
+
#
|
404
|
+
# # Create a client object. The client can be reused for multiple calls.
|
405
|
+
# client = Google::Longrunning::Operations::Rest::Client.new
|
406
|
+
#
|
407
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
408
|
+
# request = Google::Longrunning::CancelOperationRequest.new
|
409
|
+
#
|
410
|
+
# # Call the cancel_operation method.
|
411
|
+
# result = client.cancel_operation request
|
412
|
+
#
|
413
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
414
|
+
# p result
|
415
|
+
#
|
341
416
|
def cancel_operation request, options = nil
|
342
417
|
raise ::ArgumentError, "request must be provided" if request.nil?
|
343
418
|
|
@@ -76,6 +76,8 @@ module Google
|
|
76
76
|
# Generates and returns a summary for a conversation that does not have a
|
77
77
|
# resource created for it.
|
78
78
|
rpc :GenerateStatelessSummary, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryRequest, ::Google::Cloud::Dialogflow::V2::GenerateStatelessSummaryResponse
|
79
|
+
# Get answers for the given query based on knowledge documents.
|
80
|
+
rpc :SearchKnowledge, ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse
|
79
81
|
end
|
80
82
|
|
81
83
|
Stub = Service.rpc_stub_class
|
@@ -151,7 +151,8 @@ module Google
|
|
151
151
|
credentials: credentials,
|
152
152
|
endpoint: @config.endpoint,
|
153
153
|
channel_args: @config.channel_args,
|
154
|
-
interceptors: @config.interceptors
|
154
|
+
interceptors: @config.interceptors,
|
155
|
+
channel_pool_config: @config.channel_pool
|
155
156
|
)
|
156
157
|
end
|
157
158
|
|
@@ -884,6 +885,116 @@ module Google
|
|
884
885
|
raise ::Google::Cloud::Error.from_error(e)
|
885
886
|
end
|
886
887
|
|
888
|
+
##
|
889
|
+
# Get answers for the given query based on knowledge documents.
|
890
|
+
#
|
891
|
+
# @overload search_knowledge(request, options = nil)
|
892
|
+
# Pass arguments to `search_knowledge` via a request object, either of type
|
893
|
+
# {::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest} or an equivalent Hash.
|
894
|
+
#
|
895
|
+
# @param request [::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest, ::Hash]
|
896
|
+
# A request object representing the call parameters. Required. To specify no
|
897
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
898
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
899
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
900
|
+
#
|
901
|
+
# @overload search_knowledge(parent: nil, query: nil, conversation_profile: nil, session_id: nil, conversation: nil, latest_message: nil)
|
902
|
+
# Pass arguments to `search_knowledge` via keyword arguments. Note that at
|
903
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
904
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
905
|
+
#
|
906
|
+
# @param parent [::String]
|
907
|
+
# The parent resource contains the conversation profile
|
908
|
+
# Format: 'projects/<Project ID>' or `projects/<Project
|
909
|
+
# ID>/locations/<Location ID>`.
|
910
|
+
# @param query [::Google::Cloud::Dialogflow::V2::TextInput, ::Hash]
|
911
|
+
# Required. The natural language text query for knowledge search.
|
912
|
+
# @param conversation_profile [::String]
|
913
|
+
# Required. The conversation profile used to configure the search.
|
914
|
+
# Format: `projects/<Project ID>/locations/<Location
|
915
|
+
# ID>/conversationProfiles/<Conversation Profile ID>`.
|
916
|
+
# @param session_id [::String]
|
917
|
+
# The ID of the search session.
|
918
|
+
# The session_id can be combined with Dialogflow V3 Agent ID retrieved from
|
919
|
+
# conversation profile or on its own to identify a search session. The search
|
920
|
+
# history of the same session will impact the search result. It's up to the
|
921
|
+
# API caller to choose an appropriate `Session ID`. It can be a random number
|
922
|
+
# or some type of session identifiers (preferably hashed). The length must
|
923
|
+
# not exceed 36 characters.
|
924
|
+
# @param conversation [::String]
|
925
|
+
# The conversation (between human agent and end user) where the search
|
926
|
+
# request is triggered. Format: `projects/<Project ID>/locations/<Location
|
927
|
+
# ID>/conversations/<Conversation ID>`.
|
928
|
+
# @param latest_message [::String]
|
929
|
+
# The name of the latest conversation message when the request is
|
930
|
+
# triggered.
|
931
|
+
# Format: `projects/<Project ID>/locations/<Location
|
932
|
+
# ID>/conversations/<Conversation ID>/messages/<Message ID>`.
|
933
|
+
#
|
934
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
935
|
+
# @yieldparam response [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse]
|
936
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
937
|
+
#
|
938
|
+
# @return [::Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse]
|
939
|
+
#
|
940
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
941
|
+
#
|
942
|
+
# @example Basic example
|
943
|
+
# require "google/cloud/dialogflow/v2"
|
944
|
+
#
|
945
|
+
# # Create a client object. The client can be reused for multiple calls.
|
946
|
+
# client = Google::Cloud::Dialogflow::V2::Conversations::Client.new
|
947
|
+
#
|
948
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
949
|
+
# request = Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest.new
|
950
|
+
#
|
951
|
+
# # Call the search_knowledge method.
|
952
|
+
# result = client.search_knowledge request
|
953
|
+
#
|
954
|
+
# # The returned object is of type Google::Cloud::Dialogflow::V2::SearchKnowledgeResponse.
|
955
|
+
# p result
|
956
|
+
#
|
957
|
+
def search_knowledge request, options = nil
|
958
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
959
|
+
|
960
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Dialogflow::V2::SearchKnowledgeRequest
|
961
|
+
|
962
|
+
# Converts hash and nil to an options object
|
963
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
964
|
+
|
965
|
+
# Customize the options with defaults
|
966
|
+
metadata = @config.rpcs.search_knowledge.metadata.to_h
|
967
|
+
|
968
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
969
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
970
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
971
|
+
gapic_version: ::Google::Cloud::Dialogflow::V2::VERSION
|
972
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
973
|
+
|
974
|
+
header_params = {}
|
975
|
+
if request.parent
|
976
|
+
header_params["parent"] = request.parent
|
977
|
+
end
|
978
|
+
|
979
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
980
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
981
|
+
|
982
|
+
options.apply_defaults timeout: @config.rpcs.search_knowledge.timeout,
|
983
|
+
metadata: metadata,
|
984
|
+
retry_policy: @config.rpcs.search_knowledge.retry_policy
|
985
|
+
|
986
|
+
options.apply_defaults timeout: @config.timeout,
|
987
|
+
metadata: @config.metadata,
|
988
|
+
retry_policy: @config.retry_policy
|
989
|
+
|
990
|
+
@conversations_stub.call_rpc :search_knowledge, request, options: options do |response, operation|
|
991
|
+
yield response, operation if block_given?
|
992
|
+
return response
|
993
|
+
end
|
994
|
+
rescue ::GRPC::BadStatus => e
|
995
|
+
raise ::Google::Cloud::Error.from_error(e)
|
996
|
+
end
|
997
|
+
|
887
998
|
##
|
888
999
|
# Configuration class for the Conversations API.
|
889
1000
|
#
|
@@ -1003,6 +1114,14 @@ module Google
|
|
1003
1114
|
end
|
1004
1115
|
end
|
1005
1116
|
|
1117
|
+
##
|
1118
|
+
# Configuration for the channel pool
|
1119
|
+
# @return [::Gapic::ServiceStub::ChannelPool::Configuration]
|
1120
|
+
#
|
1121
|
+
def channel_pool
|
1122
|
+
@channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
|
1123
|
+
end
|
1124
|
+
|
1006
1125
|
##
|
1007
1126
|
# Configuration RPC class for the Conversations API.
|
1008
1127
|
#
|
@@ -1056,6 +1175,11 @@ module Google
|
|
1056
1175
|
# @return [::Gapic::Config::Method]
|
1057
1176
|
#
|
1058
1177
|
attr_reader :generate_stateless_summary
|
1178
|
+
##
|
1179
|
+
# RPC-specific configuration for `search_knowledge`
|
1180
|
+
# @return [::Gapic::Config::Method]
|
1181
|
+
#
|
1182
|
+
attr_reader :search_knowledge
|
1059
1183
|
|
1060
1184
|
# @private
|
1061
1185
|
def initialize parent_rpcs = nil
|
@@ -1073,6 +1197,8 @@ module Google
|
|
1073
1197
|
@suggest_conversation_summary = ::Gapic::Config::Method.new suggest_conversation_summary_config
|
1074
1198
|
generate_stateless_summary_config = parent_rpcs.generate_stateless_summary if parent_rpcs.respond_to? :generate_stateless_summary
|
1075
1199
|
@generate_stateless_summary = ::Gapic::Config::Method.new generate_stateless_summary_config
|
1200
|
+
search_knowledge_config = parent_rpcs.search_knowledge if parent_rpcs.respond_to? :search_knowledge
|
1201
|
+
@search_knowledge = ::Gapic::Config::Method.new search_knowledge_config
|
1076
1202
|
|
1077
1203
|
yield self if block_given?
|
1078
1204
|
end
|