google-cloud-discovery_engine-v1 0.7.0 → 0.8.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/discovery_engine/v1/completion_service/client.rb +9 -3
- data/lib/google/cloud/discovery_engine/v1/completion_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/client.rb +9 -3
- data/lib/google/cloud/discovery_engine/v1/completion_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/control_service/client.rb +875 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/paths.rb +167 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/rest/client.rb +814 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/rest/service_stub.rb +440 -0
- data/lib/google/cloud/discovery_engine/v1/control_service/rest.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/control_service.rb +58 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/client.rb +764 -6
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/paths.rb +199 -0
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/client.rb +715 -6
- data/lib/google/cloud/discovery_engine/v1/conversational_search_service/rest/service_stub.rb +520 -0
- data/lib/google/cloud/discovery_engine/v1/data_store_service/client.rb +15 -7
- data/lib/google/cloud/discovery_engine/v1/data_store_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/data_store_service/paths.rb +45 -0
- data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/client.rb +15 -7
- data/lib/google/cloud/discovery_engine/v1/data_store_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/document_service/client.rb +23 -13
- data/lib/google/cloud/discovery_engine/v1/document_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/client.rb +23 -13
- data/lib/google/cloud/discovery_engine/v1/document_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/client.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/rest/client.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/engine_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/client.rb +471 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/paths.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/client.rb +438 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest/service_stub.rb +129 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/grounded_generation_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/client.rb +485 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/operations.rb +809 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/paths.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest/client.rb +452 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest/operations.rb +1114 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest/service_stub.rb +129 -0
- data/lib/google/cloud/discovery_engine/v1/project_service/rest.rb +54 -0
- data/lib/google/cloud/discovery_engine/v1/project_service.rb +57 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/client.rb +481 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/credentials.rb +47 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/paths.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/rest/client.rb +448 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/rest/service_stub.rb +129 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service/rest.rb +52 -0
- data/lib/google/cloud/discovery_engine/v1/rank_service.rb +55 -0
- data/lib/google/cloud/discovery_engine/v1/recommendation_service/client.rb +24 -19
- data/lib/google/cloud/discovery_engine/v1/recommendation_service/paths.rb +66 -0
- data/lib/google/cloud/discovery_engine/v1/recommendation_service/rest/client.rb +24 -19
- data/lib/google/cloud/discovery_engine/v1/rest.rb +4 -0
- data/lib/google/cloud/discovery_engine/v1/schema_service/client.rb +18 -10
- data/lib/google/cloud/discovery_engine/v1/schema_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/client.rb +18 -10
- data/lib/google/cloud/discovery_engine/v1/schema_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/search_service/client.rb +15 -8
- data/lib/google/cloud/discovery_engine/v1/search_service/rest/client.rb +15 -8
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/client.rb +27 -12
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/client.rb +27 -12
- data/lib/google/cloud/discovery_engine/v1/site_search_engine_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/client.rb +23 -6
- data/lib/google/cloud/discovery_engine/v1/user_event_service/operations.rb +13 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/paths.rb +21 -0
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/client.rb +23 -6
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/operations.rb +28 -5
- data/lib/google/cloud/discovery_engine/v1/user_event_service/rest/service_stub.rb +8 -0
- data/lib/google/cloud/discovery_engine/v1/version.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1.rb +4 -0
- data/lib/google/cloud/discoveryengine/v1/answer_pb.rb +69 -0
- data/lib/google/cloud/discoveryengine/v1/common_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1/control_pb.rb +55 -0
- data/lib/google/cloud/discoveryengine/v1/control_service_pb.rb +57 -0
- data/lib/google/cloud/discoveryengine/v1/control_service_services_pb.rb +69 -0
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_pb.rb +32 -1
- data/lib/google/cloud/discoveryengine/v1/conversational_search_service_services_pb.rb +25 -0
- data/lib/google/cloud/discoveryengine/v1/data_store_pb.rb +3 -1
- data/lib/google/cloud/discoveryengine/v1/document_processing_config_pb.rb +48 -0
- data/lib/google/cloud/discoveryengine/v1/document_service_services_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/engine_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_pb.rb +52 -0
- data/lib/google/cloud/discoveryengine/v1/grounded_generation_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1/grounding_pb.rb +46 -0
- data/lib/google/cloud/discoveryengine/v1/project_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1/project_service_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1/project_service_services_pb.rb +51 -0
- data/lib/google/cloud/discoveryengine/v1/rank_service_pb.rb +49 -0
- data/lib/google/cloud/discoveryengine/v1/rank_service_services_pb.rb +45 -0
- data/lib/google/cloud/discoveryengine/v1/session_pb.rb +50 -0
- data/lib/google/cloud/discoveryengine/v1/site_search_engine_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_service_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1/user_event_service_services_pb.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1/answer.rb +362 -0
- data/proto_docs/google/cloud/discoveryengine/v1/common.rb +16 -0
- data/proto_docs/google/cloud/discoveryengine/v1/control.rb +207 -0
- data/proto_docs/google/cloud/discoveryengine/v1/control_service.rb +126 -0
- data/proto_docs/google/cloud/discoveryengine/v1/conversation.rb +2 -2
- data/proto_docs/google/cloud/discoveryengine/v1/conversational_search_service.rb +485 -0
- data/proto_docs/google/cloud/discoveryengine/v1/data_store.rb +3 -0
- data/proto_docs/google/cloud/discoveryengine/v1/data_store_service.rb +2 -2
- data/proto_docs/google/cloud/discoveryengine/v1/document_processing_config.rb +102 -0
- data/proto_docs/google/cloud/discoveryengine/v1/document_service.rb +5 -5
- data/proto_docs/google/cloud/discoveryengine/v1/engine.rb +3 -3
- data/proto_docs/google/cloud/discoveryengine/v1/grounded_generation_service.rb +144 -0
- data/proto_docs/google/cloud/discoveryengine/v1/grounding.rb +79 -0
- data/proto_docs/google/cloud/discoveryengine/v1/import_config.rb +4 -4
- data/proto_docs/google/cloud/discoveryengine/v1/project.rb +106 -0
- data/proto_docs/google/cloud/discoveryengine/v1/project_service.rb +57 -0
- data/proto_docs/google/cloud/discoveryengine/v1/rank_service.rb +124 -0
- data/proto_docs/google/cloud/discoveryengine/v1/recommendation_service.rb +20 -19
- data/proto_docs/google/cloud/discoveryengine/v1/schema_service.rb +5 -5
- data/proto_docs/google/cloud/discoveryengine/v1/search_service.rb +23 -18
- data/proto_docs/google/cloud/discoveryengine/v1/session.rb +88 -0
- data/proto_docs/google/cloud/discoveryengine/v1/site_search_engine.rb +3 -0
- data/proto_docs/google/cloud/discoveryengine/v1/user_event.rb +24 -3
- data/proto_docs/google/cloud/discoveryengine/v1/user_event_service.rb +13 -1
- metadata +56 -2
@@ -31,6 +31,9 @@ module Google
|
|
31
31
|
# Service for conversational search.
|
32
32
|
#
|
33
33
|
class Client
|
34
|
+
# @private
|
35
|
+
API_VERSION = ""
|
36
|
+
|
34
37
|
# @private
|
35
38
|
DEFAULT_ENDPOINT_TEMPLATE = "discoveryengine.$UNIVERSE_DOMAIN$"
|
36
39
|
|
@@ -293,10 +296,11 @@ module Google
|
|
293
296
|
# Customize the options with defaults
|
294
297
|
metadata = @config.rpcs.converse_conversation.metadata.to_h
|
295
298
|
|
296
|
-
# Set x-goog-api-client
|
299
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
297
300
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
298
301
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
299
302
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
303
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
300
304
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
301
305
|
|
302
306
|
header_params = {}
|
@@ -384,10 +388,11 @@ module Google
|
|
384
388
|
# Customize the options with defaults
|
385
389
|
metadata = @config.rpcs.create_conversation.metadata.to_h
|
386
390
|
|
387
|
-
# Set x-goog-api-client
|
391
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
388
392
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
389
393
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
390
394
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
395
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
391
396
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
392
397
|
|
393
398
|
header_params = {}
|
@@ -473,10 +478,11 @@ module Google
|
|
473
478
|
# Customize the options with defaults
|
474
479
|
metadata = @config.rpcs.delete_conversation.metadata.to_h
|
475
480
|
|
476
|
-
# Set x-goog-api-client
|
481
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
477
482
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
478
483
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
479
484
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
485
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
480
486
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
481
487
|
|
482
488
|
header_params = {}
|
@@ -571,10 +577,11 @@ module Google
|
|
571
577
|
# Customize the options with defaults
|
572
578
|
metadata = @config.rpcs.update_conversation.metadata.to_h
|
573
579
|
|
574
|
-
# Set x-goog-api-client
|
580
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
575
581
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
576
582
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
577
583
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
584
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
578
585
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
579
586
|
|
580
587
|
header_params = {}
|
@@ -657,10 +664,11 @@ module Google
|
|
657
664
|
# Customize the options with defaults
|
658
665
|
metadata = @config.rpcs.get_conversation.metadata.to_h
|
659
666
|
|
660
|
-
# Set x-goog-api-client
|
667
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
661
668
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
662
669
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
663
670
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
671
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
664
672
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
665
673
|
|
666
674
|
header_params = {}
|
@@ -771,10 +779,11 @@ module Google
|
|
771
779
|
# Customize the options with defaults
|
772
780
|
metadata = @config.rpcs.list_conversations.metadata.to_h
|
773
781
|
|
774
|
-
# Set x-goog-api-client
|
782
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
775
783
|
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
776
784
|
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
777
785
|
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
786
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
778
787
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
779
788
|
|
780
789
|
header_params = {}
|
@@ -802,6 +811,706 @@ module Google
|
|
802
811
|
raise ::Google::Cloud::Error.from_error(e)
|
803
812
|
end
|
804
813
|
|
814
|
+
##
|
815
|
+
# Answer query method.
|
816
|
+
#
|
817
|
+
# @overload answer_query(request, options = nil)
|
818
|
+
# Pass arguments to `answer_query` via a request object, either of type
|
819
|
+
# {::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest} or an equivalent Hash.
|
820
|
+
#
|
821
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest, ::Hash]
|
822
|
+
# A request object representing the call parameters. Required. To specify no
|
823
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
824
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
825
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
826
|
+
#
|
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)
|
828
|
+
# Pass arguments to `answer_query` via keyword arguments. Note that at
|
829
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
830
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
831
|
+
#
|
832
|
+
# @param serving_config [::String]
|
833
|
+
# Required. The resource name of the Search serving config, such as
|
834
|
+
# `projects/*/locations/global/collections/default_collection/engines/*/servingConfigs/default_serving_config`,
|
835
|
+
# or
|
836
|
+
# `projects/*/locations/global/collections/default_collection/dataStores/*/servingConfigs/default_serving_config`.
|
837
|
+
# This field is used to identify the serving configuration name, set
|
838
|
+
# of models used to make the search.
|
839
|
+
# @param query [::Google::Cloud::DiscoveryEngine::V1::Query, ::Hash]
|
840
|
+
# Required. Current user query.
|
841
|
+
# @param session [::String]
|
842
|
+
# The session resource name. Not required.
|
843
|
+
#
|
844
|
+
# When session field is not set, the API is in sessionless mode.
|
845
|
+
#
|
846
|
+
# We support auto session mode: users can use the wildcard symbol `-` as
|
847
|
+
# session ID. A new ID will be automatically generated and assigned.
|
848
|
+
# @param safety_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SafetySpec, ::Hash]
|
849
|
+
# Model specification.
|
850
|
+
# @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash]
|
851
|
+
# Related questions specification.
|
852
|
+
# @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::AnswerGenerationSpec, ::Hash]
|
853
|
+
# Answer generation specification.
|
854
|
+
# @param search_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::SearchSpec, ::Hash]
|
855
|
+
# Search specification.
|
856
|
+
# @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash]
|
857
|
+
# Query understanding specification.
|
858
|
+
# @param asynchronous_mode [::Boolean]
|
859
|
+
# Asynchronous mode control.
|
860
|
+
#
|
861
|
+
# If enabled, the response will be returned with answer/session resource
|
862
|
+
# name without final answer. The API users need to do the polling to get
|
863
|
+
# the latest status of answer/session by calling
|
864
|
+
# {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_answer ConversationalSearchService.GetAnswer}
|
865
|
+
# or
|
866
|
+
# {::Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client#get_session ConversationalSearchService.GetSession}
|
867
|
+
# method.
|
868
|
+
# @param user_pseudo_id [::String]
|
869
|
+
# A unique identifier for tracking visitors. For example, this could be
|
870
|
+
# implemented with an HTTP cookie, which should be able to uniquely identify
|
871
|
+
# a visitor on a single device. This unique identifier should not change if
|
872
|
+
# the visitor logs in or out of the website.
|
873
|
+
#
|
874
|
+
# This field should NOT have a fixed value such as `unknown_visitor`.
|
875
|
+
#
|
876
|
+
# The field must be a UTF-8 encoded string with a length limit of 128
|
877
|
+
# characters. Otherwise, an `INVALID_ARGUMENT` error is returned.
|
878
|
+
#
|
879
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
880
|
+
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse]
|
881
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
882
|
+
#
|
883
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse]
|
884
|
+
#
|
885
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
886
|
+
#
|
887
|
+
# @example Basic example
|
888
|
+
# require "google/cloud/discovery_engine/v1"
|
889
|
+
#
|
890
|
+
# # Create a client object. The client can be reused for multiple calls.
|
891
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new
|
892
|
+
#
|
893
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
894
|
+
# request = Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest.new
|
895
|
+
#
|
896
|
+
# # Call the answer_query method.
|
897
|
+
# result = client.answer_query request
|
898
|
+
#
|
899
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::AnswerQueryResponse.
|
900
|
+
# p result
|
901
|
+
#
|
902
|
+
def answer_query request, options = nil
|
903
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
904
|
+
|
905
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::AnswerQueryRequest
|
906
|
+
|
907
|
+
# Converts hash and nil to an options object
|
908
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
909
|
+
|
910
|
+
# Customize the options with defaults
|
911
|
+
metadata = @config.rpcs.answer_query.metadata.to_h
|
912
|
+
|
913
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
914
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
915
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
916
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
917
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
918
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
919
|
+
|
920
|
+
header_params = {}
|
921
|
+
if request.serving_config
|
922
|
+
header_params["serving_config"] = request.serving_config
|
923
|
+
end
|
924
|
+
|
925
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
926
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
927
|
+
|
928
|
+
options.apply_defaults timeout: @config.rpcs.answer_query.timeout,
|
929
|
+
metadata: metadata,
|
930
|
+
retry_policy: @config.rpcs.answer_query.retry_policy
|
931
|
+
|
932
|
+
options.apply_defaults timeout: @config.timeout,
|
933
|
+
metadata: @config.metadata,
|
934
|
+
retry_policy: @config.retry_policy
|
935
|
+
|
936
|
+
@conversational_search_service_stub.call_rpc :answer_query, request, options: options do |response, operation|
|
937
|
+
yield response, operation if block_given?
|
938
|
+
return response
|
939
|
+
end
|
940
|
+
rescue ::GRPC::BadStatus => e
|
941
|
+
raise ::Google::Cloud::Error.from_error(e)
|
942
|
+
end
|
943
|
+
|
944
|
+
##
|
945
|
+
# Gets a Answer.
|
946
|
+
#
|
947
|
+
# @overload get_answer(request, options = nil)
|
948
|
+
# Pass arguments to `get_answer` via a request object, either of type
|
949
|
+
# {::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest} or an equivalent Hash.
|
950
|
+
#
|
951
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest, ::Hash]
|
952
|
+
# A request object representing the call parameters. Required. To specify no
|
953
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
954
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
955
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
956
|
+
#
|
957
|
+
# @overload get_answer(name: nil)
|
958
|
+
# Pass arguments to `get_answer` via keyword arguments. Note that at
|
959
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
960
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
961
|
+
#
|
962
|
+
# @param name [::String]
|
963
|
+
# Required. The resource name of the Answer to get. Format:
|
964
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
|
965
|
+
#
|
966
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
967
|
+
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Answer]
|
968
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
969
|
+
#
|
970
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Answer]
|
971
|
+
#
|
972
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
973
|
+
#
|
974
|
+
# @example Basic example
|
975
|
+
# require "google/cloud/discovery_engine/v1"
|
976
|
+
#
|
977
|
+
# # Create a client object. The client can be reused for multiple calls.
|
978
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new
|
979
|
+
#
|
980
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
981
|
+
# request = Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest.new
|
982
|
+
#
|
983
|
+
# # Call the get_answer method.
|
984
|
+
# result = client.get_answer request
|
985
|
+
#
|
986
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Answer.
|
987
|
+
# p result
|
988
|
+
#
|
989
|
+
def get_answer request, options = nil
|
990
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
991
|
+
|
992
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetAnswerRequest
|
993
|
+
|
994
|
+
# Converts hash and nil to an options object
|
995
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
996
|
+
|
997
|
+
# Customize the options with defaults
|
998
|
+
metadata = @config.rpcs.get_answer.metadata.to_h
|
999
|
+
|
1000
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1001
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1002
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1003
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
1004
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1005
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1006
|
+
|
1007
|
+
header_params = {}
|
1008
|
+
if request.name
|
1009
|
+
header_params["name"] = request.name
|
1010
|
+
end
|
1011
|
+
|
1012
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1013
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1014
|
+
|
1015
|
+
options.apply_defaults timeout: @config.rpcs.get_answer.timeout,
|
1016
|
+
metadata: metadata,
|
1017
|
+
retry_policy: @config.rpcs.get_answer.retry_policy
|
1018
|
+
|
1019
|
+
options.apply_defaults timeout: @config.timeout,
|
1020
|
+
metadata: @config.metadata,
|
1021
|
+
retry_policy: @config.retry_policy
|
1022
|
+
|
1023
|
+
@conversational_search_service_stub.call_rpc :get_answer, request, options: options do |response, operation|
|
1024
|
+
yield response, operation if block_given?
|
1025
|
+
return response
|
1026
|
+
end
|
1027
|
+
rescue ::GRPC::BadStatus => e
|
1028
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1029
|
+
end
|
1030
|
+
|
1031
|
+
##
|
1032
|
+
# Creates a Session.
|
1033
|
+
#
|
1034
|
+
# If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to create already
|
1035
|
+
# exists, an ALREADY_EXISTS error is returned.
|
1036
|
+
#
|
1037
|
+
# @overload create_session(request, options = nil)
|
1038
|
+
# Pass arguments to `create_session` via a request object, either of type
|
1039
|
+
# {::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest} or an equivalent Hash.
|
1040
|
+
#
|
1041
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest, ::Hash]
|
1042
|
+
# A request object representing the call parameters. Required. To specify no
|
1043
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1044
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1045
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1046
|
+
#
|
1047
|
+
# @overload create_session(parent: nil, session: nil)
|
1048
|
+
# Pass arguments to `create_session` via keyword arguments. Note that at
|
1049
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1050
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1051
|
+
#
|
1052
|
+
# @param parent [::String]
|
1053
|
+
# Required. Full resource name of parent data store. Format:
|
1054
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
|
1055
|
+
# @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash]
|
1056
|
+
# Required. The session to create.
|
1057
|
+
#
|
1058
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1059
|
+
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1060
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1061
|
+
#
|
1062
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1063
|
+
#
|
1064
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1065
|
+
#
|
1066
|
+
# @example Basic example
|
1067
|
+
# require "google/cloud/discovery_engine/v1"
|
1068
|
+
#
|
1069
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1070
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new
|
1071
|
+
#
|
1072
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1073
|
+
# request = Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest.new
|
1074
|
+
#
|
1075
|
+
# # Call the create_session method.
|
1076
|
+
# result = client.create_session request
|
1077
|
+
#
|
1078
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
|
1079
|
+
# p result
|
1080
|
+
#
|
1081
|
+
def create_session request, options = nil
|
1082
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1083
|
+
|
1084
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::CreateSessionRequest
|
1085
|
+
|
1086
|
+
# Converts hash and nil to an options object
|
1087
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1088
|
+
|
1089
|
+
# Customize the options with defaults
|
1090
|
+
metadata = @config.rpcs.create_session.metadata.to_h
|
1091
|
+
|
1092
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1093
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1094
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1095
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
1096
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1097
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1098
|
+
|
1099
|
+
header_params = {}
|
1100
|
+
if request.parent
|
1101
|
+
header_params["parent"] = request.parent
|
1102
|
+
end
|
1103
|
+
|
1104
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1105
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1106
|
+
|
1107
|
+
options.apply_defaults timeout: @config.rpcs.create_session.timeout,
|
1108
|
+
metadata: metadata,
|
1109
|
+
retry_policy: @config.rpcs.create_session.retry_policy
|
1110
|
+
|
1111
|
+
options.apply_defaults timeout: @config.timeout,
|
1112
|
+
metadata: @config.metadata,
|
1113
|
+
retry_policy: @config.retry_policy
|
1114
|
+
|
1115
|
+
@conversational_search_service_stub.call_rpc :create_session, request, options: options do |response, operation|
|
1116
|
+
yield response, operation if block_given?
|
1117
|
+
return response
|
1118
|
+
end
|
1119
|
+
rescue ::GRPC::BadStatus => e
|
1120
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1121
|
+
end
|
1122
|
+
|
1123
|
+
##
|
1124
|
+
# Deletes a Session.
|
1125
|
+
#
|
1126
|
+
# If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to delete does
|
1127
|
+
# not exist, a NOT_FOUND error is returned.
|
1128
|
+
#
|
1129
|
+
# @overload delete_session(request, options = nil)
|
1130
|
+
# Pass arguments to `delete_session` via a request object, either of type
|
1131
|
+
# {::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest} or an equivalent Hash.
|
1132
|
+
#
|
1133
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest, ::Hash]
|
1134
|
+
# A request object representing the call parameters. Required. To specify no
|
1135
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1136
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1137
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1138
|
+
#
|
1139
|
+
# @overload delete_session(name: nil)
|
1140
|
+
# Pass arguments to `delete_session` via keyword arguments. Note that at
|
1141
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1142
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1143
|
+
#
|
1144
|
+
# @param name [::String]
|
1145
|
+
# Required. The resource name of the Session to delete. Format:
|
1146
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1147
|
+
#
|
1148
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1149
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
1150
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1151
|
+
#
|
1152
|
+
# @return [::Google::Protobuf::Empty]
|
1153
|
+
#
|
1154
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1155
|
+
#
|
1156
|
+
# @example Basic example
|
1157
|
+
# require "google/cloud/discovery_engine/v1"
|
1158
|
+
#
|
1159
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1160
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new
|
1161
|
+
#
|
1162
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1163
|
+
# request = Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest.new
|
1164
|
+
#
|
1165
|
+
# # Call the delete_session method.
|
1166
|
+
# result = client.delete_session request
|
1167
|
+
#
|
1168
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
1169
|
+
# p result
|
1170
|
+
#
|
1171
|
+
def delete_session request, options = nil
|
1172
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1173
|
+
|
1174
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::DeleteSessionRequest
|
1175
|
+
|
1176
|
+
# Converts hash and nil to an options object
|
1177
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1178
|
+
|
1179
|
+
# Customize the options with defaults
|
1180
|
+
metadata = @config.rpcs.delete_session.metadata.to_h
|
1181
|
+
|
1182
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1183
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1184
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1185
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
1186
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1187
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1188
|
+
|
1189
|
+
header_params = {}
|
1190
|
+
if request.name
|
1191
|
+
header_params["name"] = request.name
|
1192
|
+
end
|
1193
|
+
|
1194
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1195
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1196
|
+
|
1197
|
+
options.apply_defaults timeout: @config.rpcs.delete_session.timeout,
|
1198
|
+
metadata: metadata,
|
1199
|
+
retry_policy: @config.rpcs.delete_session.retry_policy
|
1200
|
+
|
1201
|
+
options.apply_defaults timeout: @config.timeout,
|
1202
|
+
metadata: @config.metadata,
|
1203
|
+
retry_policy: @config.retry_policy
|
1204
|
+
|
1205
|
+
@conversational_search_service_stub.call_rpc :delete_session, request, options: options do |response, operation|
|
1206
|
+
yield response, operation if block_given?
|
1207
|
+
return response
|
1208
|
+
end
|
1209
|
+
rescue ::GRPC::BadStatus => e
|
1210
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1211
|
+
end
|
1212
|
+
|
1213
|
+
##
|
1214
|
+
# Updates a Session.
|
1215
|
+
#
|
1216
|
+
# {::Google::Cloud::DiscoveryEngine::V1::Session Session} action type cannot be
|
1217
|
+
# changed. If the {::Google::Cloud::DiscoveryEngine::V1::Session Session} to
|
1218
|
+
# update does not exist, a NOT_FOUND error is returned.
|
1219
|
+
#
|
1220
|
+
# @overload update_session(request, options = nil)
|
1221
|
+
# Pass arguments to `update_session` via a request object, either of type
|
1222
|
+
# {::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest} or an equivalent Hash.
|
1223
|
+
#
|
1224
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest, ::Hash]
|
1225
|
+
# A request object representing the call parameters. Required. To specify no
|
1226
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1227
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1228
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1229
|
+
#
|
1230
|
+
# @overload update_session(session: nil, update_mask: nil)
|
1231
|
+
# Pass arguments to `update_session` via keyword arguments. Note that at
|
1232
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1233
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1234
|
+
#
|
1235
|
+
# @param session [::Google::Cloud::DiscoveryEngine::V1::Session, ::Hash]
|
1236
|
+
# Required. The Session to update.
|
1237
|
+
# @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
|
1238
|
+
# Indicates which fields in the provided
|
1239
|
+
# {::Google::Cloud::DiscoveryEngine::V1::Session Session} to update. The following
|
1240
|
+
# are NOT supported:
|
1241
|
+
#
|
1242
|
+
# * {::Google::Cloud::DiscoveryEngine::V1::Session#name Session.name}
|
1243
|
+
#
|
1244
|
+
# If not set or empty, all supported fields are updated.
|
1245
|
+
#
|
1246
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1247
|
+
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1248
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1249
|
+
#
|
1250
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1251
|
+
#
|
1252
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1253
|
+
#
|
1254
|
+
# @example Basic example
|
1255
|
+
# require "google/cloud/discovery_engine/v1"
|
1256
|
+
#
|
1257
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1258
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new
|
1259
|
+
#
|
1260
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1261
|
+
# request = Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest.new
|
1262
|
+
#
|
1263
|
+
# # Call the update_session method.
|
1264
|
+
# result = client.update_session request
|
1265
|
+
#
|
1266
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
|
1267
|
+
# p result
|
1268
|
+
#
|
1269
|
+
def update_session request, options = nil
|
1270
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1271
|
+
|
1272
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::UpdateSessionRequest
|
1273
|
+
|
1274
|
+
# Converts hash and nil to an options object
|
1275
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1276
|
+
|
1277
|
+
# Customize the options with defaults
|
1278
|
+
metadata = @config.rpcs.update_session.metadata.to_h
|
1279
|
+
|
1280
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1281
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1282
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1283
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
1284
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1285
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1286
|
+
|
1287
|
+
header_params = {}
|
1288
|
+
if request.session&.name
|
1289
|
+
header_params["session.name"] = request.session.name
|
1290
|
+
end
|
1291
|
+
|
1292
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1293
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1294
|
+
|
1295
|
+
options.apply_defaults timeout: @config.rpcs.update_session.timeout,
|
1296
|
+
metadata: metadata,
|
1297
|
+
retry_policy: @config.rpcs.update_session.retry_policy
|
1298
|
+
|
1299
|
+
options.apply_defaults timeout: @config.timeout,
|
1300
|
+
metadata: @config.metadata,
|
1301
|
+
retry_policy: @config.retry_policy
|
1302
|
+
|
1303
|
+
@conversational_search_service_stub.call_rpc :update_session, request, options: options do |response, operation|
|
1304
|
+
yield response, operation if block_given?
|
1305
|
+
return response
|
1306
|
+
end
|
1307
|
+
rescue ::GRPC::BadStatus => e
|
1308
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1309
|
+
end
|
1310
|
+
|
1311
|
+
##
|
1312
|
+
# Gets a Session.
|
1313
|
+
#
|
1314
|
+
# @overload get_session(request, options = nil)
|
1315
|
+
# Pass arguments to `get_session` via a request object, either of type
|
1316
|
+
# {::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest} or an equivalent Hash.
|
1317
|
+
#
|
1318
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest, ::Hash]
|
1319
|
+
# A request object representing the call parameters. Required. To specify no
|
1320
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1321
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1322
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1323
|
+
#
|
1324
|
+
# @overload get_session(name: nil)
|
1325
|
+
# Pass arguments to `get_session` via keyword arguments. Note that at
|
1326
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1327
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1328
|
+
#
|
1329
|
+
# @param name [::String]
|
1330
|
+
# Required. The resource name of the Session to get. Format:
|
1331
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1332
|
+
#
|
1333
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1334
|
+
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1335
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1336
|
+
#
|
1337
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1::Session]
|
1338
|
+
#
|
1339
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1340
|
+
#
|
1341
|
+
# @example Basic example
|
1342
|
+
# require "google/cloud/discovery_engine/v1"
|
1343
|
+
#
|
1344
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1345
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new
|
1346
|
+
#
|
1347
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1348
|
+
# request = Google::Cloud::DiscoveryEngine::V1::GetSessionRequest.new
|
1349
|
+
#
|
1350
|
+
# # Call the get_session method.
|
1351
|
+
# result = client.get_session request
|
1352
|
+
#
|
1353
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1::Session.
|
1354
|
+
# p result
|
1355
|
+
#
|
1356
|
+
def get_session request, options = nil
|
1357
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1358
|
+
|
1359
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::GetSessionRequest
|
1360
|
+
|
1361
|
+
# Converts hash and nil to an options object
|
1362
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1363
|
+
|
1364
|
+
# Customize the options with defaults
|
1365
|
+
metadata = @config.rpcs.get_session.metadata.to_h
|
1366
|
+
|
1367
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1368
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1369
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1370
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
1371
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1372
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1373
|
+
|
1374
|
+
header_params = {}
|
1375
|
+
if request.name
|
1376
|
+
header_params["name"] = request.name
|
1377
|
+
end
|
1378
|
+
|
1379
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1380
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1381
|
+
|
1382
|
+
options.apply_defaults timeout: @config.rpcs.get_session.timeout,
|
1383
|
+
metadata: metadata,
|
1384
|
+
retry_policy: @config.rpcs.get_session.retry_policy
|
1385
|
+
|
1386
|
+
options.apply_defaults timeout: @config.timeout,
|
1387
|
+
metadata: @config.metadata,
|
1388
|
+
retry_policy: @config.retry_policy
|
1389
|
+
|
1390
|
+
@conversational_search_service_stub.call_rpc :get_session, request, options: options do |response, operation|
|
1391
|
+
yield response, operation if block_given?
|
1392
|
+
return response
|
1393
|
+
end
|
1394
|
+
rescue ::GRPC::BadStatus => e
|
1395
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
##
|
1399
|
+
# Lists all Sessions by their parent
|
1400
|
+
# {::Google::Cloud::DiscoveryEngine::V1::DataStore DataStore}.
|
1401
|
+
#
|
1402
|
+
# @overload list_sessions(request, options = nil)
|
1403
|
+
# Pass arguments to `list_sessions` via a request object, either of type
|
1404
|
+
# {::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest} or an equivalent Hash.
|
1405
|
+
#
|
1406
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest, ::Hash]
|
1407
|
+
# A request object representing the call parameters. Required. To specify no
|
1408
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1409
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1410
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
1411
|
+
#
|
1412
|
+
# @overload list_sessions(parent: nil, page_size: nil, page_token: nil, filter: nil, order_by: nil)
|
1413
|
+
# Pass arguments to `list_sessions` via keyword arguments. Note that at
|
1414
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1415
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1416
|
+
#
|
1417
|
+
# @param parent [::String]
|
1418
|
+
# Required. The data store resource name. Format:
|
1419
|
+
# `projects/{project_number}/locations/{location_id}/collections/{collection}/dataStores/{data_store_id}`
|
1420
|
+
# @param page_size [::Integer]
|
1421
|
+
# Maximum number of results to return. If unspecified, defaults
|
1422
|
+
# to 50. Max allowed value is 1000.
|
1423
|
+
# @param page_token [::String]
|
1424
|
+
# A page token, received from a previous `ListSessions` call.
|
1425
|
+
# Provide this to retrieve the subsequent page.
|
1426
|
+
# @param filter [::String]
|
1427
|
+
# A filter to apply on the list results. The supported features are:
|
1428
|
+
# user_pseudo_id, state.
|
1429
|
+
#
|
1430
|
+
# Example:
|
1431
|
+
# "user_pseudo_id = some_id"
|
1432
|
+
# @param order_by [::String]
|
1433
|
+
# A comma-separated list of fields to order by, sorted in ascending order.
|
1434
|
+
# Use "desc" after a field name for descending.
|
1435
|
+
# Supported fields:
|
1436
|
+
# * `update_time`
|
1437
|
+
# * `create_time`
|
1438
|
+
# * `session_name`
|
1439
|
+
#
|
1440
|
+
# Example:
|
1441
|
+
# "update_time desc"
|
1442
|
+
# "create_time"
|
1443
|
+
#
|
1444
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
1445
|
+
# @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>]
|
1446
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
1447
|
+
#
|
1448
|
+
# @return [::Gapic::PagedEnumerable<::Google::Cloud::DiscoveryEngine::V1::Session>]
|
1449
|
+
#
|
1450
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
1451
|
+
#
|
1452
|
+
# @example Basic example
|
1453
|
+
# require "google/cloud/discovery_engine/v1"
|
1454
|
+
#
|
1455
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1456
|
+
# client = Google::Cloud::DiscoveryEngine::V1::ConversationalSearchService::Client.new
|
1457
|
+
#
|
1458
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1459
|
+
# request = Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest.new
|
1460
|
+
#
|
1461
|
+
# # Call the list_sessions method.
|
1462
|
+
# result = client.list_sessions request
|
1463
|
+
#
|
1464
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
1465
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
1466
|
+
# result.each do |item|
|
1467
|
+
# # Each element is of type ::Google::Cloud::DiscoveryEngine::V1::Session.
|
1468
|
+
# p item
|
1469
|
+
# end
|
1470
|
+
#
|
1471
|
+
def list_sessions request, options = nil
|
1472
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1473
|
+
|
1474
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1::ListSessionsRequest
|
1475
|
+
|
1476
|
+
# Converts hash and nil to an options object
|
1477
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1478
|
+
|
1479
|
+
# Customize the options with defaults
|
1480
|
+
metadata = @config.rpcs.list_sessions.metadata.to_h
|
1481
|
+
|
1482
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1483
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1484
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1485
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1::VERSION
|
1486
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1487
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1488
|
+
|
1489
|
+
header_params = {}
|
1490
|
+
if request.parent
|
1491
|
+
header_params["parent"] = request.parent
|
1492
|
+
end
|
1493
|
+
|
1494
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
1495
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
1496
|
+
|
1497
|
+
options.apply_defaults timeout: @config.rpcs.list_sessions.timeout,
|
1498
|
+
metadata: metadata,
|
1499
|
+
retry_policy: @config.rpcs.list_sessions.retry_policy
|
1500
|
+
|
1501
|
+
options.apply_defaults timeout: @config.timeout,
|
1502
|
+
metadata: @config.metadata,
|
1503
|
+
retry_policy: @config.retry_policy
|
1504
|
+
|
1505
|
+
@conversational_search_service_stub.call_rpc :list_sessions, request, options: options do |response, operation|
|
1506
|
+
response = ::Gapic::PagedEnumerable.new @conversational_search_service_stub, :list_sessions, request, response, operation, options
|
1507
|
+
yield response, operation if block_given?
|
1508
|
+
return response
|
1509
|
+
end
|
1510
|
+
rescue ::GRPC::BadStatus => e
|
1511
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1512
|
+
end
|
1513
|
+
|
805
1514
|
##
|
806
1515
|
# Configuration class for the ConversationalSearchService API.
|
807
1516
|
#
|
@@ -985,6 +1694,41 @@ module Google
|
|
985
1694
|
# @return [::Gapic::Config::Method]
|
986
1695
|
#
|
987
1696
|
attr_reader :list_conversations
|
1697
|
+
##
|
1698
|
+
# RPC-specific configuration for `answer_query`
|
1699
|
+
# @return [::Gapic::Config::Method]
|
1700
|
+
#
|
1701
|
+
attr_reader :answer_query
|
1702
|
+
##
|
1703
|
+
# RPC-specific configuration for `get_answer`
|
1704
|
+
# @return [::Gapic::Config::Method]
|
1705
|
+
#
|
1706
|
+
attr_reader :get_answer
|
1707
|
+
##
|
1708
|
+
# RPC-specific configuration for `create_session`
|
1709
|
+
# @return [::Gapic::Config::Method]
|
1710
|
+
#
|
1711
|
+
attr_reader :create_session
|
1712
|
+
##
|
1713
|
+
# RPC-specific configuration for `delete_session`
|
1714
|
+
# @return [::Gapic::Config::Method]
|
1715
|
+
#
|
1716
|
+
attr_reader :delete_session
|
1717
|
+
##
|
1718
|
+
# RPC-specific configuration for `update_session`
|
1719
|
+
# @return [::Gapic::Config::Method]
|
1720
|
+
#
|
1721
|
+
attr_reader :update_session
|
1722
|
+
##
|
1723
|
+
# RPC-specific configuration for `get_session`
|
1724
|
+
# @return [::Gapic::Config::Method]
|
1725
|
+
#
|
1726
|
+
attr_reader :get_session
|
1727
|
+
##
|
1728
|
+
# RPC-specific configuration for `list_sessions`
|
1729
|
+
# @return [::Gapic::Config::Method]
|
1730
|
+
#
|
1731
|
+
attr_reader :list_sessions
|
988
1732
|
|
989
1733
|
# @private
|
990
1734
|
def initialize parent_rpcs = nil
|
@@ -1000,6 +1744,20 @@ module Google
|
|
1000
1744
|
@get_conversation = ::Gapic::Config::Method.new get_conversation_config
|
1001
1745
|
list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations
|
1002
1746
|
@list_conversations = ::Gapic::Config::Method.new list_conversations_config
|
1747
|
+
answer_query_config = parent_rpcs.answer_query if parent_rpcs.respond_to? :answer_query
|
1748
|
+
@answer_query = ::Gapic::Config::Method.new answer_query_config
|
1749
|
+
get_answer_config = parent_rpcs.get_answer if parent_rpcs.respond_to? :get_answer
|
1750
|
+
@get_answer = ::Gapic::Config::Method.new get_answer_config
|
1751
|
+
create_session_config = parent_rpcs.create_session if parent_rpcs.respond_to? :create_session
|
1752
|
+
@create_session = ::Gapic::Config::Method.new create_session_config
|
1753
|
+
delete_session_config = parent_rpcs.delete_session if parent_rpcs.respond_to? :delete_session
|
1754
|
+
@delete_session = ::Gapic::Config::Method.new delete_session_config
|
1755
|
+
update_session_config = parent_rpcs.update_session if parent_rpcs.respond_to? :update_session
|
1756
|
+
@update_session = ::Gapic::Config::Method.new update_session_config
|
1757
|
+
get_session_config = parent_rpcs.get_session if parent_rpcs.respond_to? :get_session
|
1758
|
+
@get_session = ::Gapic::Config::Method.new get_session_config
|
1759
|
+
list_sessions_config = parent_rpcs.list_sessions if parent_rpcs.respond_to? :list_sessions
|
1760
|
+
@list_sessions = ::Gapic::Config::Method.new list_sessions_config
|
1003
1761
|
|
1004
1762
|
yield self if block_given?
|
1005
1763
|
end
|