google-cloud-ai_platform-v1 0.57.0 → 0.59.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/ai_platform/v1/dataset_service/client.rb +2 -0
- data/lib/google/cloud/ai_platform/v1/dataset_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/client.rb +2 -0
- data/lib/google/cloud/ai_platform/v1/dataset_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/deployment_resource_pool_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/endpoint_service/client.rb +103 -0
- data/lib/google/cloud/ai_platform/v1/endpoint_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/client.rb +96 -0
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/endpoint_service/rest/service_stub.rb +60 -0
- data/lib/google/cloud/ai_platform/v1/evaluation_service/client.rb +6 -1
- data/lib/google/cloud/ai_platform/v1/evaluation_service/rest/client.rb +6 -1
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/client.rb +1 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/client.rb +1 -0
- data/lib/google/cloud/ai_platform/v1/feature_online_store_admin_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/client.rb +4 -4
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/client.rb +4 -4
- data/lib/google/cloud/ai_platform/v1/feature_registry_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/featurestore_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/featurestore_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/client.rb +3 -4
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/client.rb +3 -4
- data/lib/google/cloud/ai_platform/v1/gen_ai_tuning_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/client.rb +4 -2
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/client.rb +4 -2
- data/lib/google/cloud/ai_platform/v1/index_endpoint_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/index_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/index_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/job_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/job_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/llm_utility_service/paths.rb +19 -0
- data/lib/google/cloud/ai_platform/v1/metadata_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/metadata_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/migration_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/migration_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/model_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/model_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/notebook_service/client.rb +2 -1
- data/lib/google/cloud/ai_platform/v1/notebook_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/client.rb +2 -1
- data/lib/google/cloud/ai_platform/v1/notebook_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/client.rb +2 -2
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/client.rb +2 -2
- data/lib/google/cloud/ai_platform/v1/persistent_resource_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/pipeline_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/pipeline_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/prediction_service/paths.rb +19 -0
- data/lib/google/cloud/ai_platform/v1/rest.rb +2 -0
- data/lib/google/cloud/ai_platform/v1/schedule_service/client.rb +3 -2
- data/lib/google/cloud/ai_platform/v1/schedule_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/schedule_service/paths.rb +38 -0
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/client.rb +3 -2
- data/lib/google/cloud/ai_platform/v1/schedule_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/specialist_pool_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/tensorboard_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1/version.rb +1 -1
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/client.rb +1405 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/operations.rb +810 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/paths.rb +173 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/client.rb +1318 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/operations.rb +4244 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub.rb +663 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service/rest.rb +54 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_data_service.rb +56 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/client.rb +672 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/credentials.rb +47 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/paths.rb +69 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/client.rb +634 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest/service_stub.rb +249 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service/rest.rb +53 -0
- data/lib/google/cloud/ai_platform/v1/vertex_rag_service.rb +55 -0
- data/lib/google/cloud/ai_platform/v1/vizier_service/operations.rb +3 -10
- data/lib/google/cloud/ai_platform/v1/vizier_service/rest/operations.rb +73 -10
- data/lib/google/cloud/ai_platform/v1.rb +2 -0
- data/lib/google/cloud/aiplatform/v1/api_auth_pb.rb +46 -0
- data/lib/google/cloud/aiplatform/v1/dataset_service_services_pb.rb +2 -0
- data/lib/google/cloud/aiplatform/v1/endpoint_pb.rb +6 -1
- data/lib/google/cloud/aiplatform/v1/endpoint_service_pb.rb +3 -1
- data/lib/google/cloud/aiplatform/v1/endpoint_service_services_pb.rb +2 -0
- data/lib/google/cloud/aiplatform/v1/env_var_pb.rb +2 -1
- data/lib/google/cloud/aiplatform/v1/evaluation_service_pb.rb +11 -1
- data/lib/google/cloud/aiplatform/v1/genai_tuning_service_services_pb.rb +0 -2
- data/lib/google/cloud/aiplatform/v1/io_pb.rb +16 -1
- data/lib/google/cloud/aiplatform/v1/machine_resources_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/notebook_execution_job_pb.rb +6 -1
- data/lib/google/cloud/aiplatform/v1/schedule_service_services_pb.rb +3 -2
- data/lib/google/cloud/aiplatform/v1/tool_pb.rb +5 -1
- data/lib/google/cloud/aiplatform/v1/tuning_job_pb.rb +1 -1
- data/lib/google/cloud/aiplatform/v1/vertex_rag_data_pb.rb +67 -0
- data/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_pb.rb +71 -0
- data/lib/google/cloud/aiplatform/v1/vertex_rag_data_service_services_pb.rb +63 -0
- data/lib/google/cloud/aiplatform/v1/vertex_rag_service_pb.rb +65 -0
- data/lib/google/cloud/aiplatform/v1/vertex_rag_service_services_pb.rb +52 -0
- data/proto_docs/google/cloud/aiplatform/v1/api_auth.rb +45 -0
- data/proto_docs/google/cloud/aiplatform/v1/custom_job.rb +2 -2
- data/proto_docs/google/cloud/aiplatform/v1/dataset.rb +4 -2
- data/proto_docs/google/cloud/aiplatform/v1/dataset_service.rb +2 -0
- data/proto_docs/google/cloud/aiplatform/v1/endpoint.rb +42 -0
- data/proto_docs/google/cloud/aiplatform/v1/endpoint_service.rb +22 -0
- data/proto_docs/google/cloud/aiplatform/v1/evaluated_annotation.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/evaluation_service.rb +149 -1
- data/proto_docs/google/cloud/aiplatform/v1/explanation.rb +2 -2
- data/proto_docs/google/cloud/aiplatform/v1/feature_online_store_admin_service.rb +3 -1
- data/proto_docs/google/cloud/aiplatform/v1/feature_registry_service.rb +4 -4
- data/proto_docs/google/cloud/aiplatform/v1/featurestore_online_service.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/featurestore_service.rb +2 -1
- data/proto_docs/google/cloud/aiplatform/v1/genai_tuning_service.rb +3 -2
- data/proto_docs/google/cloud/aiplatform/v1/index_endpoint_service.rb +4 -2
- data/proto_docs/google/cloud/aiplatform/v1/io.rb +158 -0
- data/proto_docs/google/cloud/aiplatform/v1/machine_resources.rb +8 -0
- data/proto_docs/google/cloud/aiplatform/v1/migration_service.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/model.rb +1 -1
- data/proto_docs/google/cloud/aiplatform/v1/model_monitoring.rb +3 -3
- data/proto_docs/google/cloud/aiplatform/v1/notebook_execution_job.rb +18 -0
- data/proto_docs/google/cloud/aiplatform/v1/notebook_service.rb +5 -3
- data/proto_docs/google/cloud/aiplatform/v1/openapi.rb +2 -2
- data/proto_docs/google/cloud/aiplatform/v1/persistent_resource_service.rb +4 -3
- data/proto_docs/google/cloud/aiplatform/v1/tool.rb +72 -0
- data/proto_docs/google/cloud/aiplatform/v1/tuning_job.rb +9 -0
- data/proto_docs/google/cloud/aiplatform/v1/types.rb +13 -13
- data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data.rb +334 -0
- data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_data_service.rb +293 -0
- data/proto_docs/google/cloud/aiplatform/v1/vertex_rag_service.rb +279 -0
- data/proto_docs/google/longrunning/operations.rb +19 -14
- metadata +28 -2
@@ -0,0 +1,1318 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2024 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
require "google/cloud/errors"
|
20
|
+
require "google/cloud/aiplatform/v1/vertex_rag_data_service_pb"
|
21
|
+
require "google/cloud/ai_platform/v1/vertex_rag_data_service/rest/service_stub"
|
22
|
+
require "google/cloud/location/rest"
|
23
|
+
require "google/iam/v1/rest"
|
24
|
+
|
25
|
+
module Google
|
26
|
+
module Cloud
|
27
|
+
module AIPlatform
|
28
|
+
module V1
|
29
|
+
module VertexRagDataService
|
30
|
+
module Rest
|
31
|
+
##
|
32
|
+
# REST client for the VertexRagDataService service.
|
33
|
+
#
|
34
|
+
# A service for managing user data for RAG.
|
35
|
+
#
|
36
|
+
class Client
|
37
|
+
# @private
|
38
|
+
API_VERSION = ""
|
39
|
+
|
40
|
+
# @private
|
41
|
+
DEFAULT_ENDPOINT_TEMPLATE = "aiplatform.$UNIVERSE_DOMAIN$"
|
42
|
+
|
43
|
+
include Paths
|
44
|
+
|
45
|
+
# @private
|
46
|
+
attr_reader :vertex_rag_data_service_stub
|
47
|
+
|
48
|
+
##
|
49
|
+
# Configure the VertexRagDataService Client class.
|
50
|
+
#
|
51
|
+
# See {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client::Configuration}
|
52
|
+
# for a description of the configuration fields.
|
53
|
+
#
|
54
|
+
# @example
|
55
|
+
#
|
56
|
+
# # Modify the configuration for all VertexRagDataService clients
|
57
|
+
# ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.configure do |config|
|
58
|
+
# config.timeout = 10.0
|
59
|
+
# end
|
60
|
+
#
|
61
|
+
# @yield [config] Configure the Client client.
|
62
|
+
# @yieldparam config [Client::Configuration]
|
63
|
+
#
|
64
|
+
# @return [Client::Configuration]
|
65
|
+
#
|
66
|
+
def self.configure
|
67
|
+
@configure ||= begin
|
68
|
+
namespace = ["Google", "Cloud", "AIPlatform", "V1"]
|
69
|
+
parent_config = while namespace.any?
|
70
|
+
parent_name = namespace.join "::"
|
71
|
+
parent_const = const_get parent_name
|
72
|
+
break parent_const.configure if parent_const.respond_to? :configure
|
73
|
+
namespace.pop
|
74
|
+
end
|
75
|
+
default_config = Client::Configuration.new parent_config
|
76
|
+
|
77
|
+
default_config
|
78
|
+
end
|
79
|
+
yield @configure if block_given?
|
80
|
+
@configure
|
81
|
+
end
|
82
|
+
|
83
|
+
##
|
84
|
+
# Configure the VertexRagDataService Client instance.
|
85
|
+
#
|
86
|
+
# The configuration is set to the derived mode, meaning that values can be changed,
|
87
|
+
# but structural changes (adding new fields, etc.) are not allowed. Structural changes
|
88
|
+
# should be made on {Client.configure}.
|
89
|
+
#
|
90
|
+
# See {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client::Configuration}
|
91
|
+
# for a description of the configuration fields.
|
92
|
+
#
|
93
|
+
# @yield [config] Configure the Client client.
|
94
|
+
# @yieldparam config [Client::Configuration]
|
95
|
+
#
|
96
|
+
# @return [Client::Configuration]
|
97
|
+
#
|
98
|
+
def configure
|
99
|
+
yield @config if block_given?
|
100
|
+
@config
|
101
|
+
end
|
102
|
+
|
103
|
+
##
|
104
|
+
# The effective universe domain
|
105
|
+
#
|
106
|
+
# @return [String]
|
107
|
+
#
|
108
|
+
def universe_domain
|
109
|
+
@vertex_rag_data_service_stub.universe_domain
|
110
|
+
end
|
111
|
+
|
112
|
+
##
|
113
|
+
# Create a new VertexRagDataService REST client object.
|
114
|
+
#
|
115
|
+
# @example
|
116
|
+
#
|
117
|
+
# # Create a client using the default configuration
|
118
|
+
# client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
119
|
+
#
|
120
|
+
# # Create a client using a custom configuration
|
121
|
+
# client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new do |config|
|
122
|
+
# config.timeout = 10.0
|
123
|
+
# end
|
124
|
+
#
|
125
|
+
# @yield [config] Configure the VertexRagDataService client.
|
126
|
+
# @yieldparam config [Client::Configuration]
|
127
|
+
#
|
128
|
+
def initialize
|
129
|
+
# Create the configuration object
|
130
|
+
@config = Configuration.new Client.configure
|
131
|
+
|
132
|
+
# Yield the configuration if needed
|
133
|
+
yield @config if block_given?
|
134
|
+
|
135
|
+
# Create credentials
|
136
|
+
credentials = @config.credentials
|
137
|
+
# Use self-signed JWT if the endpoint is unchanged from default,
|
138
|
+
# but only if the default endpoint does not have a region prefix.
|
139
|
+
enable_self_signed_jwt = @config.endpoint.nil? ||
|
140
|
+
(@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
|
141
|
+
!@config.endpoint.split(".").first.include?("-"))
|
142
|
+
credentials ||= Credentials.default scope: @config.scope,
|
143
|
+
enable_self_signed_jwt: enable_self_signed_jwt
|
144
|
+
if credentials.is_a?(::String) || credentials.is_a?(::Hash)
|
145
|
+
credentials = Credentials.new credentials, scope: @config.scope
|
146
|
+
end
|
147
|
+
|
148
|
+
@quota_project_id = @config.quota_project
|
149
|
+
@quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
|
150
|
+
|
151
|
+
@operations_client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Operations.new do |config|
|
152
|
+
config.credentials = credentials
|
153
|
+
config.quota_project = @quota_project_id
|
154
|
+
config.endpoint = @config.endpoint
|
155
|
+
config.universe_domain = @config.universe_domain
|
156
|
+
end
|
157
|
+
|
158
|
+
@vertex_rag_data_service_stub = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::ServiceStub.new(
|
159
|
+
endpoint: @config.endpoint,
|
160
|
+
endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
|
161
|
+
universe_domain: @config.universe_domain,
|
162
|
+
credentials: credentials
|
163
|
+
)
|
164
|
+
|
165
|
+
@location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
|
166
|
+
config.credentials = credentials
|
167
|
+
config.quota_project = @quota_project_id
|
168
|
+
config.endpoint = @vertex_rag_data_service_stub.endpoint
|
169
|
+
config.universe_domain = @vertex_rag_data_service_stub.universe_domain
|
170
|
+
config.bindings_override = @config.bindings_override
|
171
|
+
end
|
172
|
+
|
173
|
+
@iam_policy_client = Google::Iam::V1::IAMPolicy::Rest::Client.new do |config|
|
174
|
+
config.credentials = credentials
|
175
|
+
config.quota_project = @quota_project_id
|
176
|
+
config.endpoint = @vertex_rag_data_service_stub.endpoint
|
177
|
+
config.universe_domain = @vertex_rag_data_service_stub.universe_domain
|
178
|
+
config.bindings_override = @config.bindings_override
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
##
|
183
|
+
# Get the associated client for long-running operations.
|
184
|
+
#
|
185
|
+
# @return [::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Operations]
|
186
|
+
#
|
187
|
+
attr_reader :operations_client
|
188
|
+
|
189
|
+
##
|
190
|
+
# Get the associated client for mix-in of the Locations.
|
191
|
+
#
|
192
|
+
# @return [Google::Cloud::Location::Locations::Rest::Client]
|
193
|
+
#
|
194
|
+
attr_reader :location_client
|
195
|
+
|
196
|
+
##
|
197
|
+
# Get the associated client for mix-in of the IAMPolicy.
|
198
|
+
#
|
199
|
+
# @return [Google::Iam::V1::IAMPolicy::Rest::Client]
|
200
|
+
#
|
201
|
+
attr_reader :iam_policy_client
|
202
|
+
|
203
|
+
# Service calls
|
204
|
+
|
205
|
+
##
|
206
|
+
# Creates a RagCorpus.
|
207
|
+
#
|
208
|
+
# @overload create_rag_corpus(request, options = nil)
|
209
|
+
# Pass arguments to `create_rag_corpus` via a request object, either of type
|
210
|
+
# {::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest} or an equivalent Hash.
|
211
|
+
#
|
212
|
+
# @param request [::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest, ::Hash]
|
213
|
+
# A request object representing the call parameters. Required. To specify no
|
214
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
215
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
216
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
217
|
+
#
|
218
|
+
# @overload create_rag_corpus(parent: nil, rag_corpus: nil)
|
219
|
+
# Pass arguments to `create_rag_corpus` via keyword arguments. Note that at
|
220
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
221
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
222
|
+
#
|
223
|
+
# @param parent [::String]
|
224
|
+
# Required. The resource name of the Location to create the RagCorpus in.
|
225
|
+
# Format: `projects/{project}/locations/{location}`
|
226
|
+
# @param rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash]
|
227
|
+
# Required. The RagCorpus to create.
|
228
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
229
|
+
# @yieldparam result [::Gapic::Operation]
|
230
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
231
|
+
#
|
232
|
+
# @return [::Gapic::Operation]
|
233
|
+
#
|
234
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
235
|
+
#
|
236
|
+
# @example Basic example
|
237
|
+
# require "google/cloud/ai_platform/v1"
|
238
|
+
#
|
239
|
+
# # Create a client object. The client can be reused for multiple calls.
|
240
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
241
|
+
#
|
242
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
243
|
+
# request = Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest.new
|
244
|
+
#
|
245
|
+
# # Call the create_rag_corpus method.
|
246
|
+
# result = client.create_rag_corpus request
|
247
|
+
#
|
248
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
249
|
+
# # check the status of an operation, cancel it, or wait for results.
|
250
|
+
# # Here is how to wait for a response.
|
251
|
+
# result.wait_until_done! timeout: 60
|
252
|
+
# if result.response?
|
253
|
+
# p result.response
|
254
|
+
# else
|
255
|
+
# puts "No response received."
|
256
|
+
# end
|
257
|
+
#
|
258
|
+
def create_rag_corpus request, options = nil
|
259
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
260
|
+
|
261
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::CreateRagCorpusRequest
|
262
|
+
|
263
|
+
# Converts hash and nil to an options object
|
264
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
265
|
+
|
266
|
+
# Customize the options with defaults
|
267
|
+
call_metadata = @config.rpcs.create_rag_corpus.metadata.to_h
|
268
|
+
|
269
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
270
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
271
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
272
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
273
|
+
transports_version_send: [:rest]
|
274
|
+
|
275
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
276
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
277
|
+
|
278
|
+
options.apply_defaults timeout: @config.rpcs.create_rag_corpus.timeout,
|
279
|
+
metadata: call_metadata,
|
280
|
+
retry_policy: @config.rpcs.create_rag_corpus.retry_policy
|
281
|
+
|
282
|
+
options.apply_defaults timeout: @config.timeout,
|
283
|
+
metadata: @config.metadata,
|
284
|
+
retry_policy: @config.retry_policy
|
285
|
+
|
286
|
+
@vertex_rag_data_service_stub.create_rag_corpus request, options do |result, operation|
|
287
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
288
|
+
yield result, operation if block_given?
|
289
|
+
return result
|
290
|
+
end
|
291
|
+
rescue ::Gapic::Rest::Error => e
|
292
|
+
raise ::Google::Cloud::Error.from_error(e)
|
293
|
+
end
|
294
|
+
|
295
|
+
##
|
296
|
+
# Updates a RagCorpus.
|
297
|
+
#
|
298
|
+
# @overload update_rag_corpus(request, options = nil)
|
299
|
+
# Pass arguments to `update_rag_corpus` via a request object, either of type
|
300
|
+
# {::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest} or an equivalent Hash.
|
301
|
+
#
|
302
|
+
# @param request [::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest, ::Hash]
|
303
|
+
# A request object representing the call parameters. Required. To specify no
|
304
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
305
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
306
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
307
|
+
#
|
308
|
+
# @overload update_rag_corpus(rag_corpus: nil)
|
309
|
+
# Pass arguments to `update_rag_corpus` via keyword arguments. Note that at
|
310
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
311
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
312
|
+
#
|
313
|
+
# @param rag_corpus [::Google::Cloud::AIPlatform::V1::RagCorpus, ::Hash]
|
314
|
+
# Required. The RagCorpus which replaces the resource on the server.
|
315
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
316
|
+
# @yieldparam result [::Gapic::Operation]
|
317
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
318
|
+
#
|
319
|
+
# @return [::Gapic::Operation]
|
320
|
+
#
|
321
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
322
|
+
#
|
323
|
+
# @example Basic example
|
324
|
+
# require "google/cloud/ai_platform/v1"
|
325
|
+
#
|
326
|
+
# # Create a client object. The client can be reused for multiple calls.
|
327
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
328
|
+
#
|
329
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
330
|
+
# request = Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest.new
|
331
|
+
#
|
332
|
+
# # Call the update_rag_corpus method.
|
333
|
+
# result = client.update_rag_corpus request
|
334
|
+
#
|
335
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
336
|
+
# # check the status of an operation, cancel it, or wait for results.
|
337
|
+
# # Here is how to wait for a response.
|
338
|
+
# result.wait_until_done! timeout: 60
|
339
|
+
# if result.response?
|
340
|
+
# p result.response
|
341
|
+
# else
|
342
|
+
# puts "No response received."
|
343
|
+
# end
|
344
|
+
#
|
345
|
+
def update_rag_corpus request, options = nil
|
346
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
347
|
+
|
348
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UpdateRagCorpusRequest
|
349
|
+
|
350
|
+
# Converts hash and nil to an options object
|
351
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
352
|
+
|
353
|
+
# Customize the options with defaults
|
354
|
+
call_metadata = @config.rpcs.update_rag_corpus.metadata.to_h
|
355
|
+
|
356
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
357
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
358
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
359
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
360
|
+
transports_version_send: [:rest]
|
361
|
+
|
362
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
363
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
364
|
+
|
365
|
+
options.apply_defaults timeout: @config.rpcs.update_rag_corpus.timeout,
|
366
|
+
metadata: call_metadata,
|
367
|
+
retry_policy: @config.rpcs.update_rag_corpus.retry_policy
|
368
|
+
|
369
|
+
options.apply_defaults timeout: @config.timeout,
|
370
|
+
metadata: @config.metadata,
|
371
|
+
retry_policy: @config.retry_policy
|
372
|
+
|
373
|
+
@vertex_rag_data_service_stub.update_rag_corpus request, options do |result, operation|
|
374
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
375
|
+
yield result, operation if block_given?
|
376
|
+
return result
|
377
|
+
end
|
378
|
+
rescue ::Gapic::Rest::Error => e
|
379
|
+
raise ::Google::Cloud::Error.from_error(e)
|
380
|
+
end
|
381
|
+
|
382
|
+
##
|
383
|
+
# Gets a RagCorpus.
|
384
|
+
#
|
385
|
+
# @overload get_rag_corpus(request, options = nil)
|
386
|
+
# Pass arguments to `get_rag_corpus` via a request object, either of type
|
387
|
+
# {::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest} or an equivalent Hash.
|
388
|
+
#
|
389
|
+
# @param request [::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest, ::Hash]
|
390
|
+
# A request object representing the call parameters. Required. To specify no
|
391
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
392
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
393
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
394
|
+
#
|
395
|
+
# @overload get_rag_corpus(name: nil)
|
396
|
+
# Pass arguments to `get_rag_corpus` via keyword arguments. Note that at
|
397
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
398
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
399
|
+
#
|
400
|
+
# @param name [::String]
|
401
|
+
# Required. The name of the RagCorpus resource.
|
402
|
+
# Format:
|
403
|
+
# `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
|
404
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
405
|
+
# @yieldparam result [::Google::Cloud::AIPlatform::V1::RagCorpus]
|
406
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
407
|
+
#
|
408
|
+
# @return [::Google::Cloud::AIPlatform::V1::RagCorpus]
|
409
|
+
#
|
410
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
411
|
+
#
|
412
|
+
# @example Basic example
|
413
|
+
# require "google/cloud/ai_platform/v1"
|
414
|
+
#
|
415
|
+
# # Create a client object. The client can be reused for multiple calls.
|
416
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
417
|
+
#
|
418
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
419
|
+
# request = Google::Cloud::AIPlatform::V1::GetRagCorpusRequest.new
|
420
|
+
#
|
421
|
+
# # Call the get_rag_corpus method.
|
422
|
+
# result = client.get_rag_corpus request
|
423
|
+
#
|
424
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::RagCorpus.
|
425
|
+
# p result
|
426
|
+
#
|
427
|
+
def get_rag_corpus request, options = nil
|
428
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
429
|
+
|
430
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagCorpusRequest
|
431
|
+
|
432
|
+
# Converts hash and nil to an options object
|
433
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
434
|
+
|
435
|
+
# Customize the options with defaults
|
436
|
+
call_metadata = @config.rpcs.get_rag_corpus.metadata.to_h
|
437
|
+
|
438
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
439
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
440
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
441
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
442
|
+
transports_version_send: [:rest]
|
443
|
+
|
444
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
445
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
446
|
+
|
447
|
+
options.apply_defaults timeout: @config.rpcs.get_rag_corpus.timeout,
|
448
|
+
metadata: call_metadata,
|
449
|
+
retry_policy: @config.rpcs.get_rag_corpus.retry_policy
|
450
|
+
|
451
|
+
options.apply_defaults timeout: @config.timeout,
|
452
|
+
metadata: @config.metadata,
|
453
|
+
retry_policy: @config.retry_policy
|
454
|
+
|
455
|
+
@vertex_rag_data_service_stub.get_rag_corpus request, options do |result, operation|
|
456
|
+
yield result, operation if block_given?
|
457
|
+
return result
|
458
|
+
end
|
459
|
+
rescue ::Gapic::Rest::Error => e
|
460
|
+
raise ::Google::Cloud::Error.from_error(e)
|
461
|
+
end
|
462
|
+
|
463
|
+
##
|
464
|
+
# Lists RagCorpora in a Location.
|
465
|
+
#
|
466
|
+
# @overload list_rag_corpora(request, options = nil)
|
467
|
+
# Pass arguments to `list_rag_corpora` via a request object, either of type
|
468
|
+
# {::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest} or an equivalent Hash.
|
469
|
+
#
|
470
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest, ::Hash]
|
471
|
+
# A request object representing the call parameters. Required. To specify no
|
472
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
473
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
474
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
475
|
+
#
|
476
|
+
# @overload list_rag_corpora(parent: nil, page_size: nil, page_token: nil)
|
477
|
+
# Pass arguments to `list_rag_corpora` via keyword arguments. Note that at
|
478
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
479
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
480
|
+
#
|
481
|
+
# @param parent [::String]
|
482
|
+
# Required. The resource name of the Location from which to list the
|
483
|
+
# RagCorpora. Format: `projects/{project}/locations/{location}`
|
484
|
+
# @param page_size [::Integer]
|
485
|
+
# Optional. The standard list page size.
|
486
|
+
# @param page_token [::String]
|
487
|
+
# Optional. The standard list page token.
|
488
|
+
# Typically obtained via
|
489
|
+
# {::Google::Cloud::AIPlatform::V1::ListRagCorporaResponse#next_page_token ListRagCorporaResponse.next_page_token}
|
490
|
+
# of the previous
|
491
|
+
# {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#list_rag_corpora VertexRagDataService.ListRagCorpora}
|
492
|
+
# call.
|
493
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
494
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>]
|
495
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
496
|
+
#
|
497
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagCorpus>]
|
498
|
+
#
|
499
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
500
|
+
#
|
501
|
+
# @example Basic example
|
502
|
+
# require "google/cloud/ai_platform/v1"
|
503
|
+
#
|
504
|
+
# # Create a client object. The client can be reused for multiple calls.
|
505
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
506
|
+
#
|
507
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
508
|
+
# request = Google::Cloud::AIPlatform::V1::ListRagCorporaRequest.new
|
509
|
+
#
|
510
|
+
# # Call the list_rag_corpora method.
|
511
|
+
# result = client.list_rag_corpora request
|
512
|
+
#
|
513
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
514
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
515
|
+
# result.each do |item|
|
516
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::RagCorpus.
|
517
|
+
# p item
|
518
|
+
# end
|
519
|
+
#
|
520
|
+
def list_rag_corpora request, options = nil
|
521
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
522
|
+
|
523
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagCorporaRequest
|
524
|
+
|
525
|
+
# Converts hash and nil to an options object
|
526
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
527
|
+
|
528
|
+
# Customize the options with defaults
|
529
|
+
call_metadata = @config.rpcs.list_rag_corpora.metadata.to_h
|
530
|
+
|
531
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
532
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
533
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
534
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
535
|
+
transports_version_send: [:rest]
|
536
|
+
|
537
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
538
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
539
|
+
|
540
|
+
options.apply_defaults timeout: @config.rpcs.list_rag_corpora.timeout,
|
541
|
+
metadata: call_metadata,
|
542
|
+
retry_policy: @config.rpcs.list_rag_corpora.retry_policy
|
543
|
+
|
544
|
+
options.apply_defaults timeout: @config.timeout,
|
545
|
+
metadata: @config.metadata,
|
546
|
+
retry_policy: @config.retry_policy
|
547
|
+
|
548
|
+
@vertex_rag_data_service_stub.list_rag_corpora request, options do |result, operation|
|
549
|
+
result = ::Gapic::Rest::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_corpora, "rag_corpora", request, result, options
|
550
|
+
yield result, operation if block_given?
|
551
|
+
return result
|
552
|
+
end
|
553
|
+
rescue ::Gapic::Rest::Error => e
|
554
|
+
raise ::Google::Cloud::Error.from_error(e)
|
555
|
+
end
|
556
|
+
|
557
|
+
##
|
558
|
+
# Deletes a RagCorpus.
|
559
|
+
#
|
560
|
+
# @overload delete_rag_corpus(request, options = nil)
|
561
|
+
# Pass arguments to `delete_rag_corpus` via a request object, either of type
|
562
|
+
# {::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest} or an equivalent Hash.
|
563
|
+
#
|
564
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest, ::Hash]
|
565
|
+
# A request object representing the call parameters. Required. To specify no
|
566
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
567
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
568
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
569
|
+
#
|
570
|
+
# @overload delete_rag_corpus(name: nil, force: nil)
|
571
|
+
# Pass arguments to `delete_rag_corpus` via keyword arguments. Note that at
|
572
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
573
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
574
|
+
#
|
575
|
+
# @param name [::String]
|
576
|
+
# Required. The name of the RagCorpus resource to be deleted.
|
577
|
+
# Format:
|
578
|
+
# `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
|
579
|
+
# @param force [::Boolean]
|
580
|
+
# Optional. If set to true, any RagFiles in this RagCorpus will also be
|
581
|
+
# deleted. Otherwise, the request will only work if the RagCorpus has no
|
582
|
+
# RagFiles.
|
583
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
584
|
+
# @yieldparam result [::Gapic::Operation]
|
585
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
586
|
+
#
|
587
|
+
# @return [::Gapic::Operation]
|
588
|
+
#
|
589
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
590
|
+
#
|
591
|
+
# @example Basic example
|
592
|
+
# require "google/cloud/ai_platform/v1"
|
593
|
+
#
|
594
|
+
# # Create a client object. The client can be reused for multiple calls.
|
595
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
596
|
+
#
|
597
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
598
|
+
# request = Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest.new
|
599
|
+
#
|
600
|
+
# # Call the delete_rag_corpus method.
|
601
|
+
# result = client.delete_rag_corpus request
|
602
|
+
#
|
603
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
604
|
+
# # check the status of an operation, cancel it, or wait for results.
|
605
|
+
# # Here is how to wait for a response.
|
606
|
+
# result.wait_until_done! timeout: 60
|
607
|
+
# if result.response?
|
608
|
+
# p result.response
|
609
|
+
# else
|
610
|
+
# puts "No response received."
|
611
|
+
# end
|
612
|
+
#
|
613
|
+
def delete_rag_corpus request, options = nil
|
614
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
615
|
+
|
616
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagCorpusRequest
|
617
|
+
|
618
|
+
# Converts hash and nil to an options object
|
619
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
620
|
+
|
621
|
+
# Customize the options with defaults
|
622
|
+
call_metadata = @config.rpcs.delete_rag_corpus.metadata.to_h
|
623
|
+
|
624
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
625
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
626
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
627
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
628
|
+
transports_version_send: [:rest]
|
629
|
+
|
630
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
631
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
632
|
+
|
633
|
+
options.apply_defaults timeout: @config.rpcs.delete_rag_corpus.timeout,
|
634
|
+
metadata: call_metadata,
|
635
|
+
retry_policy: @config.rpcs.delete_rag_corpus.retry_policy
|
636
|
+
|
637
|
+
options.apply_defaults timeout: @config.timeout,
|
638
|
+
metadata: @config.metadata,
|
639
|
+
retry_policy: @config.retry_policy
|
640
|
+
|
641
|
+
@vertex_rag_data_service_stub.delete_rag_corpus request, options do |result, operation|
|
642
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
643
|
+
yield result, operation if block_given?
|
644
|
+
return result
|
645
|
+
end
|
646
|
+
rescue ::Gapic::Rest::Error => e
|
647
|
+
raise ::Google::Cloud::Error.from_error(e)
|
648
|
+
end
|
649
|
+
|
650
|
+
##
|
651
|
+
# Upload a file into a RagCorpus.
|
652
|
+
#
|
653
|
+
# @overload upload_rag_file(request, options = nil)
|
654
|
+
# Pass arguments to `upload_rag_file` via a request object, either of type
|
655
|
+
# {::Google::Cloud::AIPlatform::V1::UploadRagFileRequest} or an equivalent Hash.
|
656
|
+
#
|
657
|
+
# @param request [::Google::Cloud::AIPlatform::V1::UploadRagFileRequest, ::Hash]
|
658
|
+
# A request object representing the call parameters. Required. To specify no
|
659
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
660
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
661
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
662
|
+
#
|
663
|
+
# @overload upload_rag_file(parent: nil, rag_file: nil, upload_rag_file_config: nil)
|
664
|
+
# Pass arguments to `upload_rag_file` via keyword arguments. Note that at
|
665
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
666
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
667
|
+
#
|
668
|
+
# @param parent [::String]
|
669
|
+
# Required. The name of the RagCorpus resource into which to upload the file.
|
670
|
+
# Format:
|
671
|
+
# `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
|
672
|
+
# @param rag_file [::Google::Cloud::AIPlatform::V1::RagFile, ::Hash]
|
673
|
+
# Required. The RagFile to upload.
|
674
|
+
# @param upload_rag_file_config [::Google::Cloud::AIPlatform::V1::UploadRagFileConfig, ::Hash]
|
675
|
+
# Required. The config for the RagFiles to be uploaded into the RagCorpus.
|
676
|
+
# {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#upload_rag_file VertexRagDataService.UploadRagFile}.
|
677
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
678
|
+
# @yieldparam result [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse]
|
679
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
680
|
+
#
|
681
|
+
# @return [::Google::Cloud::AIPlatform::V1::UploadRagFileResponse]
|
682
|
+
#
|
683
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
684
|
+
#
|
685
|
+
# @example Basic example
|
686
|
+
# require "google/cloud/ai_platform/v1"
|
687
|
+
#
|
688
|
+
# # Create a client object. The client can be reused for multiple calls.
|
689
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
690
|
+
#
|
691
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
692
|
+
# request = Google::Cloud::AIPlatform::V1::UploadRagFileRequest.new
|
693
|
+
#
|
694
|
+
# # Call the upload_rag_file method.
|
695
|
+
# result = client.upload_rag_file request
|
696
|
+
#
|
697
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::UploadRagFileResponse.
|
698
|
+
# p result
|
699
|
+
#
|
700
|
+
def upload_rag_file request, options = nil
|
701
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
702
|
+
|
703
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::UploadRagFileRequest
|
704
|
+
|
705
|
+
# Converts hash and nil to an options object
|
706
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
707
|
+
|
708
|
+
# Customize the options with defaults
|
709
|
+
call_metadata = @config.rpcs.upload_rag_file.metadata.to_h
|
710
|
+
|
711
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
712
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
713
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
714
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
715
|
+
transports_version_send: [:rest]
|
716
|
+
|
717
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
718
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
719
|
+
|
720
|
+
options.apply_defaults timeout: @config.rpcs.upload_rag_file.timeout,
|
721
|
+
metadata: call_metadata,
|
722
|
+
retry_policy: @config.rpcs.upload_rag_file.retry_policy
|
723
|
+
|
724
|
+
options.apply_defaults timeout: @config.timeout,
|
725
|
+
metadata: @config.metadata,
|
726
|
+
retry_policy: @config.retry_policy
|
727
|
+
|
728
|
+
@vertex_rag_data_service_stub.upload_rag_file request, options do |result, operation|
|
729
|
+
yield result, operation if block_given?
|
730
|
+
return result
|
731
|
+
end
|
732
|
+
rescue ::Gapic::Rest::Error => e
|
733
|
+
raise ::Google::Cloud::Error.from_error(e)
|
734
|
+
end
|
735
|
+
|
736
|
+
##
|
737
|
+
# Import files from Google Cloud Storage or Google Drive into a RagCorpus.
|
738
|
+
#
|
739
|
+
# @overload import_rag_files(request, options = nil)
|
740
|
+
# Pass arguments to `import_rag_files` via a request object, either of type
|
741
|
+
# {::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest} or an equivalent Hash.
|
742
|
+
#
|
743
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest, ::Hash]
|
744
|
+
# A request object representing the call parameters. Required. To specify no
|
745
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
746
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
747
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
748
|
+
#
|
749
|
+
# @overload import_rag_files(parent: nil, import_rag_files_config: nil)
|
750
|
+
# Pass arguments to `import_rag_files` via keyword arguments. Note that at
|
751
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
752
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
753
|
+
#
|
754
|
+
# @param parent [::String]
|
755
|
+
# Required. The name of the RagCorpus resource into which to import files.
|
756
|
+
# Format:
|
757
|
+
# `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
|
758
|
+
# @param import_rag_files_config [::Google::Cloud::AIPlatform::V1::ImportRagFilesConfig, ::Hash]
|
759
|
+
# Required. The config for the RagFiles to be synced and imported into the
|
760
|
+
# RagCorpus.
|
761
|
+
# {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#import_rag_files VertexRagDataService.ImportRagFiles}.
|
762
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
763
|
+
# @yieldparam result [::Gapic::Operation]
|
764
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
765
|
+
#
|
766
|
+
# @return [::Gapic::Operation]
|
767
|
+
#
|
768
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
769
|
+
#
|
770
|
+
# @example Basic example
|
771
|
+
# require "google/cloud/ai_platform/v1"
|
772
|
+
#
|
773
|
+
# # Create a client object. The client can be reused for multiple calls.
|
774
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
775
|
+
#
|
776
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
777
|
+
# request = Google::Cloud::AIPlatform::V1::ImportRagFilesRequest.new
|
778
|
+
#
|
779
|
+
# # Call the import_rag_files method.
|
780
|
+
# result = client.import_rag_files request
|
781
|
+
#
|
782
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
783
|
+
# # check the status of an operation, cancel it, or wait for results.
|
784
|
+
# # Here is how to wait for a response.
|
785
|
+
# result.wait_until_done! timeout: 60
|
786
|
+
# if result.response?
|
787
|
+
# p result.response
|
788
|
+
# else
|
789
|
+
# puts "No response received."
|
790
|
+
# end
|
791
|
+
#
|
792
|
+
def import_rag_files request, options = nil
|
793
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
794
|
+
|
795
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ImportRagFilesRequest
|
796
|
+
|
797
|
+
# Converts hash and nil to an options object
|
798
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
799
|
+
|
800
|
+
# Customize the options with defaults
|
801
|
+
call_metadata = @config.rpcs.import_rag_files.metadata.to_h
|
802
|
+
|
803
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
804
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
805
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
806
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
807
|
+
transports_version_send: [:rest]
|
808
|
+
|
809
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
810
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
811
|
+
|
812
|
+
options.apply_defaults timeout: @config.rpcs.import_rag_files.timeout,
|
813
|
+
metadata: call_metadata,
|
814
|
+
retry_policy: @config.rpcs.import_rag_files.retry_policy
|
815
|
+
|
816
|
+
options.apply_defaults timeout: @config.timeout,
|
817
|
+
metadata: @config.metadata,
|
818
|
+
retry_policy: @config.retry_policy
|
819
|
+
|
820
|
+
@vertex_rag_data_service_stub.import_rag_files request, options do |result, operation|
|
821
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
822
|
+
yield result, operation if block_given?
|
823
|
+
return result
|
824
|
+
end
|
825
|
+
rescue ::Gapic::Rest::Error => e
|
826
|
+
raise ::Google::Cloud::Error.from_error(e)
|
827
|
+
end
|
828
|
+
|
829
|
+
##
|
830
|
+
# Gets a RagFile.
|
831
|
+
#
|
832
|
+
# @overload get_rag_file(request, options = nil)
|
833
|
+
# Pass arguments to `get_rag_file` via a request object, either of type
|
834
|
+
# {::Google::Cloud::AIPlatform::V1::GetRagFileRequest} or an equivalent Hash.
|
835
|
+
#
|
836
|
+
# @param request [::Google::Cloud::AIPlatform::V1::GetRagFileRequest, ::Hash]
|
837
|
+
# A request object representing the call parameters. Required. To specify no
|
838
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
839
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
840
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
841
|
+
#
|
842
|
+
# @overload get_rag_file(name: nil)
|
843
|
+
# Pass arguments to `get_rag_file` via keyword arguments. Note that at
|
844
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
845
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
846
|
+
#
|
847
|
+
# @param name [::String]
|
848
|
+
# Required. The name of the RagFile resource.
|
849
|
+
# Format:
|
850
|
+
# `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`
|
851
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
852
|
+
# @yieldparam result [::Google::Cloud::AIPlatform::V1::RagFile]
|
853
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
854
|
+
#
|
855
|
+
# @return [::Google::Cloud::AIPlatform::V1::RagFile]
|
856
|
+
#
|
857
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
858
|
+
#
|
859
|
+
# @example Basic example
|
860
|
+
# require "google/cloud/ai_platform/v1"
|
861
|
+
#
|
862
|
+
# # Create a client object. The client can be reused for multiple calls.
|
863
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
864
|
+
#
|
865
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
866
|
+
# request = Google::Cloud::AIPlatform::V1::GetRagFileRequest.new
|
867
|
+
#
|
868
|
+
# # Call the get_rag_file method.
|
869
|
+
# result = client.get_rag_file request
|
870
|
+
#
|
871
|
+
# # The returned object is of type Google::Cloud::AIPlatform::V1::RagFile.
|
872
|
+
# p result
|
873
|
+
#
|
874
|
+
def get_rag_file request, options = nil
|
875
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
876
|
+
|
877
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::GetRagFileRequest
|
878
|
+
|
879
|
+
# Converts hash and nil to an options object
|
880
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
881
|
+
|
882
|
+
# Customize the options with defaults
|
883
|
+
call_metadata = @config.rpcs.get_rag_file.metadata.to_h
|
884
|
+
|
885
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
886
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
887
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
888
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
889
|
+
transports_version_send: [:rest]
|
890
|
+
|
891
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
892
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
893
|
+
|
894
|
+
options.apply_defaults timeout: @config.rpcs.get_rag_file.timeout,
|
895
|
+
metadata: call_metadata,
|
896
|
+
retry_policy: @config.rpcs.get_rag_file.retry_policy
|
897
|
+
|
898
|
+
options.apply_defaults timeout: @config.timeout,
|
899
|
+
metadata: @config.metadata,
|
900
|
+
retry_policy: @config.retry_policy
|
901
|
+
|
902
|
+
@vertex_rag_data_service_stub.get_rag_file request, options do |result, operation|
|
903
|
+
yield result, operation if block_given?
|
904
|
+
return result
|
905
|
+
end
|
906
|
+
rescue ::Gapic::Rest::Error => e
|
907
|
+
raise ::Google::Cloud::Error.from_error(e)
|
908
|
+
end
|
909
|
+
|
910
|
+
##
|
911
|
+
# Lists RagFiles in a RagCorpus.
|
912
|
+
#
|
913
|
+
# @overload list_rag_files(request, options = nil)
|
914
|
+
# Pass arguments to `list_rag_files` via a request object, either of type
|
915
|
+
# {::Google::Cloud::AIPlatform::V1::ListRagFilesRequest} or an equivalent Hash.
|
916
|
+
#
|
917
|
+
# @param request [::Google::Cloud::AIPlatform::V1::ListRagFilesRequest, ::Hash]
|
918
|
+
# A request object representing the call parameters. Required. To specify no
|
919
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
920
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
921
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
922
|
+
#
|
923
|
+
# @overload list_rag_files(parent: nil, page_size: nil, page_token: nil)
|
924
|
+
# Pass arguments to `list_rag_files` via keyword arguments. Note that at
|
925
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
926
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
927
|
+
#
|
928
|
+
# @param parent [::String]
|
929
|
+
# Required. The resource name of the RagCorpus from which to list the
|
930
|
+
# RagFiles. Format:
|
931
|
+
# `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
|
932
|
+
# @param page_size [::Integer]
|
933
|
+
# Optional. The standard list page size.
|
934
|
+
# @param page_token [::String]
|
935
|
+
# Optional. The standard list page token.
|
936
|
+
# Typically obtained via
|
937
|
+
# {::Google::Cloud::AIPlatform::V1::ListRagFilesResponse#next_page_token ListRagFilesResponse.next_page_token}
|
938
|
+
# of the previous
|
939
|
+
# {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client#list_rag_files VertexRagDataService.ListRagFiles}
|
940
|
+
# call.
|
941
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
942
|
+
# @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>]
|
943
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
944
|
+
#
|
945
|
+
# @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::AIPlatform::V1::RagFile>]
|
946
|
+
#
|
947
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
948
|
+
#
|
949
|
+
# @example Basic example
|
950
|
+
# require "google/cloud/ai_platform/v1"
|
951
|
+
#
|
952
|
+
# # Create a client object. The client can be reused for multiple calls.
|
953
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
954
|
+
#
|
955
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
956
|
+
# request = Google::Cloud::AIPlatform::V1::ListRagFilesRequest.new
|
957
|
+
#
|
958
|
+
# # Call the list_rag_files method.
|
959
|
+
# result = client.list_rag_files request
|
960
|
+
#
|
961
|
+
# # The returned object is of type Gapic::PagedEnumerable. You can iterate
|
962
|
+
# # over elements, and API calls will be issued to fetch pages as needed.
|
963
|
+
# result.each do |item|
|
964
|
+
# # Each element is of type ::Google::Cloud::AIPlatform::V1::RagFile.
|
965
|
+
# p item
|
966
|
+
# end
|
967
|
+
#
|
968
|
+
def list_rag_files request, options = nil
|
969
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
970
|
+
|
971
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::ListRagFilesRequest
|
972
|
+
|
973
|
+
# Converts hash and nil to an options object
|
974
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
975
|
+
|
976
|
+
# Customize the options with defaults
|
977
|
+
call_metadata = @config.rpcs.list_rag_files.metadata.to_h
|
978
|
+
|
979
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
980
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
981
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
982
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
983
|
+
transports_version_send: [:rest]
|
984
|
+
|
985
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
986
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
987
|
+
|
988
|
+
options.apply_defaults timeout: @config.rpcs.list_rag_files.timeout,
|
989
|
+
metadata: call_metadata,
|
990
|
+
retry_policy: @config.rpcs.list_rag_files.retry_policy
|
991
|
+
|
992
|
+
options.apply_defaults timeout: @config.timeout,
|
993
|
+
metadata: @config.metadata,
|
994
|
+
retry_policy: @config.retry_policy
|
995
|
+
|
996
|
+
@vertex_rag_data_service_stub.list_rag_files request, options do |result, operation|
|
997
|
+
result = ::Gapic::Rest::PagedEnumerable.new @vertex_rag_data_service_stub, :list_rag_files, "rag_files", request, result, options
|
998
|
+
yield result, operation if block_given?
|
999
|
+
return result
|
1000
|
+
end
|
1001
|
+
rescue ::Gapic::Rest::Error => e
|
1002
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1003
|
+
end
|
1004
|
+
|
1005
|
+
##
|
1006
|
+
# Deletes a RagFile.
|
1007
|
+
#
|
1008
|
+
# @overload delete_rag_file(request, options = nil)
|
1009
|
+
# Pass arguments to `delete_rag_file` via a request object, either of type
|
1010
|
+
# {::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest} or an equivalent Hash.
|
1011
|
+
#
|
1012
|
+
# @param request [::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest, ::Hash]
|
1013
|
+
# A request object representing the call parameters. Required. To specify no
|
1014
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
1015
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
1016
|
+
# Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
|
1017
|
+
#
|
1018
|
+
# @overload delete_rag_file(name: nil)
|
1019
|
+
# Pass arguments to `delete_rag_file` via keyword arguments. Note that at
|
1020
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
1021
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
1022
|
+
#
|
1023
|
+
# @param name [::String]
|
1024
|
+
# Required. The name of the RagFile resource to be deleted.
|
1025
|
+
# Format:
|
1026
|
+
# `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`
|
1027
|
+
# @yield [result, operation] Access the result along with the TransportOperation object
|
1028
|
+
# @yieldparam result [::Gapic::Operation]
|
1029
|
+
# @yieldparam operation [::Gapic::Rest::TransportOperation]
|
1030
|
+
#
|
1031
|
+
# @return [::Gapic::Operation]
|
1032
|
+
#
|
1033
|
+
# @raise [::Google::Cloud::Error] if the REST call is aborted.
|
1034
|
+
#
|
1035
|
+
# @example Basic example
|
1036
|
+
# require "google/cloud/ai_platform/v1"
|
1037
|
+
#
|
1038
|
+
# # Create a client object. The client can be reused for multiple calls.
|
1039
|
+
# client = Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new
|
1040
|
+
#
|
1041
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
1042
|
+
# request = Google::Cloud::AIPlatform::V1::DeleteRagFileRequest.new
|
1043
|
+
#
|
1044
|
+
# # Call the delete_rag_file method.
|
1045
|
+
# result = client.delete_rag_file request
|
1046
|
+
#
|
1047
|
+
# # The returned object is of type Gapic::Operation. You can use it to
|
1048
|
+
# # check the status of an operation, cancel it, or wait for results.
|
1049
|
+
# # Here is how to wait for a response.
|
1050
|
+
# result.wait_until_done! timeout: 60
|
1051
|
+
# if result.response?
|
1052
|
+
# p result.response
|
1053
|
+
# else
|
1054
|
+
# puts "No response received."
|
1055
|
+
# end
|
1056
|
+
#
|
1057
|
+
def delete_rag_file request, options = nil
|
1058
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
1059
|
+
|
1060
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::AIPlatform::V1::DeleteRagFileRequest
|
1061
|
+
|
1062
|
+
# Converts hash and nil to an options object
|
1063
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
1064
|
+
|
1065
|
+
# Customize the options with defaults
|
1066
|
+
call_metadata = @config.rpcs.delete_rag_file.metadata.to_h
|
1067
|
+
|
1068
|
+
# Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
|
1069
|
+
call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
1070
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
1071
|
+
gapic_version: ::Google::Cloud::AIPlatform::V1::VERSION,
|
1072
|
+
transports_version_send: [:rest]
|
1073
|
+
|
1074
|
+
call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
|
1075
|
+
call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
1076
|
+
|
1077
|
+
options.apply_defaults timeout: @config.rpcs.delete_rag_file.timeout,
|
1078
|
+
metadata: call_metadata,
|
1079
|
+
retry_policy: @config.rpcs.delete_rag_file.retry_policy
|
1080
|
+
|
1081
|
+
options.apply_defaults timeout: @config.timeout,
|
1082
|
+
metadata: @config.metadata,
|
1083
|
+
retry_policy: @config.retry_policy
|
1084
|
+
|
1085
|
+
@vertex_rag_data_service_stub.delete_rag_file request, options do |result, operation|
|
1086
|
+
result = ::Gapic::Operation.new result, @operations_client, options: options
|
1087
|
+
yield result, operation if block_given?
|
1088
|
+
return result
|
1089
|
+
end
|
1090
|
+
rescue ::Gapic::Rest::Error => e
|
1091
|
+
raise ::Google::Cloud::Error.from_error(e)
|
1092
|
+
end
|
1093
|
+
|
1094
|
+
##
|
1095
|
+
# Configuration class for the VertexRagDataService REST API.
|
1096
|
+
#
|
1097
|
+
# This class represents the configuration for VertexRagDataService REST,
|
1098
|
+
# providing control over timeouts, retry behavior, logging, transport
|
1099
|
+
# parameters, and other low-level controls. Certain parameters can also be
|
1100
|
+
# applied individually to specific RPCs. See
|
1101
|
+
# {::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client::Configuration::Rpcs}
|
1102
|
+
# for a list of RPCs that can be configured independently.
|
1103
|
+
#
|
1104
|
+
# Configuration can be applied globally to all clients, or to a single client
|
1105
|
+
# on construction.
|
1106
|
+
#
|
1107
|
+
# @example
|
1108
|
+
#
|
1109
|
+
# # Modify the global config, setting the timeout for
|
1110
|
+
# # create_rag_corpus to 20 seconds,
|
1111
|
+
# # and all remaining timeouts to 10 seconds.
|
1112
|
+
# ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.configure do |config|
|
1113
|
+
# config.timeout = 10.0
|
1114
|
+
# config.rpcs.create_rag_corpus.timeout = 20.0
|
1115
|
+
# end
|
1116
|
+
#
|
1117
|
+
# # Apply the above configuration only to a new client.
|
1118
|
+
# client = ::Google::Cloud::AIPlatform::V1::VertexRagDataService::Rest::Client.new do |config|
|
1119
|
+
# config.timeout = 10.0
|
1120
|
+
# config.rpcs.create_rag_corpus.timeout = 20.0
|
1121
|
+
# end
|
1122
|
+
#
|
1123
|
+
# @!attribute [rw] endpoint
|
1124
|
+
# A custom service endpoint, as a hostname or hostname:port. The default is
|
1125
|
+
# nil, indicating to use the default endpoint in the current universe domain.
|
1126
|
+
# @return [::String,nil]
|
1127
|
+
# @!attribute [rw] credentials
|
1128
|
+
# Credentials to send with calls. You may provide any of the following types:
|
1129
|
+
# * (`String`) The path to a service account key file in JSON format
|
1130
|
+
# * (`Hash`) A service account key as a Hash
|
1131
|
+
# * (`Google::Auth::Credentials`) A googleauth credentials object
|
1132
|
+
# (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
|
1133
|
+
# * (`Signet::OAuth2::Client`) A signet oauth2 client object
|
1134
|
+
# (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
|
1135
|
+
# * (`nil`) indicating no credentials
|
1136
|
+
# @return [::Object]
|
1137
|
+
# @!attribute [rw] scope
|
1138
|
+
# The OAuth scopes
|
1139
|
+
# @return [::Array<::String>]
|
1140
|
+
# @!attribute [rw] lib_name
|
1141
|
+
# The library name as recorded in instrumentation and logging
|
1142
|
+
# @return [::String]
|
1143
|
+
# @!attribute [rw] lib_version
|
1144
|
+
# The library version as recorded in instrumentation and logging
|
1145
|
+
# @return [::String]
|
1146
|
+
# @!attribute [rw] timeout
|
1147
|
+
# The call timeout in seconds.
|
1148
|
+
# @return [::Numeric]
|
1149
|
+
# @!attribute [rw] metadata
|
1150
|
+
# Additional headers to be sent with the call.
|
1151
|
+
# @return [::Hash{::Symbol=>::String}]
|
1152
|
+
# @!attribute [rw] retry_policy
|
1153
|
+
# The retry policy. The value is a hash with the following keys:
|
1154
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1155
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1156
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1157
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1158
|
+
# trigger a retry.
|
1159
|
+
# @return [::Hash]
|
1160
|
+
# @!attribute [rw] quota_project
|
1161
|
+
# A separate project against which to charge quota.
|
1162
|
+
# @return [::String]
|
1163
|
+
# @!attribute [rw] universe_domain
|
1164
|
+
# The universe domain within which to make requests. This determines the
|
1165
|
+
# default endpoint URL. The default value of nil uses the environment
|
1166
|
+
# universe (usually the default "googleapis.com" universe).
|
1167
|
+
# @return [::String,nil]
|
1168
|
+
#
|
1169
|
+
class Configuration
|
1170
|
+
extend ::Gapic::Config
|
1171
|
+
|
1172
|
+
# @private
|
1173
|
+
# The endpoint specific to the default "googleapis.com" universe. Deprecated.
|
1174
|
+
DEFAULT_ENDPOINT = "aiplatform.googleapis.com"
|
1175
|
+
|
1176
|
+
config_attr :endpoint, nil, ::String, nil
|
1177
|
+
config_attr :credentials, nil do |value|
|
1178
|
+
allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
|
1179
|
+
allowed.any? { |klass| klass === value }
|
1180
|
+
end
|
1181
|
+
config_attr :scope, nil, ::String, ::Array, nil
|
1182
|
+
config_attr :lib_name, nil, ::String, nil
|
1183
|
+
config_attr :lib_version, nil, ::String, nil
|
1184
|
+
config_attr :timeout, nil, ::Numeric, nil
|
1185
|
+
config_attr :metadata, nil, ::Hash, nil
|
1186
|
+
config_attr :retry_policy, nil, ::Hash, ::Proc, nil
|
1187
|
+
config_attr :quota_project, nil, ::String, nil
|
1188
|
+
config_attr :universe_domain, nil, ::String, nil
|
1189
|
+
|
1190
|
+
# @private
|
1191
|
+
# Overrides for http bindings for the RPCs of this service
|
1192
|
+
# are only used when this service is used as mixin, and only
|
1193
|
+
# by the host service.
|
1194
|
+
# @return [::Hash{::Symbol=>::Array<::Gapic::Rest::GrpcTranscoder::HttpBinding>}]
|
1195
|
+
config_attr :bindings_override, {}, ::Hash, nil
|
1196
|
+
|
1197
|
+
# @private
|
1198
|
+
def initialize parent_config = nil
|
1199
|
+
@parent_config = parent_config unless parent_config.nil?
|
1200
|
+
|
1201
|
+
yield self if block_given?
|
1202
|
+
end
|
1203
|
+
|
1204
|
+
##
|
1205
|
+
# Configurations for individual RPCs
|
1206
|
+
# @return [Rpcs]
|
1207
|
+
#
|
1208
|
+
def rpcs
|
1209
|
+
@rpcs ||= begin
|
1210
|
+
parent_rpcs = nil
|
1211
|
+
parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
|
1212
|
+
Rpcs.new parent_rpcs
|
1213
|
+
end
|
1214
|
+
end
|
1215
|
+
|
1216
|
+
##
|
1217
|
+
# Configuration RPC class for the VertexRagDataService API.
|
1218
|
+
#
|
1219
|
+
# Includes fields providing the configuration for each RPC in this service.
|
1220
|
+
# Each configuration object is of type `Gapic::Config::Method` and includes
|
1221
|
+
# the following configuration fields:
|
1222
|
+
#
|
1223
|
+
# * `timeout` (*type:* `Numeric`) - The call timeout in seconds
|
1224
|
+
# * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
|
1225
|
+
# * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
|
1226
|
+
# include the following keys:
|
1227
|
+
# * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
|
1228
|
+
# * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
|
1229
|
+
# * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
|
1230
|
+
# * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
|
1231
|
+
# trigger a retry.
|
1232
|
+
#
|
1233
|
+
class Rpcs
|
1234
|
+
##
|
1235
|
+
# RPC-specific configuration for `create_rag_corpus`
|
1236
|
+
# @return [::Gapic::Config::Method]
|
1237
|
+
#
|
1238
|
+
attr_reader :create_rag_corpus
|
1239
|
+
##
|
1240
|
+
# RPC-specific configuration for `update_rag_corpus`
|
1241
|
+
# @return [::Gapic::Config::Method]
|
1242
|
+
#
|
1243
|
+
attr_reader :update_rag_corpus
|
1244
|
+
##
|
1245
|
+
# RPC-specific configuration for `get_rag_corpus`
|
1246
|
+
# @return [::Gapic::Config::Method]
|
1247
|
+
#
|
1248
|
+
attr_reader :get_rag_corpus
|
1249
|
+
##
|
1250
|
+
# RPC-specific configuration for `list_rag_corpora`
|
1251
|
+
# @return [::Gapic::Config::Method]
|
1252
|
+
#
|
1253
|
+
attr_reader :list_rag_corpora
|
1254
|
+
##
|
1255
|
+
# RPC-specific configuration for `delete_rag_corpus`
|
1256
|
+
# @return [::Gapic::Config::Method]
|
1257
|
+
#
|
1258
|
+
attr_reader :delete_rag_corpus
|
1259
|
+
##
|
1260
|
+
# RPC-specific configuration for `upload_rag_file`
|
1261
|
+
# @return [::Gapic::Config::Method]
|
1262
|
+
#
|
1263
|
+
attr_reader :upload_rag_file
|
1264
|
+
##
|
1265
|
+
# RPC-specific configuration for `import_rag_files`
|
1266
|
+
# @return [::Gapic::Config::Method]
|
1267
|
+
#
|
1268
|
+
attr_reader :import_rag_files
|
1269
|
+
##
|
1270
|
+
# RPC-specific configuration for `get_rag_file`
|
1271
|
+
# @return [::Gapic::Config::Method]
|
1272
|
+
#
|
1273
|
+
attr_reader :get_rag_file
|
1274
|
+
##
|
1275
|
+
# RPC-specific configuration for `list_rag_files`
|
1276
|
+
# @return [::Gapic::Config::Method]
|
1277
|
+
#
|
1278
|
+
attr_reader :list_rag_files
|
1279
|
+
##
|
1280
|
+
# RPC-specific configuration for `delete_rag_file`
|
1281
|
+
# @return [::Gapic::Config::Method]
|
1282
|
+
#
|
1283
|
+
attr_reader :delete_rag_file
|
1284
|
+
|
1285
|
+
# @private
|
1286
|
+
def initialize parent_rpcs = nil
|
1287
|
+
create_rag_corpus_config = parent_rpcs.create_rag_corpus if parent_rpcs.respond_to? :create_rag_corpus
|
1288
|
+
@create_rag_corpus = ::Gapic::Config::Method.new create_rag_corpus_config
|
1289
|
+
update_rag_corpus_config = parent_rpcs.update_rag_corpus if parent_rpcs.respond_to? :update_rag_corpus
|
1290
|
+
@update_rag_corpus = ::Gapic::Config::Method.new update_rag_corpus_config
|
1291
|
+
get_rag_corpus_config = parent_rpcs.get_rag_corpus if parent_rpcs.respond_to? :get_rag_corpus
|
1292
|
+
@get_rag_corpus = ::Gapic::Config::Method.new get_rag_corpus_config
|
1293
|
+
list_rag_corpora_config = parent_rpcs.list_rag_corpora if parent_rpcs.respond_to? :list_rag_corpora
|
1294
|
+
@list_rag_corpora = ::Gapic::Config::Method.new list_rag_corpora_config
|
1295
|
+
delete_rag_corpus_config = parent_rpcs.delete_rag_corpus if parent_rpcs.respond_to? :delete_rag_corpus
|
1296
|
+
@delete_rag_corpus = ::Gapic::Config::Method.new delete_rag_corpus_config
|
1297
|
+
upload_rag_file_config = parent_rpcs.upload_rag_file if parent_rpcs.respond_to? :upload_rag_file
|
1298
|
+
@upload_rag_file = ::Gapic::Config::Method.new upload_rag_file_config
|
1299
|
+
import_rag_files_config = parent_rpcs.import_rag_files if parent_rpcs.respond_to? :import_rag_files
|
1300
|
+
@import_rag_files = ::Gapic::Config::Method.new import_rag_files_config
|
1301
|
+
get_rag_file_config = parent_rpcs.get_rag_file if parent_rpcs.respond_to? :get_rag_file
|
1302
|
+
@get_rag_file = ::Gapic::Config::Method.new get_rag_file_config
|
1303
|
+
list_rag_files_config = parent_rpcs.list_rag_files if parent_rpcs.respond_to? :list_rag_files
|
1304
|
+
@list_rag_files = ::Gapic::Config::Method.new list_rag_files_config
|
1305
|
+
delete_rag_file_config = parent_rpcs.delete_rag_file if parent_rpcs.respond_to? :delete_rag_file
|
1306
|
+
@delete_rag_file = ::Gapic::Config::Method.new delete_rag_file_config
|
1307
|
+
|
1308
|
+
yield self if block_given?
|
1309
|
+
end
|
1310
|
+
end
|
1311
|
+
end
|
1312
|
+
end
|
1313
|
+
end
|
1314
|
+
end
|
1315
|
+
end
|
1316
|
+
end
|
1317
|
+
end
|
1318
|
+
end
|