google-cloud-discovery_engine-v1beta 0.15.0 → 0.16.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/v1beta/completion_service/client.rb +155 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/paths.rb +62 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/client.rb +148 -0
- data/lib/google/cloud/discovery_engine/v1beta/completion_service/rest/service_stub.rb +76 -0
- data/lib/google/cloud/discovery_engine/v1beta/control_service/client.rb +6 -6
- data/lib/google/cloud/discovery_engine/v1beta/control_service/rest/client.rb +6 -6
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/client.rb +18 -13
- data/lib/google/cloud/discovery_engine/v1beta/conversational_search_service/rest/client.rb +18 -13
- data/lib/google/cloud/discovery_engine/v1beta/document_service/paths.rb +25 -0
- data/lib/google/cloud/discovery_engine/v1beta/engine_service/client.rb +3 -3
- data/lib/google/cloud/discovery_engine/v1beta/engine_service/rest/client.rb +3 -3
- data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/client.rb +218 -4
- data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/paths.rb +85 -0
- data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/client.rb +125 -4
- data/lib/google/cloud/discovery_engine/v1beta/grounded_generation_service/rest/service_stub.rb +60 -0
- data/lib/google/cloud/discovery_engine/v1beta/rank_service/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1beta/rank_service/rest/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1beta/search_service/client.rb +398 -1
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/client.rb +390 -1
- data/lib/google/cloud/discovery_engine/v1beta/search_service/rest/service_stub.rb +76 -0
- data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/client.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1beta/serving_config_service/rest/client.rb +2 -2
- data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/client.rb +324 -1
- data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/paths.rb +49 -0
- data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/client.rb +303 -1
- data/lib/google/cloud/discovery_engine/v1beta/site_search_engine_service/rest/service_stub.rb +193 -0
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1beta/user_event_service/rest/client.rb +1 -1
- data/lib/google/cloud/discovery_engine/v1beta/version.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/answer_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/common_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_pb.rb +18 -1
- data/lib/google/cloud/discoveryengine/v1beta/completion_service_services_pb.rb +2 -0
- data/lib/google/cloud/discoveryengine/v1beta/control_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/conversational_search_service_pb.rb +4 -1
- data/lib/google/cloud/discoveryengine/v1beta/custom_tuning_model_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/data_store_pb.rb +7 -1
- data/lib/google/cloud/discoveryengine/v1beta/document_service_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/engine_pb.rb +1 -1
- data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_pb.rb +24 -1
- data/lib/google/cloud/discoveryengine/v1beta/grounded_generation_service_services_pb.rb +4 -0
- data/lib/google/cloud/discoveryengine/v1beta/grounding_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/search_service_pb.rb +3 -1
- data/lib/google/cloud/discoveryengine/v1beta/search_service_services_pb.rb +14 -0
- data/lib/google/cloud/discoveryengine/v1beta/serving_config_pb.rb +2 -2
- data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_pb.rb +2 -1
- data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_pb.rb +10 -1
- data/lib/google/cloud/discoveryengine/v1beta/site_search_engine_service_services_pb.rb +7 -0
- data/lib/google/cloud/discoveryengine/v1beta/user_event_pb.rb +1 -1
- data/proto_docs/google/api/client.rb +20 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/answer.rb +20 -6
- data/proto_docs/google/cloud/discoveryengine/v1beta/completion_service.rb +268 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/control.rb +9 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/control_service.rb +6 -6
- data/proto_docs/google/cloud/discoveryengine/v1beta/conversational_search_service.rb +95 -15
- data/proto_docs/google/cloud/discoveryengine/v1beta/custom_tuning_model.rb +8 -3
- data/proto_docs/google/cloud/discoveryengine/v1beta/data_store.rb +131 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/document_processing_config.rb +7 -5
- data/proto_docs/google/cloud/discoveryengine/v1beta/document_service.rb +19 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/engine.rb +5 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/engine_service.rb +4 -4
- data/proto_docs/google/cloud/discoveryengine/v1beta/grounded_generation_service.rb +396 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/grounding.rb +10 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/project.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/purge_config.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/rank_service.rb +1 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/search_service.rb +71 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config.rb +16 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/serving_config_service.rb +2 -2
- data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine.rb +17 -0
- data/proto_docs/google/cloud/discoveryengine/v1beta/site_search_engine_service.rb +147 -1
- data/proto_docs/google/cloud/discoveryengine/v1beta/user_event.rb +9 -1
- metadata +3 -3
@@ -203,16 +203,16 @@ module Google
|
|
203
203
|
#
|
204
204
|
# @param name [::String]
|
205
205
|
# Required. The resource name of the Conversation to get. Format:
|
206
|
-
# `projects/{
|
206
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
|
207
207
|
# Use
|
208
|
-
# `projects/{
|
208
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
|
209
209
|
# to activate auto session mode, which automatically creates a new
|
210
210
|
# conversation inside a ConverseConversation session.
|
211
211
|
# @param query [::Google::Cloud::DiscoveryEngine::V1beta::TextInput, ::Hash]
|
212
212
|
# Required. Current user input.
|
213
213
|
# @param serving_config [::String]
|
214
214
|
# The resource name of the Serving Config to use. Format:
|
215
|
-
# `projects/{
|
215
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
|
216
216
|
# If this is not set, the default serving config will be used.
|
217
217
|
# @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
|
218
218
|
# The conversation to be used by auto session only. The name field will be
|
@@ -350,7 +350,7 @@ module Google
|
|
350
350
|
#
|
351
351
|
# @param parent [::String]
|
352
352
|
# Required. Full resource name of parent data store. Format:
|
353
|
-
# `projects/{
|
353
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
354
354
|
# @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
|
355
355
|
# Required. The conversation to create.
|
356
356
|
#
|
@@ -442,7 +442,7 @@ module Google
|
|
442
442
|
#
|
443
443
|
# @param name [::String]
|
444
444
|
# Required. The resource name of the Conversation to delete. Format:
|
445
|
-
# `projects/{
|
445
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
|
446
446
|
#
|
447
447
|
# @yield [response, operation] Access the result along with the RPC operation
|
448
448
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -628,7 +628,7 @@ module Google
|
|
628
628
|
#
|
629
629
|
# @param name [::String]
|
630
630
|
# Required. The resource name of the Conversation to get. Format:
|
631
|
-
# `projects/{
|
631
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
|
632
632
|
#
|
633
633
|
# @yield [response, operation] Access the result along with the RPC operation
|
634
634
|
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Conversation]
|
@@ -716,7 +716,7 @@ module Google
|
|
716
716
|
#
|
717
717
|
# @param parent [::String]
|
718
718
|
# Required. The data store resource name. Format:
|
719
|
-
# `projects/{
|
719
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
720
720
|
# @param page_size [::Integer]
|
721
721
|
# Maximum number of results to return. If unspecified, defaults
|
722
722
|
# to 50. Max allowed value is 1000.
|
@@ -824,7 +824,7 @@ module Google
|
|
824
824
|
# @param options [::Gapic::CallOptions, ::Hash]
|
825
825
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
826
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, user_labels: nil)
|
827
|
+
# @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
|
828
828
|
# Pass arguments to `answer_query` via keyword arguments. Note that at
|
829
829
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
830
830
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -849,6 +849,8 @@ module Google
|
|
849
849
|
# Model specification.
|
850
850
|
# @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash]
|
851
851
|
# Related questions specification.
|
852
|
+
# @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::GroundingSpec, ::Hash]
|
853
|
+
# Optional. Grounding specification.
|
852
854
|
# @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec, ::Hash]
|
853
855
|
# Answer generation specification.
|
854
856
|
# @param search_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec, ::Hash]
|
@@ -856,6 +858,9 @@ module Google
|
|
856
858
|
# @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash]
|
857
859
|
# Query understanding specification.
|
858
860
|
# @param asynchronous_mode [::Boolean]
|
861
|
+
# Deprecated: This field is deprecated. Streaming Answer API will be
|
862
|
+
# supported.
|
863
|
+
#
|
859
864
|
# Asynchronous mode control.
|
860
865
|
#
|
861
866
|
# If enabled, the response will be returned with answer/session resource
|
@@ -979,7 +984,7 @@ module Google
|
|
979
984
|
#
|
980
985
|
# @param name [::String]
|
981
986
|
# Required. The resource name of the Answer to get. Format:
|
982
|
-
# `projects/{
|
987
|
+
# `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
|
983
988
|
#
|
984
989
|
# @yield [response, operation] Access the result along with the RPC operation
|
985
990
|
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Answer]
|
@@ -1069,7 +1074,7 @@ module Google
|
|
1069
1074
|
#
|
1070
1075
|
# @param parent [::String]
|
1071
1076
|
# Required. Full resource name of parent data store. Format:
|
1072
|
-
# `projects/{
|
1077
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
1073
1078
|
# @param session [::Google::Cloud::DiscoveryEngine::V1beta::Session, ::Hash]
|
1074
1079
|
# Required. The session to create.
|
1075
1080
|
#
|
@@ -1161,7 +1166,7 @@ module Google
|
|
1161
1166
|
#
|
1162
1167
|
# @param name [::String]
|
1163
1168
|
# Required. The resource name of the Session to delete. Format:
|
1164
|
-
# `projects/{
|
1169
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1165
1170
|
#
|
1166
1171
|
# @yield [response, operation] Access the result along with the RPC operation
|
1167
1172
|
# @yieldparam response [::Google::Protobuf::Empty]
|
@@ -1346,7 +1351,7 @@ module Google
|
|
1346
1351
|
#
|
1347
1352
|
# @param name [::String]
|
1348
1353
|
# Required. The resource name of the Session to get. Format:
|
1349
|
-
# `projects/{
|
1354
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1350
1355
|
#
|
1351
1356
|
# @yield [response, operation] Access the result along with the RPC operation
|
1352
1357
|
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Session]
|
@@ -1434,7 +1439,7 @@ module Google
|
|
1434
1439
|
#
|
1435
1440
|
# @param parent [::String]
|
1436
1441
|
# Required. The data store resource name. Format:
|
1437
|
-
# `projects/{
|
1442
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
1438
1443
|
# @param page_size [::Integer]
|
1439
1444
|
# Maximum number of results to return. If unspecified, defaults
|
1440
1445
|
# to 50. Max allowed value is 1000.
|
@@ -196,16 +196,16 @@ module Google
|
|
196
196
|
#
|
197
197
|
# @param name [::String]
|
198
198
|
# Required. The resource name of the Conversation to get. Format:
|
199
|
-
# `projects/{
|
199
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`.
|
200
200
|
# Use
|
201
|
-
# `projects/{
|
201
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/-`
|
202
202
|
# to activate auto session mode, which automatically creates a new
|
203
203
|
# conversation inside a ConverseConversation session.
|
204
204
|
# @param query [::Google::Cloud::DiscoveryEngine::V1beta::TextInput, ::Hash]
|
205
205
|
# Required. Current user input.
|
206
206
|
# @param serving_config [::String]
|
207
207
|
# The resource name of the Serving Config to use. Format:
|
208
|
-
# `projects/{
|
208
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/servingConfigs/{serving_config_id}`
|
209
209
|
# If this is not set, the default serving config will be used.
|
210
210
|
# @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
|
211
211
|
# The conversation to be used by auto session only. The name field will be
|
@@ -336,7 +336,7 @@ module Google
|
|
336
336
|
#
|
337
337
|
# @param parent [::String]
|
338
338
|
# Required. Full resource name of parent data store. Format:
|
339
|
-
# `projects/{
|
339
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
340
340
|
# @param conversation [::Google::Cloud::DiscoveryEngine::V1beta::Conversation, ::Hash]
|
341
341
|
# Required. The conversation to create.
|
342
342
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -421,7 +421,7 @@ module Google
|
|
421
421
|
#
|
422
422
|
# @param name [::String]
|
423
423
|
# Required. The resource name of the Conversation to delete. Format:
|
424
|
-
# `projects/{
|
424
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
|
425
425
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
426
426
|
# @yieldparam result [::Google::Protobuf::Empty]
|
427
427
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -593,7 +593,7 @@ module Google
|
|
593
593
|
#
|
594
594
|
# @param name [::String]
|
595
595
|
# Required. The resource name of the Conversation to get. Format:
|
596
|
-
# `projects/{
|
596
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/conversations/{conversation_id}`
|
597
597
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
598
598
|
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Conversation]
|
599
599
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -674,7 +674,7 @@ module Google
|
|
674
674
|
#
|
675
675
|
# @param parent [::String]
|
676
676
|
# Required. The data store resource name. Format:
|
677
|
-
# `projects/{
|
677
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
678
678
|
# @param page_size [::Integer]
|
679
679
|
# Maximum number of results to return. If unspecified, defaults
|
680
680
|
# to 50. Max allowed value is 1000.
|
@@ -775,7 +775,7 @@ module Google
|
|
775
775
|
# @param options [::Gapic::CallOptions, ::Hash]
|
776
776
|
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
777
777
|
#
|
778
|
-
# @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
|
778
|
+
# @overload answer_query(serving_config: nil, query: nil, session: nil, safety_spec: nil, related_questions_spec: nil, grounding_spec: nil, answer_generation_spec: nil, search_spec: nil, query_understanding_spec: nil, asynchronous_mode: nil, user_pseudo_id: nil, user_labels: nil)
|
779
779
|
# Pass arguments to `answer_query` via keyword arguments. Note that at
|
780
780
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
781
781
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
@@ -800,6 +800,8 @@ module Google
|
|
800
800
|
# Model specification.
|
801
801
|
# @param related_questions_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::RelatedQuestionsSpec, ::Hash]
|
802
802
|
# Related questions specification.
|
803
|
+
# @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::GroundingSpec, ::Hash]
|
804
|
+
# Optional. Grounding specification.
|
803
805
|
# @param answer_generation_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::AnswerGenerationSpec, ::Hash]
|
804
806
|
# Answer generation specification.
|
805
807
|
# @param search_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::SearchSpec, ::Hash]
|
@@ -807,6 +809,9 @@ module Google
|
|
807
809
|
# @param query_understanding_spec [::Google::Cloud::DiscoveryEngine::V1beta::AnswerQueryRequest::QueryUnderstandingSpec, ::Hash]
|
808
810
|
# Query understanding specification.
|
809
811
|
# @param asynchronous_mode [::Boolean]
|
812
|
+
# Deprecated: This field is deprecated. Streaming Answer API will be
|
813
|
+
# supported.
|
814
|
+
#
|
810
815
|
# Asynchronous mode control.
|
811
816
|
#
|
812
817
|
# If enabled, the response will be returned with answer/session resource
|
@@ -923,7 +928,7 @@ module Google
|
|
923
928
|
#
|
924
929
|
# @param name [::String]
|
925
930
|
# Required. The resource name of the Answer to get. Format:
|
926
|
-
# `projects/{
|
931
|
+
# `projects/{project}/locations/{location}/collections/{collection}/engines/{engine_id}/sessions/{session_id}/answers/{answer_id}`
|
927
932
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
928
933
|
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Answer]
|
929
934
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1006,7 +1011,7 @@ module Google
|
|
1006
1011
|
#
|
1007
1012
|
# @param parent [::String]
|
1008
1013
|
# Required. Full resource name of parent data store. Format:
|
1009
|
-
# `projects/{
|
1014
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
1010
1015
|
# @param session [::Google::Cloud::DiscoveryEngine::V1beta::Session, ::Hash]
|
1011
1016
|
# Required. The session to create.
|
1012
1017
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
@@ -1091,7 +1096,7 @@ module Google
|
|
1091
1096
|
#
|
1092
1097
|
# @param name [::String]
|
1093
1098
|
# Required. The resource name of the Session to delete. Format:
|
1094
|
-
# `projects/{
|
1099
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1095
1100
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1096
1101
|
# @yieldparam result [::Google::Protobuf::Empty]
|
1097
1102
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1262,7 +1267,7 @@ module Google
|
|
1262
1267
|
#
|
1263
1268
|
# @param name [::String]
|
1264
1269
|
# Required. The resource name of the Session to get. Format:
|
1265
|
-
# `projects/{
|
1270
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}/sessions/{session_id}`
|
1266
1271
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
1267
1272
|
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Session]
|
1268
1273
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -1343,7 +1348,7 @@ module Google
|
|
1343
1348
|
#
|
1344
1349
|
# @param parent [::String]
|
1345
1350
|
# Required. The data store resource name. Format:
|
1346
|
-
# `projects/{
|
1351
|
+
# `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store_id}`
|
1347
1352
|
# @param page_size [::Integer]
|
1348
1353
|
# Maximum number of results to return. If unspecified, defaults
|
1349
1354
|
# to 50. Max allowed value is 1000.
|
@@ -126,6 +126,31 @@ module Google
|
|
126
126
|
resource.call(**args)
|
127
127
|
end
|
128
128
|
|
129
|
+
##
|
130
|
+
# Create a fully-qualified FhirResource resource string.
|
131
|
+
#
|
132
|
+
# The resource will be in the following format:
|
133
|
+
#
|
134
|
+
# `projects/{project}/locations/{location}/datasets/{dataset}/fhirStores/{fhir_store}/fhir/{resource_type}/{fhir_resource_id}`
|
135
|
+
#
|
136
|
+
# @param project [String]
|
137
|
+
# @param location [String]
|
138
|
+
# @param dataset [String]
|
139
|
+
# @param fhir_store [String]
|
140
|
+
# @param resource_type [String]
|
141
|
+
# @param fhir_resource_id [String]
|
142
|
+
#
|
143
|
+
# @return [::String]
|
144
|
+
def fhir_resource_path project:, location:, dataset:, fhir_store:, resource_type:, fhir_resource_id:
|
145
|
+
raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
|
146
|
+
raise ::ArgumentError, "location cannot contain /" if location.to_s.include? "/"
|
147
|
+
raise ::ArgumentError, "dataset cannot contain /" if dataset.to_s.include? "/"
|
148
|
+
raise ::ArgumentError, "fhir_store cannot contain /" if fhir_store.to_s.include? "/"
|
149
|
+
raise ::ArgumentError, "resource_type cannot contain /" if resource_type.to_s.include? "/"
|
150
|
+
|
151
|
+
"projects/#{project}/locations/#{location}/datasets/#{dataset}/fhirStores/#{fhir_store}/fhir/#{resource_type}/#{fhir_resource_id}"
|
152
|
+
end
|
153
|
+
|
129
154
|
##
|
130
155
|
# Create a fully-qualified FhirStore resource string.
|
131
156
|
#
|
@@ -714,7 +714,7 @@ module Google
|
|
714
714
|
# @param name [::String]
|
715
715
|
# Required. The name of the engine to pause.
|
716
716
|
# Format:
|
717
|
-
# `projects/{
|
717
|
+
# `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`
|
718
718
|
#
|
719
719
|
# @yield [response, operation] Access the result along with the RPC operation
|
720
720
|
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
|
@@ -804,7 +804,7 @@ module Google
|
|
804
804
|
# @param name [::String]
|
805
805
|
# Required. The name of the engine to resume.
|
806
806
|
# Format:
|
807
|
-
# `projects/{
|
807
|
+
# `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`
|
808
808
|
#
|
809
809
|
# @yield [response, operation] Access the result along with the RPC operation
|
810
810
|
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
|
@@ -894,7 +894,7 @@ module Google
|
|
894
894
|
# @param name [::String]
|
895
895
|
# Required. The resource name of the engine to tune.
|
896
896
|
# Format:
|
897
|
-
# `projects/{
|
897
|
+
# `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`
|
898
898
|
#
|
899
899
|
# @yield [response, operation] Access the result along with the RPC operation
|
900
900
|
# @yieldparam response [::Gapic::Operation]
|
@@ -672,7 +672,7 @@ module Google
|
|
672
672
|
# @param name [::String]
|
673
673
|
# Required. The name of the engine to pause.
|
674
674
|
# Format:
|
675
|
-
# `projects/{
|
675
|
+
# `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`
|
676
676
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
677
677
|
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
|
678
678
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -755,7 +755,7 @@ module Google
|
|
755
755
|
# @param name [::String]
|
756
756
|
# Required. The name of the engine to resume.
|
757
757
|
# Format:
|
758
|
-
# `projects/{
|
758
|
+
# `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`
|
759
759
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
760
760
|
# @yieldparam result [::Google::Cloud::DiscoveryEngine::V1beta::Engine]
|
761
761
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -838,7 +838,7 @@ module Google
|
|
838
838
|
# @param name [::String]
|
839
839
|
# Required. The resource name of the engine to tune.
|
840
840
|
# Format:
|
841
|
-
# `projects/{
|
841
|
+
# `projects/{project}/locations/{location}/collections/{collection_id}/engines/{engine_id}`
|
842
842
|
# @yield [result, operation] Access the result along with the TransportOperation object
|
843
843
|
# @yieldparam result [::Gapic::Operation]
|
844
844
|
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
@@ -183,6 +183,206 @@ module Google
|
|
183
183
|
|
184
184
|
# Service calls
|
185
185
|
|
186
|
+
##
|
187
|
+
# Generates grounded content in a streaming fashion.
|
188
|
+
#
|
189
|
+
# @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest, ::Hash>]
|
190
|
+
# An enumerable of {::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest} instances.
|
191
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
192
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
193
|
+
#
|
194
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
195
|
+
# @yieldparam response [::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentResponse>]
|
196
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
197
|
+
#
|
198
|
+
# @return [::Enumerable<::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentResponse>]
|
199
|
+
#
|
200
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
201
|
+
#
|
202
|
+
# @example Basic example
|
203
|
+
# require "google/cloud/discovery_engine/v1beta"
|
204
|
+
#
|
205
|
+
# # Create a client object. The client can be reused for multiple calls.
|
206
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.new
|
207
|
+
#
|
208
|
+
# # Create an input stream.
|
209
|
+
# input = Gapic::StreamInput.new
|
210
|
+
#
|
211
|
+
# # Call the stream_generate_grounded_content method to start streaming.
|
212
|
+
# output = client.stream_generate_grounded_content input
|
213
|
+
#
|
214
|
+
# # Send requests on the stream. For each request object, set fields by
|
215
|
+
# # passing keyword arguments. Be sure to close the stream when done.
|
216
|
+
# input << Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest.new
|
217
|
+
# input << Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest.new
|
218
|
+
# input.close
|
219
|
+
#
|
220
|
+
# # The returned object is a streamed enumerable yielding elements of type
|
221
|
+
# # ::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentResponse
|
222
|
+
# output.each do |current_response|
|
223
|
+
# p current_response
|
224
|
+
# end
|
225
|
+
#
|
226
|
+
def stream_generate_grounded_content request, options = nil
|
227
|
+
unless request.is_a? ::Enumerable
|
228
|
+
raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
|
229
|
+
request = request.to_enum
|
230
|
+
end
|
231
|
+
|
232
|
+
request = request.lazy.map do |req|
|
233
|
+
::Gapic::Protobuf.coerce req, to: ::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest
|
234
|
+
end
|
235
|
+
|
236
|
+
# Converts hash and nil to an options object
|
237
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
238
|
+
|
239
|
+
# Customize the options with defaults
|
240
|
+
metadata = @config.rpcs.stream_generate_grounded_content.metadata.to_h
|
241
|
+
|
242
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
243
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
244
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
245
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
|
246
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
247
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
248
|
+
|
249
|
+
options.apply_defaults timeout: @config.rpcs.stream_generate_grounded_content.timeout,
|
250
|
+
metadata: metadata,
|
251
|
+
retry_policy: @config.rpcs.stream_generate_grounded_content.retry_policy
|
252
|
+
|
253
|
+
options.apply_defaults timeout: @config.timeout,
|
254
|
+
metadata: @config.metadata,
|
255
|
+
retry_policy: @config.retry_policy
|
256
|
+
|
257
|
+
@grounded_generation_service_stub.call_rpc :stream_generate_grounded_content, request, options: options do |response, operation|
|
258
|
+
yield response, operation if block_given?
|
259
|
+
return response
|
260
|
+
end
|
261
|
+
rescue ::GRPC::BadStatus => e
|
262
|
+
raise ::Google::Cloud::Error.from_error(e)
|
263
|
+
end
|
264
|
+
|
265
|
+
##
|
266
|
+
# Generates grounded content.
|
267
|
+
#
|
268
|
+
# @overload generate_grounded_content(request, options = nil)
|
269
|
+
# Pass arguments to `generate_grounded_content` via a request object, either of type
|
270
|
+
# {::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest} or an equivalent Hash.
|
271
|
+
#
|
272
|
+
# @param request [::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest, ::Hash]
|
273
|
+
# A request object representing the call parameters. Required. To specify no
|
274
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
275
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
276
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
277
|
+
#
|
278
|
+
# @overload generate_grounded_content(location: nil, system_instruction: nil, contents: nil, generation_spec: nil, grounding_spec: nil, user_labels: nil)
|
279
|
+
# Pass arguments to `generate_grounded_content` via keyword arguments. Note that at
|
280
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
281
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
282
|
+
#
|
283
|
+
# @param location [::String]
|
284
|
+
# Required. Location resource.
|
285
|
+
#
|
286
|
+
# Format: `projects/{project}/locations/{location}`.
|
287
|
+
# @param system_instruction [::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationContent, ::Hash]
|
288
|
+
# Content of the system instruction for the current API.
|
289
|
+
#
|
290
|
+
# These instructions will take priority over any other prompt instructions
|
291
|
+
# if the selected model is supporting them.
|
292
|
+
# @param contents [::Array<::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationContent, ::Hash>]
|
293
|
+
# Content of the current conversation with the model.
|
294
|
+
#
|
295
|
+
# For single-turn queries, this is a single instance. For multi-turn queries,
|
296
|
+
# this is a repeated field that contains conversation history + latest
|
297
|
+
# request.
|
298
|
+
# @param generation_spec [::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest::GenerationSpec, ::Hash]
|
299
|
+
# Content generation specification.
|
300
|
+
# @param grounding_spec [::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest::GroundingSpec, ::Hash]
|
301
|
+
# Grounding specification.
|
302
|
+
# @param user_labels [::Hash{::String => ::String}]
|
303
|
+
# The user labels applied to a resource must meet the following requirements:
|
304
|
+
#
|
305
|
+
# * Each resource can have multiple labels, up to a maximum of 64.
|
306
|
+
# * Each label must be a key-value pair.
|
307
|
+
# * Keys have a minimum length of 1 character and a maximum length of 63
|
308
|
+
# characters and cannot be empty. Values can be empty and have a maximum
|
309
|
+
# length of 63 characters.
|
310
|
+
# * Keys and values can contain only lowercase letters, numeric characters,
|
311
|
+
# underscores, and dashes. All characters must use UTF-8 encoding, and
|
312
|
+
# international characters are allowed.
|
313
|
+
# * The key portion of a label must be unique. However, you can use the same
|
314
|
+
# key with multiple resources.
|
315
|
+
# * Keys must start with a lowercase letter or international character.
|
316
|
+
#
|
317
|
+
# See [Google Cloud
|
318
|
+
# Document](https://cloud.google.com/resource-manager/docs/creating-managing-labels#requirements)
|
319
|
+
# for more details.
|
320
|
+
#
|
321
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
322
|
+
# @yieldparam response [::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentResponse]
|
323
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
324
|
+
#
|
325
|
+
# @return [::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentResponse]
|
326
|
+
#
|
327
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
328
|
+
#
|
329
|
+
# @example Basic example
|
330
|
+
# require "google/cloud/discovery_engine/v1beta"
|
331
|
+
#
|
332
|
+
# # Create a client object. The client can be reused for multiple calls.
|
333
|
+
# client = Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.new
|
334
|
+
#
|
335
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
336
|
+
# request = Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest.new
|
337
|
+
#
|
338
|
+
# # Call the generate_grounded_content method.
|
339
|
+
# result = client.generate_grounded_content request
|
340
|
+
#
|
341
|
+
# # The returned object is of type Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentResponse.
|
342
|
+
# p result
|
343
|
+
#
|
344
|
+
def generate_grounded_content request, options = nil
|
345
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
346
|
+
|
347
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::DiscoveryEngine::V1beta::GenerateGroundedContentRequest
|
348
|
+
|
349
|
+
# Converts hash and nil to an options object
|
350
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
351
|
+
|
352
|
+
# Customize the options with defaults
|
353
|
+
metadata = @config.rpcs.generate_grounded_content.metadata.to_h
|
354
|
+
|
355
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
356
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
357
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
358
|
+
gapic_version: ::Google::Cloud::DiscoveryEngine::V1beta::VERSION
|
359
|
+
metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
360
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
361
|
+
|
362
|
+
header_params = {}
|
363
|
+
if request.location
|
364
|
+
header_params["location"] = request.location
|
365
|
+
end
|
366
|
+
|
367
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
368
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
369
|
+
|
370
|
+
options.apply_defaults timeout: @config.rpcs.generate_grounded_content.timeout,
|
371
|
+
metadata: metadata,
|
372
|
+
retry_policy: @config.rpcs.generate_grounded_content.retry_policy
|
373
|
+
|
374
|
+
options.apply_defaults timeout: @config.timeout,
|
375
|
+
metadata: @config.metadata,
|
376
|
+
retry_policy: @config.retry_policy
|
377
|
+
|
378
|
+
@grounded_generation_service_stub.call_rpc :generate_grounded_content, request, options: options do |response, operation|
|
379
|
+
yield response, operation if block_given?
|
380
|
+
return response
|
381
|
+
end
|
382
|
+
rescue ::GRPC::BadStatus => e
|
383
|
+
raise ::Google::Cloud::Error.from_error(e)
|
384
|
+
end
|
385
|
+
|
186
386
|
##
|
187
387
|
# Performs a grounding check.
|
188
388
|
#
|
@@ -205,7 +405,7 @@ module Google
|
|
205
405
|
# Required. The resource name of the grounding config, such as
|
206
406
|
# `projects/*/locations/global/groundingConfigs/default_grounding_config`.
|
207
407
|
# @param answer_candidate [::String]
|
208
|
-
# Answer candidate to check.
|
408
|
+
# Answer candidate to check. It can have a maximum length of 4096 tokens.
|
209
409
|
# @param facts [::Array<::Google::Cloud::DiscoveryEngine::V1beta::GroundingFact, ::Hash>]
|
210
410
|
# List of facts for the grounding check.
|
211
411
|
# We support up to 200 facts.
|
@@ -311,17 +511,17 @@ module Google
|
|
311
511
|
# @example
|
312
512
|
#
|
313
513
|
# # Modify the global config, setting the timeout for
|
314
|
-
# #
|
514
|
+
# # stream_generate_grounded_content to 20 seconds,
|
315
515
|
# # and all remaining timeouts to 10 seconds.
|
316
516
|
# ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.configure do |config|
|
317
517
|
# config.timeout = 10.0
|
318
|
-
# config.rpcs.
|
518
|
+
# config.rpcs.stream_generate_grounded_content.timeout = 20.0
|
319
519
|
# end
|
320
520
|
#
|
321
521
|
# # Apply the above configuration only to a new client.
|
322
522
|
# client = ::Google::Cloud::DiscoveryEngine::V1beta::GroundedGenerationService::Client.new do |config|
|
323
523
|
# config.timeout = 10.0
|
324
|
-
# config.rpcs.
|
524
|
+
# config.rpcs.stream_generate_grounded_content.timeout = 20.0
|
325
525
|
# end
|
326
526
|
#
|
327
527
|
# @!attribute [rw] endpoint
|
@@ -448,6 +648,16 @@ module Google
|
|
448
648
|
# trigger a retry.
|
449
649
|
#
|
450
650
|
class Rpcs
|
651
|
+
##
|
652
|
+
# RPC-specific configuration for `stream_generate_grounded_content`
|
653
|
+
# @return [::Gapic::Config::Method]
|
654
|
+
#
|
655
|
+
attr_reader :stream_generate_grounded_content
|
656
|
+
##
|
657
|
+
# RPC-specific configuration for `generate_grounded_content`
|
658
|
+
# @return [::Gapic::Config::Method]
|
659
|
+
#
|
660
|
+
attr_reader :generate_grounded_content
|
451
661
|
##
|
452
662
|
# RPC-specific configuration for `check_grounding`
|
453
663
|
# @return [::Gapic::Config::Method]
|
@@ -456,6 +666,10 @@ module Google
|
|
456
666
|
|
457
667
|
# @private
|
458
668
|
def initialize parent_rpcs = nil
|
669
|
+
stream_generate_grounded_content_config = parent_rpcs.stream_generate_grounded_content if parent_rpcs.respond_to? :stream_generate_grounded_content
|
670
|
+
@stream_generate_grounded_content = ::Gapic::Config::Method.new stream_generate_grounded_content_config
|
671
|
+
generate_grounded_content_config = parent_rpcs.generate_grounded_content if parent_rpcs.respond_to? :generate_grounded_content
|
672
|
+
@generate_grounded_content = ::Gapic::Config::Method.new generate_grounded_content_config
|
459
673
|
check_grounding_config = parent_rpcs.check_grounding if parent_rpcs.respond_to? :check_grounding
|
460
674
|
@check_grounding = ::Gapic::Config::Method.new check_grounding_config
|
461
675
|
|