google-cloud-gemini_data_analytics-v1beta 0.3.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/client.rb +1 -1
- data/lib/google/cloud/gemini_data_analytics/v1beta/data_agent_service/rest/client.rb +1 -1
- data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/client.rb +208 -6
- data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/rest/client.rb +194 -6
- data/lib/google/cloud/gemini_data_analytics/v1beta/data_chat_service/rest/service_stub.rb +123 -0
- data/lib/google/cloud/gemini_data_analytics/v1beta/version.rb +1 -1
- data/lib/google/cloud/geminidataanalytics/v1beta/agent_context_pb.rb +44 -0
- data/lib/google/cloud/geminidataanalytics/v1beta/context_pb.rb +8 -1
- data/lib/google/cloud/geminidataanalytics/v1beta/conversation_pb.rb +2 -1
- data/lib/google/cloud/geminidataanalytics/v1beta/data_chat_service_pb.rb +14 -2
- data/lib/google/cloud/geminidataanalytics/v1beta/data_chat_service_services_pb.rb +4 -0
- data/lib/google/cloud/geminidataanalytics/v1beta/datasource_pb.rb +13 -1
- data/proto_docs/google/cloud/geminidataanalytics/v1beta/agent_context.rb +35 -0
- data/proto_docs/google/cloud/geminidataanalytics/v1beta/context.rb +100 -2
- data/proto_docs/google/cloud/geminidataanalytics/v1beta/conversation.rb +13 -2
- data/proto_docs/google/cloud/geminidataanalytics/v1beta/data_agent.rb +1 -1
- data/proto_docs/google/cloud/geminidataanalytics/v1beta/data_chat_service.rb +236 -10
- data/proto_docs/google/cloud/geminidataanalytics/v1beta/datasource.rb +188 -11
- data/proto_docs/google/protobuf/wrappers.rb +121 -0
- metadata +4 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1a9447d0889a80ad09f1986cb668dd16ca1c6a08a6a9ded2df2693de58a0174e
|
|
4
|
+
data.tar.gz: babc6a47fa8934dcdb6f7d76affc696f8096b2dd4db393dc51dd496bb874f956
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4764d0385193c5b52f82dd5827ba5ea30059a8b0db054902e540c8721098cae325942eaec9e240e21e7c5cc82f5187c5f73231dd8cfd31e59691fc323e1972bd
|
|
7
|
+
data.tar.gz: 11aab4e5c8d49b5540b1a7bcbed510be1c959f8503160e328da290c36f272060465d5f0c4fae3848a25239298be60344d7edc01bcfdafb3ec0f4520afad34f7f
|
|
@@ -71,7 +71,7 @@ module Google
|
|
|
71
71
|
end
|
|
72
72
|
default_config = Client::Configuration.new parent_config
|
|
73
73
|
|
|
74
|
-
default_config.timeout =
|
|
74
|
+
default_config.timeout = 600.0
|
|
75
75
|
default_config.retry_policy = {
|
|
76
76
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
77
77
|
}
|
|
@@ -73,7 +73,7 @@ module Google
|
|
|
73
73
|
end
|
|
74
74
|
default_config = Client::Configuration.new parent_config
|
|
75
75
|
|
|
76
|
-
default_config.timeout =
|
|
76
|
+
default_config.timeout = 600.0
|
|
77
77
|
default_config.retry_policy = {
|
|
78
78
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
79
79
|
}
|
|
@@ -73,7 +73,7 @@ module Google
|
|
|
73
73
|
end
|
|
74
74
|
default_config = Client::Configuration.new parent_config
|
|
75
75
|
|
|
76
|
-
default_config.timeout =
|
|
76
|
+
default_config.timeout = 600.0
|
|
77
77
|
default_config.retry_policy = {
|
|
78
78
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
79
79
|
}
|
|
@@ -220,7 +220,7 @@ module Google
|
|
|
220
220
|
# @param options [::Gapic::CallOptions, ::Hash]
|
|
221
221
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
222
222
|
#
|
|
223
|
-
# @overload chat(inline_context: nil, conversation_reference: nil, data_agent_context: nil, project: nil, parent: nil, messages: nil)
|
|
223
|
+
# @overload chat(inline_context: nil, conversation_reference: nil, data_agent_context: nil, client_managed_resource_context: nil, project: nil, parent: nil, messages: nil)
|
|
224
224
|
# Pass arguments to `chat` via keyword arguments. Note that at
|
|
225
225
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
226
226
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
@@ -230,17 +230,24 @@ module Google
|
|
|
230
230
|
# statelessly (without managed conversation persistence and without an
|
|
231
231
|
# Agent) by passing all context inline.
|
|
232
232
|
#
|
|
233
|
-
# Note: The following parameters are mutually exclusive: `inline_context`, `conversation_reference`, `data_agent_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
233
|
+
# Note: The following parameters are mutually exclusive: `inline_context`, `conversation_reference`, `data_agent_context`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
234
234
|
# @param conversation_reference [::Google::Cloud::GeminiDataAnalytics::V1beta::ConversationReference, ::Hash]
|
|
235
235
|
# Optional. Reference to a persisted conversation and agent context.
|
|
236
236
|
# Use this to chat with an Agent using managed conversation persistence.
|
|
237
237
|
#
|
|
238
|
-
# Note: The following parameters are mutually exclusive: `conversation_reference`, `inline_context`, `data_agent_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
238
|
+
# Note: The following parameters are mutually exclusive: `conversation_reference`, `inline_context`, `data_agent_context`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
239
239
|
# @param data_agent_context [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentContext, ::Hash]
|
|
240
240
|
# Optional. Context for the chat request. Use this to chat with an Agent
|
|
241
241
|
# statelessly, without managed conversation persistence.
|
|
242
242
|
#
|
|
243
|
-
# Note: The following parameters are mutually exclusive: `data_agent_context`, `inline_context`, `conversation_reference`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
243
|
+
# Note: The following parameters are mutually exclusive: `data_agent_context`, `inline_context`, `conversation_reference`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
244
|
+
# @param client_managed_resource_context [::Google::Cloud::GeminiDataAnalytics::V1beta::ClientManagedResourceContext, ::Hash]
|
|
245
|
+
# Optional. Context with client managed resources.
|
|
246
|
+
# Some clients may not use GDA managed resources including
|
|
247
|
+
# conversations and agents, instead they create and manage their own
|
|
248
|
+
# conversations and agents resources.
|
|
249
|
+
#
|
|
250
|
+
# Note: The following parameters are mutually exclusive: `client_managed_resource_context`, `inline_context`, `conversation_reference`, `data_agent_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
244
251
|
# @param project [::String]
|
|
245
252
|
# Optional. The Google Cloud project to be used for quota and billing.
|
|
246
253
|
# @param parent [::String]
|
|
@@ -415,6 +422,93 @@ module Google
|
|
|
415
422
|
raise ::Google::Cloud::Error.from_error(e)
|
|
416
423
|
end
|
|
417
424
|
|
|
425
|
+
##
|
|
426
|
+
# Deletes a conversation.
|
|
427
|
+
#
|
|
428
|
+
# @overload delete_conversation(request, options = nil)
|
|
429
|
+
# Pass arguments to `delete_conversation` via a request object, either of type
|
|
430
|
+
# {::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest} or an equivalent Hash.
|
|
431
|
+
#
|
|
432
|
+
# @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest, ::Hash]
|
|
433
|
+
# A request object representing the call parameters. Required. To specify no
|
|
434
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
435
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
436
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
437
|
+
#
|
|
438
|
+
# @overload delete_conversation(name: nil)
|
|
439
|
+
# Pass arguments to `delete_conversation` via keyword arguments. Note that at
|
|
440
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
441
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
442
|
+
#
|
|
443
|
+
# @param name [::String]
|
|
444
|
+
# Required. Name of the resource.
|
|
445
|
+
# Format:
|
|
446
|
+
# `projects/{project}/locations/{location}/conversations/{conversation}`
|
|
447
|
+
#
|
|
448
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
449
|
+
# @yieldparam response [::Google::Protobuf::Empty]
|
|
450
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
451
|
+
#
|
|
452
|
+
# @return [::Google::Protobuf::Empty]
|
|
453
|
+
#
|
|
454
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
455
|
+
#
|
|
456
|
+
# @example Basic example
|
|
457
|
+
# require "google/cloud/gemini_data_analytics/v1beta"
|
|
458
|
+
#
|
|
459
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
460
|
+
# client = Google::Cloud::GeminiDataAnalytics::V1beta::DataChatService::Client.new
|
|
461
|
+
#
|
|
462
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
463
|
+
# request = Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest.new
|
|
464
|
+
#
|
|
465
|
+
# # Call the delete_conversation method.
|
|
466
|
+
# result = client.delete_conversation request
|
|
467
|
+
#
|
|
468
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
|
469
|
+
# p result
|
|
470
|
+
#
|
|
471
|
+
def delete_conversation request, options = nil
|
|
472
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
473
|
+
|
|
474
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest
|
|
475
|
+
|
|
476
|
+
# Converts hash and nil to an options object
|
|
477
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
478
|
+
|
|
479
|
+
# Customize the options with defaults
|
|
480
|
+
metadata = @config.rpcs.delete_conversation.metadata.to_h
|
|
481
|
+
|
|
482
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
483
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
484
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
485
|
+
gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION
|
|
486
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
487
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
488
|
+
|
|
489
|
+
header_params = {}
|
|
490
|
+
if request.name
|
|
491
|
+
header_params["name"] = request.name
|
|
492
|
+
end
|
|
493
|
+
|
|
494
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
495
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
496
|
+
|
|
497
|
+
options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout,
|
|
498
|
+
metadata: metadata,
|
|
499
|
+
retry_policy: @config.rpcs.delete_conversation.retry_policy
|
|
500
|
+
|
|
501
|
+
options.apply_defaults timeout: @config.timeout,
|
|
502
|
+
metadata: @config.metadata,
|
|
503
|
+
retry_policy: @config.retry_policy
|
|
504
|
+
|
|
505
|
+
@data_chat_service_stub.call_rpc :delete_conversation, request, options: options do |response, operation|
|
|
506
|
+
yield response, operation if block_given?
|
|
507
|
+
end
|
|
508
|
+
rescue ::GRPC::BadStatus => e
|
|
509
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
510
|
+
end
|
|
511
|
+
|
|
418
512
|
##
|
|
419
513
|
# Gets details of a single conversation by using conversation id and parent.
|
|
420
514
|
#
|
|
@@ -532,7 +626,7 @@ module Google
|
|
|
532
626
|
# @param filter [::String]
|
|
533
627
|
# Optional. Returned conversations will match criteria specified within the
|
|
534
628
|
# filter. ListConversations allows filtering by:
|
|
535
|
-
# *
|
|
629
|
+
# * agents
|
|
536
630
|
# * labels
|
|
537
631
|
#
|
|
538
632
|
# @yield [response, operation] Access the result along with the RPC operation
|
|
@@ -711,6 +805,100 @@ module Google
|
|
|
711
805
|
raise ::Google::Cloud::Error.from_error(e)
|
|
712
806
|
end
|
|
713
807
|
|
|
808
|
+
##
|
|
809
|
+
# Queries data from a natural language user query.
|
|
810
|
+
#
|
|
811
|
+
# @overload query_data(request, options = nil)
|
|
812
|
+
# Pass arguments to `query_data` via a request object, either of type
|
|
813
|
+
# {::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest} or an equivalent Hash.
|
|
814
|
+
#
|
|
815
|
+
# @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest, ::Hash]
|
|
816
|
+
# A request object representing the call parameters. Required. To specify no
|
|
817
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
818
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
819
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
|
820
|
+
#
|
|
821
|
+
# @overload query_data(parent: nil, prompt: nil, context: nil, generation_options: nil)
|
|
822
|
+
# Pass arguments to `query_data` via keyword arguments. Note that at
|
|
823
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
824
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
825
|
+
#
|
|
826
|
+
# @param parent [::String]
|
|
827
|
+
# Required. The parent resource to generate the query for.
|
|
828
|
+
# Format: projects/\\{project}/locations/\\{location}
|
|
829
|
+
# @param prompt [::String]
|
|
830
|
+
# Required. The natural language query for which to generate query.
|
|
831
|
+
# Example: "What are the top 5 best selling products this month?"
|
|
832
|
+
# @param context [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataContext, ::Hash]
|
|
833
|
+
# Required. The context for the data query, including the data sources to
|
|
834
|
+
# use.
|
|
835
|
+
# @param generation_options [::Google::Cloud::GeminiDataAnalytics::V1beta::GenerationOptions, ::Hash]
|
|
836
|
+
# Optional. Options to control query generation and execution behavior.
|
|
837
|
+
#
|
|
838
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
|
839
|
+
# @yieldparam response [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataResponse]
|
|
840
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
|
841
|
+
#
|
|
842
|
+
# @return [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataResponse]
|
|
843
|
+
#
|
|
844
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
|
845
|
+
#
|
|
846
|
+
# @example Basic example
|
|
847
|
+
# require "google/cloud/gemini_data_analytics/v1beta"
|
|
848
|
+
#
|
|
849
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
850
|
+
# client = Google::Cloud::GeminiDataAnalytics::V1beta::DataChatService::Client.new
|
|
851
|
+
#
|
|
852
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
853
|
+
# request = Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest.new
|
|
854
|
+
#
|
|
855
|
+
# # Call the query_data method.
|
|
856
|
+
# result = client.query_data request
|
|
857
|
+
#
|
|
858
|
+
# # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataResponse.
|
|
859
|
+
# p result
|
|
860
|
+
#
|
|
861
|
+
def query_data request, options = nil
|
|
862
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
863
|
+
|
|
864
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest
|
|
865
|
+
|
|
866
|
+
# Converts hash and nil to an options object
|
|
867
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
868
|
+
|
|
869
|
+
# Customize the options with defaults
|
|
870
|
+
metadata = @config.rpcs.query_data.metadata.to_h
|
|
871
|
+
|
|
872
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
873
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
874
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
875
|
+
gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION
|
|
876
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
877
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
878
|
+
|
|
879
|
+
header_params = {}
|
|
880
|
+
if request.parent
|
|
881
|
+
header_params["parent"] = request.parent
|
|
882
|
+
end
|
|
883
|
+
|
|
884
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
|
885
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
|
886
|
+
|
|
887
|
+
options.apply_defaults timeout: @config.rpcs.query_data.timeout,
|
|
888
|
+
metadata: metadata,
|
|
889
|
+
retry_policy: @config.rpcs.query_data.retry_policy
|
|
890
|
+
|
|
891
|
+
options.apply_defaults timeout: @config.timeout,
|
|
892
|
+
metadata: @config.metadata,
|
|
893
|
+
retry_policy: @config.retry_policy
|
|
894
|
+
|
|
895
|
+
@data_chat_service_stub.call_rpc :query_data, request, options: options do |response, operation|
|
|
896
|
+
yield response, operation if block_given?
|
|
897
|
+
end
|
|
898
|
+
rescue ::GRPC::BadStatus => e
|
|
899
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
900
|
+
end
|
|
901
|
+
|
|
714
902
|
##
|
|
715
903
|
# Configuration class for the DataChatService API.
|
|
716
904
|
#
|
|
@@ -905,6 +1093,11 @@ module Google
|
|
|
905
1093
|
#
|
|
906
1094
|
attr_reader :create_conversation
|
|
907
1095
|
##
|
|
1096
|
+
# RPC-specific configuration for `delete_conversation`
|
|
1097
|
+
# @return [::Gapic::Config::Method]
|
|
1098
|
+
#
|
|
1099
|
+
attr_reader :delete_conversation
|
|
1100
|
+
##
|
|
908
1101
|
# RPC-specific configuration for `get_conversation`
|
|
909
1102
|
# @return [::Gapic::Config::Method]
|
|
910
1103
|
#
|
|
@@ -919,6 +1112,11 @@ module Google
|
|
|
919
1112
|
# @return [::Gapic::Config::Method]
|
|
920
1113
|
#
|
|
921
1114
|
attr_reader :list_messages
|
|
1115
|
+
##
|
|
1116
|
+
# RPC-specific configuration for `query_data`
|
|
1117
|
+
# @return [::Gapic::Config::Method]
|
|
1118
|
+
#
|
|
1119
|
+
attr_reader :query_data
|
|
922
1120
|
|
|
923
1121
|
# @private
|
|
924
1122
|
def initialize parent_rpcs = nil
|
|
@@ -926,12 +1124,16 @@ module Google
|
|
|
926
1124
|
@chat = ::Gapic::Config::Method.new chat_config
|
|
927
1125
|
create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation
|
|
928
1126
|
@create_conversation = ::Gapic::Config::Method.new create_conversation_config
|
|
1127
|
+
delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation
|
|
1128
|
+
@delete_conversation = ::Gapic::Config::Method.new delete_conversation_config
|
|
929
1129
|
get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation
|
|
930
1130
|
@get_conversation = ::Gapic::Config::Method.new get_conversation_config
|
|
931
1131
|
list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations
|
|
932
1132
|
@list_conversations = ::Gapic::Config::Method.new list_conversations_config
|
|
933
1133
|
list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages
|
|
934
1134
|
@list_messages = ::Gapic::Config::Method.new list_messages_config
|
|
1135
|
+
query_data_config = parent_rpcs.query_data if parent_rpcs.respond_to? :query_data
|
|
1136
|
+
@query_data = ::Gapic::Config::Method.new query_data_config
|
|
935
1137
|
|
|
936
1138
|
yield self if block_given?
|
|
937
1139
|
end
|
|
@@ -75,7 +75,7 @@ module Google
|
|
|
75
75
|
end
|
|
76
76
|
default_config = Client::Configuration.new parent_config
|
|
77
77
|
|
|
78
|
-
default_config.timeout =
|
|
78
|
+
default_config.timeout = 600.0
|
|
79
79
|
default_config.retry_policy = {
|
|
80
80
|
initial_delay: 1.0, max_delay: 10.0, multiplier: 1.3, retry_codes: [14]
|
|
81
81
|
}
|
|
@@ -214,7 +214,7 @@ module Google
|
|
|
214
214
|
# @param options [::Gapic::CallOptions, ::Hash]
|
|
215
215
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
216
216
|
#
|
|
217
|
-
# @overload chat(inline_context: nil, conversation_reference: nil, data_agent_context: nil, project: nil, parent: nil, messages: nil)
|
|
217
|
+
# @overload chat(inline_context: nil, conversation_reference: nil, data_agent_context: nil, client_managed_resource_context: nil, project: nil, parent: nil, messages: nil)
|
|
218
218
|
# Pass arguments to `chat` via keyword arguments. Note that at
|
|
219
219
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
220
220
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
@@ -224,17 +224,24 @@ module Google
|
|
|
224
224
|
# statelessly (without managed conversation persistence and without an
|
|
225
225
|
# Agent) by passing all context inline.
|
|
226
226
|
#
|
|
227
|
-
# Note: The following parameters are mutually exclusive: `inline_context`, `conversation_reference`, `data_agent_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
227
|
+
# Note: The following parameters are mutually exclusive: `inline_context`, `conversation_reference`, `data_agent_context`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
228
228
|
# @param conversation_reference [::Google::Cloud::GeminiDataAnalytics::V1beta::ConversationReference, ::Hash]
|
|
229
229
|
# Optional. Reference to a persisted conversation and agent context.
|
|
230
230
|
# Use this to chat with an Agent using managed conversation persistence.
|
|
231
231
|
#
|
|
232
|
-
# Note: The following parameters are mutually exclusive: `conversation_reference`, `inline_context`, `data_agent_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
232
|
+
# Note: The following parameters are mutually exclusive: `conversation_reference`, `inline_context`, `data_agent_context`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
233
233
|
# @param data_agent_context [::Google::Cloud::GeminiDataAnalytics::V1beta::DataAgentContext, ::Hash]
|
|
234
234
|
# Optional. Context for the chat request. Use this to chat with an Agent
|
|
235
235
|
# statelessly, without managed conversation persistence.
|
|
236
236
|
#
|
|
237
|
-
# Note: The following parameters are mutually exclusive: `data_agent_context`, `inline_context`, `conversation_reference`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
237
|
+
# Note: The following parameters are mutually exclusive: `data_agent_context`, `inline_context`, `conversation_reference`, `client_managed_resource_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
238
|
+
# @param client_managed_resource_context [::Google::Cloud::GeminiDataAnalytics::V1beta::ClientManagedResourceContext, ::Hash]
|
|
239
|
+
# Optional. Context with client managed resources.
|
|
240
|
+
# Some clients may not use GDA managed resources including
|
|
241
|
+
# conversations and agents, instead they create and manage their own
|
|
242
|
+
# conversations and agents resources.
|
|
243
|
+
#
|
|
244
|
+
# Note: The following parameters are mutually exclusive: `client_managed_resource_context`, `inline_context`, `conversation_reference`, `data_agent_context`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
|
|
238
245
|
# @param project [::String]
|
|
239
246
|
# Optional. The Google Cloud project to be used for quota and billing.
|
|
240
247
|
# @param parent [::String]
|
|
@@ -397,6 +404,86 @@ module Google
|
|
|
397
404
|
raise ::Google::Cloud::Error.from_error(e)
|
|
398
405
|
end
|
|
399
406
|
|
|
407
|
+
##
|
|
408
|
+
# Deletes a conversation.
|
|
409
|
+
#
|
|
410
|
+
# @overload delete_conversation(request, options = nil)
|
|
411
|
+
# Pass arguments to `delete_conversation` via a request object, either of type
|
|
412
|
+
# {::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest} or an equivalent Hash.
|
|
413
|
+
#
|
|
414
|
+
# @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest, ::Hash]
|
|
415
|
+
# A request object representing the call parameters. Required. To specify no
|
|
416
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
417
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
418
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
419
|
+
#
|
|
420
|
+
# @overload delete_conversation(name: nil)
|
|
421
|
+
# Pass arguments to `delete_conversation` via keyword arguments. Note that at
|
|
422
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
423
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
424
|
+
#
|
|
425
|
+
# @param name [::String]
|
|
426
|
+
# Required. Name of the resource.
|
|
427
|
+
# Format:
|
|
428
|
+
# `projects/{project}/locations/{location}/conversations/{conversation}`
|
|
429
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
430
|
+
# @yieldparam result [::Google::Protobuf::Empty]
|
|
431
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
432
|
+
#
|
|
433
|
+
# @return [::Google::Protobuf::Empty]
|
|
434
|
+
#
|
|
435
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
436
|
+
#
|
|
437
|
+
# @example Basic example
|
|
438
|
+
# require "google/cloud/gemini_data_analytics/v1beta"
|
|
439
|
+
#
|
|
440
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
441
|
+
# client = Google::Cloud::GeminiDataAnalytics::V1beta::DataChatService::Rest::Client.new
|
|
442
|
+
#
|
|
443
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
444
|
+
# request = Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest.new
|
|
445
|
+
#
|
|
446
|
+
# # Call the delete_conversation method.
|
|
447
|
+
# result = client.delete_conversation request
|
|
448
|
+
#
|
|
449
|
+
# # The returned object is of type Google::Protobuf::Empty.
|
|
450
|
+
# p result
|
|
451
|
+
#
|
|
452
|
+
def delete_conversation request, options = nil
|
|
453
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
454
|
+
|
|
455
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::DeleteConversationRequest
|
|
456
|
+
|
|
457
|
+
# Converts hash and nil to an options object
|
|
458
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
459
|
+
|
|
460
|
+
# Customize the options with defaults
|
|
461
|
+
call_metadata = @config.rpcs.delete_conversation.metadata.to_h
|
|
462
|
+
|
|
463
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
464
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
465
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
466
|
+
gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
|
|
467
|
+
transports_version_send: [:rest]
|
|
468
|
+
|
|
469
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
470
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
471
|
+
|
|
472
|
+
options.apply_defaults timeout: @config.rpcs.delete_conversation.timeout,
|
|
473
|
+
metadata: call_metadata,
|
|
474
|
+
retry_policy: @config.rpcs.delete_conversation.retry_policy
|
|
475
|
+
|
|
476
|
+
options.apply_defaults timeout: @config.timeout,
|
|
477
|
+
metadata: @config.metadata,
|
|
478
|
+
retry_policy: @config.retry_policy
|
|
479
|
+
|
|
480
|
+
@data_chat_service_stub.delete_conversation request, options do |result, operation|
|
|
481
|
+
yield result, operation if block_given?
|
|
482
|
+
end
|
|
483
|
+
rescue ::Gapic::Rest::Error => e
|
|
484
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
485
|
+
end
|
|
486
|
+
|
|
400
487
|
##
|
|
401
488
|
# Gets details of a single conversation by using conversation id and parent.
|
|
402
489
|
#
|
|
@@ -507,7 +594,7 @@ module Google
|
|
|
507
594
|
# @param filter [::String]
|
|
508
595
|
# Optional. Returned conversations will match criteria specified within the
|
|
509
596
|
# filter. ListConversations allows filtering by:
|
|
510
|
-
# *
|
|
597
|
+
# * agents
|
|
511
598
|
# * labels
|
|
512
599
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
513
600
|
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::GeminiDataAnalytics::V1beta::Conversation>]
|
|
@@ -672,6 +759,93 @@ module Google
|
|
|
672
759
|
raise ::Google::Cloud::Error.from_error(e)
|
|
673
760
|
end
|
|
674
761
|
|
|
762
|
+
##
|
|
763
|
+
# Queries data from a natural language user query.
|
|
764
|
+
#
|
|
765
|
+
# @overload query_data(request, options = nil)
|
|
766
|
+
# Pass arguments to `query_data` via a request object, either of type
|
|
767
|
+
# {::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest} or an equivalent Hash.
|
|
768
|
+
#
|
|
769
|
+
# @param request [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest, ::Hash]
|
|
770
|
+
# A request object representing the call parameters. Required. To specify no
|
|
771
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
|
772
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
|
773
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
|
774
|
+
#
|
|
775
|
+
# @overload query_data(parent: nil, prompt: nil, context: nil, generation_options: nil)
|
|
776
|
+
# Pass arguments to `query_data` via keyword arguments. Note that at
|
|
777
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
|
778
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
|
779
|
+
#
|
|
780
|
+
# @param parent [::String]
|
|
781
|
+
# Required. The parent resource to generate the query for.
|
|
782
|
+
# Format: projects/\\{project}/locations/\\{location}
|
|
783
|
+
# @param prompt [::String]
|
|
784
|
+
# Required. The natural language query for which to generate query.
|
|
785
|
+
# Example: "What are the top 5 best selling products this month?"
|
|
786
|
+
# @param context [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataContext, ::Hash]
|
|
787
|
+
# Required. The context for the data query, including the data sources to
|
|
788
|
+
# use.
|
|
789
|
+
# @param generation_options [::Google::Cloud::GeminiDataAnalytics::V1beta::GenerationOptions, ::Hash]
|
|
790
|
+
# Optional. Options to control query generation and execution behavior.
|
|
791
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
|
792
|
+
# @yieldparam result [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataResponse]
|
|
793
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
|
794
|
+
#
|
|
795
|
+
# @return [::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataResponse]
|
|
796
|
+
#
|
|
797
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
|
798
|
+
#
|
|
799
|
+
# @example Basic example
|
|
800
|
+
# require "google/cloud/gemini_data_analytics/v1beta"
|
|
801
|
+
#
|
|
802
|
+
# # Create a client object. The client can be reused for multiple calls.
|
|
803
|
+
# client = Google::Cloud::GeminiDataAnalytics::V1beta::DataChatService::Rest::Client.new
|
|
804
|
+
#
|
|
805
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
|
806
|
+
# request = Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest.new
|
|
807
|
+
#
|
|
808
|
+
# # Call the query_data method.
|
|
809
|
+
# result = client.query_data request
|
|
810
|
+
#
|
|
811
|
+
# # The returned object is of type Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataResponse.
|
|
812
|
+
# p result
|
|
813
|
+
#
|
|
814
|
+
def query_data request, options = nil
|
|
815
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
|
816
|
+
|
|
817
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::GeminiDataAnalytics::V1beta::QueryDataRequest
|
|
818
|
+
|
|
819
|
+
# Converts hash and nil to an options object
|
|
820
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
|
821
|
+
|
|
822
|
+
# Customize the options with defaults
|
|
823
|
+
call_metadata = @config.rpcs.query_data.metadata.to_h
|
|
824
|
+
|
|
825
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
|
826
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
|
827
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
|
828
|
+
gapic_version: ::Google::Cloud::GeminiDataAnalytics::V1beta::VERSION,
|
|
829
|
+
transports_version_send: [:rest]
|
|
830
|
+
|
|
831
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
|
832
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
|
833
|
+
|
|
834
|
+
options.apply_defaults timeout: @config.rpcs.query_data.timeout,
|
|
835
|
+
metadata: call_metadata,
|
|
836
|
+
retry_policy: @config.rpcs.query_data.retry_policy
|
|
837
|
+
|
|
838
|
+
options.apply_defaults timeout: @config.timeout,
|
|
839
|
+
metadata: @config.metadata,
|
|
840
|
+
retry_policy: @config.retry_policy
|
|
841
|
+
|
|
842
|
+
@data_chat_service_stub.query_data request, options do |result, operation|
|
|
843
|
+
yield result, operation if block_given?
|
|
844
|
+
end
|
|
845
|
+
rescue ::Gapic::Rest::Error => e
|
|
846
|
+
raise ::Google::Cloud::Error.from_error(e)
|
|
847
|
+
end
|
|
848
|
+
|
|
675
849
|
##
|
|
676
850
|
# Configuration class for the DataChatService REST API.
|
|
677
851
|
#
|
|
@@ -836,6 +1010,11 @@ module Google
|
|
|
836
1010
|
#
|
|
837
1011
|
attr_reader :create_conversation
|
|
838
1012
|
##
|
|
1013
|
+
# RPC-specific configuration for `delete_conversation`
|
|
1014
|
+
# @return [::Gapic::Config::Method]
|
|
1015
|
+
#
|
|
1016
|
+
attr_reader :delete_conversation
|
|
1017
|
+
##
|
|
839
1018
|
# RPC-specific configuration for `get_conversation`
|
|
840
1019
|
# @return [::Gapic::Config::Method]
|
|
841
1020
|
#
|
|
@@ -850,6 +1029,11 @@ module Google
|
|
|
850
1029
|
# @return [::Gapic::Config::Method]
|
|
851
1030
|
#
|
|
852
1031
|
attr_reader :list_messages
|
|
1032
|
+
##
|
|
1033
|
+
# RPC-specific configuration for `query_data`
|
|
1034
|
+
# @return [::Gapic::Config::Method]
|
|
1035
|
+
#
|
|
1036
|
+
attr_reader :query_data
|
|
853
1037
|
|
|
854
1038
|
# @private
|
|
855
1039
|
def initialize parent_rpcs = nil
|
|
@@ -857,12 +1041,16 @@ module Google
|
|
|
857
1041
|
@chat = ::Gapic::Config::Method.new chat_config
|
|
858
1042
|
create_conversation_config = parent_rpcs.create_conversation if parent_rpcs.respond_to? :create_conversation
|
|
859
1043
|
@create_conversation = ::Gapic::Config::Method.new create_conversation_config
|
|
1044
|
+
delete_conversation_config = parent_rpcs.delete_conversation if parent_rpcs.respond_to? :delete_conversation
|
|
1045
|
+
@delete_conversation = ::Gapic::Config::Method.new delete_conversation_config
|
|
860
1046
|
get_conversation_config = parent_rpcs.get_conversation if parent_rpcs.respond_to? :get_conversation
|
|
861
1047
|
@get_conversation = ::Gapic::Config::Method.new get_conversation_config
|
|
862
1048
|
list_conversations_config = parent_rpcs.list_conversations if parent_rpcs.respond_to? :list_conversations
|
|
863
1049
|
@list_conversations = ::Gapic::Config::Method.new list_conversations_config
|
|
864
1050
|
list_messages_config = parent_rpcs.list_messages if parent_rpcs.respond_to? :list_messages
|
|
865
1051
|
@list_messages = ::Gapic::Config::Method.new list_messages_config
|
|
1052
|
+
query_data_config = parent_rpcs.query_data if parent_rpcs.respond_to? :query_data
|
|
1053
|
+
@query_data = ::Gapic::Config::Method.new query_data_config
|
|
866
1054
|
|
|
867
1055
|
yield self if block_given?
|
|
868
1056
|
end
|