@BetaApi @Generated(value="by gapic-generator-java") public class VertexRagDataServiceClient extends Object implements com.google.api.gax.core.BackgroundResource
This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagCorpusName name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]");
RagCorpus response = vertexRagDataServiceClient.getRagCorpus(name);
}
Note: close() needs to be called on the VertexRagDataServiceClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().
| Method | Description | Method Variants |
|---|---|---|
CreateRagCorpus |
Creates a RagCorpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateRagCorpus |
Updates a RagCorpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRagCorpus |
Gets a RagCorpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRagCorpora |
Lists RagCorpora in a Location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteRagCorpus |
Deletes a RagCorpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UploadRagFile |
Upload a file into a RagCorpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ImportRagFiles |
Import files from Google Cloud Storage or Google Drive into a RagCorpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRagFile |
Gets a RagFile. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListRagFiles |
Lists RagFiles in a RagCorpus. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
DeleteRagFile |
Deletes a RagFile. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
UpdateRagEngineConfig |
Updates a RagEngineConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Methods that return long-running operations have "Async" method variants that return `OperationFuture`, which is used to track polling of the service.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetRagEngineConfig |
Gets a RagEngineConfig. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
"Flattened" method variants have converted the fields of the request object into function parameters to enable multiple ways to call the same method.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
ListLocations |
Lists information about the supported locations for this service. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetLocation |
Gets information about a location. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
SetIamPolicy |
Sets the access control policy on the specified resource. Replacesany existing policy. Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
GetIamPolicy |
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
TestIamPermissions |
Returns permissions that a caller has on the specified resource. If theresource does not exist, this will return an empty set ofpermissions, not a `NOT_FOUND` error. Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning. |
Request object method variants only take one parameter, a request object, which must be constructed before the call.
Callable method variants take no parameters and return an immutable API callable object, which can be used to initiate calls to the service.
|
See the individual methods for example code.
Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.
This class can be customized by passing in a custom instance of VertexRagDataServiceSettings to create(). For example:
To customize credentials:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
VertexRagDataServiceSettings vertexRagDataServiceSettings =
VertexRagDataServiceSettings.newBuilder()
.setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
.build();
VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create(vertexRagDataServiceSettings);
To customize the endpoint:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
VertexRagDataServiceSettings vertexRagDataServiceSettings =
VertexRagDataServiceSettings.newBuilder().setEndpoint(myEndpoint).build();
VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create(vertexRagDataServiceSettings);
Please refer to the GitHub repository's samples for more quickstart code snippets.
| Modifier and Type | Class and Description |
|---|---|
static class |
VertexRagDataServiceClient.ListLocationsFixedSizeCollection |
static class |
VertexRagDataServiceClient.ListLocationsPage |
static class |
VertexRagDataServiceClient.ListLocationsPagedResponse |
static class |
VertexRagDataServiceClient.ListRagCorporaFixedSizeCollection |
static class |
VertexRagDataServiceClient.ListRagCorporaPage |
static class |
VertexRagDataServiceClient.ListRagCorporaPagedResponse |
static class |
VertexRagDataServiceClient.ListRagFilesFixedSizeCollection |
static class |
VertexRagDataServiceClient.ListRagFilesPage |
static class |
VertexRagDataServiceClient.ListRagFilesPagedResponse |
| Modifier | Constructor and Description |
|---|---|
protected |
VertexRagDataServiceClient(VertexRagDataServiceSettings settings)
Constructs an instance of VertexRagDataServiceClient, using the given settings.
|
protected |
VertexRagDataServiceClient(VertexRagDataServiceStub stub) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
awaitTermination(long duration,
TimeUnit unit) |
void |
close() |
static VertexRagDataServiceClient |
create()
Constructs an instance of VertexRagDataServiceClient with default settings.
|
static VertexRagDataServiceClient |
create(VertexRagDataServiceSettings settings)
Constructs an instance of VertexRagDataServiceClient, using the given settings.
|
static VertexRagDataServiceClient |
create(VertexRagDataServiceStub stub)
Constructs an instance of VertexRagDataServiceClient, using the given stub for making calls.
|
com.google.api.gax.longrunning.OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> |
createRagCorpusAsync(CreateRagCorpusRequest request)
Creates a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> |
createRagCorpusAsync(LocationName parent,
RagCorpus ragCorpus)
Creates a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> |
createRagCorpusAsync(String parent,
RagCorpus ragCorpus)
Creates a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<CreateRagCorpusRequest,com.google.longrunning.Operation> |
createRagCorpusCallable()
Creates a RagCorpus.
|
com.google.api.gax.rpc.OperationCallable<CreateRagCorpusRequest,RagCorpus,CreateRagCorpusOperationMetadata> |
createRagCorpusOperationCallable()
Creates a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagCorpusAsync(DeleteRagCorpusRequest request)
Deletes a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagCorpusAsync(RagCorpusName name)
Deletes a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagCorpusAsync(String name)
Deletes a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRagCorpusRequest,com.google.longrunning.Operation> |
deleteRagCorpusCallable()
Deletes a RagCorpus.
|
com.google.api.gax.rpc.OperationCallable<DeleteRagCorpusRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagCorpusOperationCallable()
Deletes a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagFileAsync(DeleteRagFileRequest request)
Deletes a RagFile.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagFileAsync(RagFileName name)
Deletes a RagFile.
|
com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagFileAsync(String name)
Deletes a RagFile.
|
com.google.api.gax.rpc.UnaryCallable<DeleteRagFileRequest,com.google.longrunning.Operation> |
deleteRagFileCallable()
Deletes a RagFile.
|
com.google.api.gax.rpc.OperationCallable<DeleteRagFileRequest,com.google.protobuf.Empty,DeleteOperationMetadata> |
deleteRagFileOperationCallable()
Deletes a RagFile.
|
com.google.iam.v1.Policy |
getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Gets the access control policy for a resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getIamPolicyCallable()
Gets the access control policy for a resource.
|
com.google.cloud.location.Location |
getLocation(com.google.cloud.location.GetLocationRequest request)
Gets information about a location.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getLocationCallable()
Gets information about a location.
|
com.google.longrunning.OperationsClient |
getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation
returned by another API method call.
|
RagCorpus |
getRagCorpus(GetRagCorpusRequest request)
Gets a RagCorpus.
|
RagCorpus |
getRagCorpus(RagCorpusName name)
Gets a RagCorpus.
|
RagCorpus |
getRagCorpus(String name)
Gets a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<GetRagCorpusRequest,RagCorpus> |
getRagCorpusCallable()
Gets a RagCorpus.
|
RagEngineConfig |
getRagEngineConfig(GetRagEngineConfigRequest request)
Gets a RagEngineConfig.
|
RagEngineConfig |
getRagEngineConfig(RagEngineConfigName name)
Gets a RagEngineConfig.
|
RagEngineConfig |
getRagEngineConfig(String name)
Gets a RagEngineConfig.
|
com.google.api.gax.rpc.UnaryCallable<GetRagEngineConfigRequest,RagEngineConfig> |
getRagEngineConfigCallable()
Gets a RagEngineConfig.
|
RagFile |
getRagFile(GetRagFileRequest request)
Gets a RagFile.
|
RagFile |
getRagFile(RagFileName name)
Gets a RagFile.
|
RagFile |
getRagFile(String name)
Gets a RagFile.
|
com.google.api.gax.rpc.UnaryCallable<GetRagFileRequest,RagFile> |
getRagFileCallable()
Gets a RagFile.
|
VertexRagDataServiceSettings |
getSettings() |
VertexRagDataServiceStub |
getStub() |
com.google.api.gax.longrunning.OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
importRagFilesAsync(ImportRagFilesRequest request)
Import files from Google Cloud Storage or Google Drive into a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
importRagFilesAsync(RagCorpusName parent,
ImportRagFilesConfig importRagFilesConfig)
Import files from Google Cloud Storage or Google Drive into a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
importRagFilesAsync(String parent,
ImportRagFilesConfig importRagFilesConfig)
Import files from Google Cloud Storage or Google Drive into a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<ImportRagFilesRequest,com.google.longrunning.Operation> |
importRagFilesCallable()
Import files from Google Cloud Storage or Google Drive into a RagCorpus.
|
com.google.api.gax.rpc.OperationCallable<ImportRagFilesRequest,ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
importRagFilesOperationCallable()
Import files from Google Cloud Storage or Google Drive into a RagCorpus.
|
boolean |
isShutdown() |
boolean |
isTerminated() |
VertexRagDataServiceClient.ListLocationsPagedResponse |
listLocations(com.google.cloud.location.ListLocationsRequest request)
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
listLocationsCallable()
Lists information about the supported locations for this service.
|
com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,VertexRagDataServiceClient.ListLocationsPagedResponse> |
listLocationsPagedCallable()
Lists information about the supported locations for this service.
|
VertexRagDataServiceClient.ListRagCorporaPagedResponse |
listRagCorpora(ListRagCorporaRequest request)
Lists RagCorpora in a Location.
|
VertexRagDataServiceClient.ListRagCorporaPagedResponse |
listRagCorpora(LocationName parent)
Lists RagCorpora in a Location.
|
VertexRagDataServiceClient.ListRagCorporaPagedResponse |
listRagCorpora(String parent)
Lists RagCorpora in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListRagCorporaRequest,ListRagCorporaResponse> |
listRagCorporaCallable()
Lists RagCorpora in a Location.
|
com.google.api.gax.rpc.UnaryCallable<ListRagCorporaRequest,VertexRagDataServiceClient.ListRagCorporaPagedResponse> |
listRagCorporaPagedCallable()
Lists RagCorpora in a Location.
|
VertexRagDataServiceClient.ListRagFilesPagedResponse |
listRagFiles(ListRagFilesRequest request)
Lists RagFiles in a RagCorpus.
|
VertexRagDataServiceClient.ListRagFilesPagedResponse |
listRagFiles(RagCorpusName parent)
Lists RagFiles in a RagCorpus.
|
VertexRagDataServiceClient.ListRagFilesPagedResponse |
listRagFiles(String parent)
Lists RagFiles in a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<ListRagFilesRequest,ListRagFilesResponse> |
listRagFilesCallable()
Lists RagFiles in a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<ListRagFilesRequest,VertexRagDataServiceClient.ListRagFilesPagedResponse> |
listRagFilesPagedCallable()
Lists RagFiles in a RagCorpus.
|
com.google.iam.v1.Policy |
setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Sets the access control policy on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
setIamPolicyCallable()
Sets the access control policy on the specified resource.
|
void |
shutdown() |
void |
shutdownNow() |
com.google.iam.v1.TestIamPermissionsResponse |
testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
testIamPermissionsCallable()
Returns permissions that a caller has on the specified resource.
|
com.google.api.gax.longrunning.OperationFuture<RagCorpus,UpdateRagCorpusOperationMetadata> |
updateRagCorpusAsync(RagCorpus ragCorpus)
Updates a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<RagCorpus,UpdateRagCorpusOperationMetadata> |
updateRagCorpusAsync(UpdateRagCorpusRequest request)
Updates a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<UpdateRagCorpusRequest,com.google.longrunning.Operation> |
updateRagCorpusCallable()
Updates a RagCorpus.
|
com.google.api.gax.rpc.OperationCallable<UpdateRagCorpusRequest,RagCorpus,UpdateRagCorpusOperationMetadata> |
updateRagCorpusOperationCallable()
Updates a RagCorpus.
|
com.google.api.gax.longrunning.OperationFuture<RagEngineConfig,UpdateRagEngineConfigOperationMetadata> |
updateRagEngineConfigAsync(RagEngineConfig ragEngineConfig)
Updates a RagEngineConfig.
|
com.google.api.gax.longrunning.OperationFuture<RagEngineConfig,UpdateRagEngineConfigOperationMetadata> |
updateRagEngineConfigAsync(UpdateRagEngineConfigRequest request)
Updates a RagEngineConfig.
|
com.google.api.gax.rpc.UnaryCallable<UpdateRagEngineConfigRequest,com.google.longrunning.Operation> |
updateRagEngineConfigCallable()
Updates a RagEngineConfig.
|
com.google.api.gax.rpc.OperationCallable<UpdateRagEngineConfigRequest,RagEngineConfig,UpdateRagEngineConfigOperationMetadata> |
updateRagEngineConfigOperationCallable()
Updates a RagEngineConfig.
|
UploadRagFileResponse |
uploadRagFile(RagCorpusName parent,
RagFile ragFile,
UploadRagFileConfig uploadRagFileConfig)
Upload a file into a RagCorpus.
|
UploadRagFileResponse |
uploadRagFile(String parent,
RagFile ragFile,
UploadRagFileConfig uploadRagFileConfig)
Upload a file into a RagCorpus.
|
UploadRagFileResponse |
uploadRagFile(UploadRagFileRequest request)
Upload a file into a RagCorpus.
|
com.google.api.gax.rpc.UnaryCallable<UploadRagFileRequest,UploadRagFileResponse> |
uploadRagFileCallable()
Upload a file into a RagCorpus.
|
protected VertexRagDataServiceClient(VertexRagDataServiceSettings settings) throws IOException
IOExceptionprotected VertexRagDataServiceClient(VertexRagDataServiceStub stub)
public static final VertexRagDataServiceClient create() throws IOException
IOExceptionpublic static final VertexRagDataServiceClient create(VertexRagDataServiceSettings settings) throws IOException
IOExceptionpublic static final VertexRagDataServiceClient create(VertexRagDataServiceStub stub)
public final VertexRagDataServiceSettings getSettings()
public VertexRagDataServiceStub getStub()
public final com.google.longrunning.OperationsClient getOperationsClient()
public final com.google.api.gax.longrunning.OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusAsync(LocationName parent, RagCorpus ragCorpus)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
RagCorpus ragCorpus = RagCorpus.newBuilder().build();
RagCorpus response = vertexRagDataServiceClient.createRagCorpusAsync(parent, ragCorpus).get();
}
parent - Required. The resource name of the Location to create the RagCorpus in. Format:
`projects/{project}/locations/{location}`ragCorpus - Required. The RagCorpus to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusAsync(String parent, RagCorpus ragCorpus)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
RagCorpus ragCorpus = RagCorpus.newBuilder().build();
RagCorpus response = vertexRagDataServiceClient.createRagCorpusAsync(parent, ragCorpus).get();
}
parent - Required. The resource name of the Location to create the RagCorpus in. Format:
`projects/{project}/locations/{location}`ragCorpus - Required. The RagCorpus to create.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusAsync(CreateRagCorpusRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
CreateRagCorpusRequest request =
CreateRagCorpusRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRagCorpus(RagCorpus.newBuilder().build())
.build();
RagCorpus response = vertexRagDataServiceClient.createRagCorpusAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<CreateRagCorpusRequest,RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
CreateRagCorpusRequest request =
CreateRagCorpusRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRagCorpus(RagCorpus.newBuilder().build())
.build();
OperationFuture<RagCorpus, CreateRagCorpusOperationMetadata> future =
vertexRagDataServiceClient.createRagCorpusOperationCallable().futureCall(request);
// Do something.
RagCorpus response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<CreateRagCorpusRequest,com.google.longrunning.Operation> createRagCorpusCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
CreateRagCorpusRequest request =
CreateRagCorpusRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setRagCorpus(RagCorpus.newBuilder().build())
.build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.createRagCorpusCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<RagCorpus,UpdateRagCorpusOperationMetadata> updateRagCorpusAsync(RagCorpus ragCorpus)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagCorpus ragCorpus = RagCorpus.newBuilder().build();
RagCorpus response = vertexRagDataServiceClient.updateRagCorpusAsync(ragCorpus).get();
}
ragCorpus - Required. The RagCorpus which replaces the resource on the server.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RagCorpus,UpdateRagCorpusOperationMetadata> updateRagCorpusAsync(UpdateRagCorpusRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UpdateRagCorpusRequest request =
UpdateRagCorpusRequest.newBuilder().setRagCorpus(RagCorpus.newBuilder().build()).build();
RagCorpus response = vertexRagDataServiceClient.updateRagCorpusAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateRagCorpusRequest,RagCorpus,UpdateRagCorpusOperationMetadata> updateRagCorpusOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UpdateRagCorpusRequest request =
UpdateRagCorpusRequest.newBuilder().setRagCorpus(RagCorpus.newBuilder().build()).build();
OperationFuture<RagCorpus, UpdateRagCorpusOperationMetadata> future =
vertexRagDataServiceClient.updateRagCorpusOperationCallable().futureCall(request);
// Do something.
RagCorpus response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateRagCorpusRequest,com.google.longrunning.Operation> updateRagCorpusCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UpdateRagCorpusRequest request =
UpdateRagCorpusRequest.newBuilder().setRagCorpus(RagCorpus.newBuilder().build()).build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.updateRagCorpusCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final RagCorpus getRagCorpus(RagCorpusName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagCorpusName name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]");
RagCorpus response = vertexRagDataServiceClient.getRagCorpus(name);
}
name - Required. The name of the RagCorpus resource. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final RagCorpus getRagCorpus(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString();
RagCorpus response = vertexRagDataServiceClient.getRagCorpus(name);
}
name - Required. The name of the RagCorpus resource. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final RagCorpus getRagCorpus(GetRagCorpusRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetRagCorpusRequest request =
GetRagCorpusRequest.newBuilder()
.setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.build();
RagCorpus response = vertexRagDataServiceClient.getRagCorpus(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRagCorpusRequest,RagCorpus> getRagCorpusCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetRagCorpusRequest request =
GetRagCorpusRequest.newBuilder()
.setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.build();
ApiFuture<RagCorpus> future =
vertexRagDataServiceClient.getRagCorpusCallable().futureCall(request);
// Do something.
RagCorpus response = future.get();
}
public final VertexRagDataServiceClient.ListRagCorporaPagedResponse listRagCorpora(LocationName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
for (RagCorpus element : vertexRagDataServiceClient.listRagCorpora(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location from which to list the RagCorpora.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final VertexRagDataServiceClient.ListRagCorporaPagedResponse listRagCorpora(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (RagCorpus element : vertexRagDataServiceClient.listRagCorpora(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the Location from which to list the RagCorpora.
Format: `projects/{project}/locations/{location}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final VertexRagDataServiceClient.ListRagCorporaPagedResponse listRagCorpora(ListRagCorporaRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListRagCorporaRequest request =
ListRagCorporaRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (RagCorpus element : vertexRagDataServiceClient.listRagCorpora(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRagCorporaRequest,VertexRagDataServiceClient.ListRagCorporaPagedResponse> listRagCorporaPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListRagCorporaRequest request =
ListRagCorporaRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<RagCorpus> future =
vertexRagDataServiceClient.listRagCorporaPagedCallable().futureCall(request);
// Do something.
for (RagCorpus element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRagCorporaRequest,ListRagCorporaResponse> listRagCorporaCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListRagCorporaRequest request =
ListRagCorporaRequest.newBuilder()
.setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListRagCorporaResponse response =
vertexRagDataServiceClient.listRagCorporaCallable().call(request);
for (RagCorpus element : response.getRagCorporaList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusAsync(RagCorpusName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagCorpusName name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]");
vertexRagDataServiceClient.deleteRagCorpusAsync(name).get();
}
name - Required. The name of the RagCorpus resource to be deleted. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString();
vertexRagDataServiceClient.deleteRagCorpusAsync(name).get();
}
name - Required. The name of the RagCorpus resource to be deleted. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusAsync(DeleteRagCorpusRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
DeleteRagCorpusRequest request =
DeleteRagCorpusRequest.newBuilder()
.setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setForce(true)
.build();
vertexRagDataServiceClient.deleteRagCorpusAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteRagCorpusRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
DeleteRagCorpusRequest request =
DeleteRagCorpusRequest.newBuilder()
.setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setForce(true)
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
vertexRagDataServiceClient.deleteRagCorpusOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteRagCorpusRequest,com.google.longrunning.Operation> deleteRagCorpusCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
DeleteRagCorpusRequest request =
DeleteRagCorpusRequest.newBuilder()
.setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setForce(true)
.build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.deleteRagCorpusCallable().futureCall(request);
// Do something.
future.get();
}
public final UploadRagFileResponse uploadRagFile(RagCorpusName parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagCorpusName parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]");
RagFile ragFile = RagFile.newBuilder().build();
UploadRagFileConfig uploadRagFileConfig = UploadRagFileConfig.newBuilder().build();
UploadRagFileResponse response =
vertexRagDataServiceClient.uploadRagFile(parent, ragFile, uploadRagFileConfig);
}
parent - Required. The name of the RagCorpus resource into which to upload the file.
Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`ragFile - Required. The RagFile to upload.uploadRagFileConfig - Required. The config for the RagFiles to be uploaded into the
RagCorpus.
[VertexRagDataService.UploadRagFile][google.cloud.aiplatform.v1beta1.VertexRagDataService.UploadRagFile].com.google.api.gax.rpc.ApiException - if the remote call failspublic final UploadRagFileResponse uploadRagFile(String parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString();
RagFile ragFile = RagFile.newBuilder().build();
UploadRagFileConfig uploadRagFileConfig = UploadRagFileConfig.newBuilder().build();
UploadRagFileResponse response =
vertexRagDataServiceClient.uploadRagFile(parent, ragFile, uploadRagFileConfig);
}
parent - Required. The name of the RagCorpus resource into which to upload the file.
Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`ragFile - Required. The RagFile to upload.uploadRagFileConfig - Required. The config for the RagFiles to be uploaded into the
RagCorpus.
[VertexRagDataService.UploadRagFile][google.cloud.aiplatform.v1beta1.VertexRagDataService.UploadRagFile].com.google.api.gax.rpc.ApiException - if the remote call failspublic final UploadRagFileResponse uploadRagFile(UploadRagFileRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UploadRagFileRequest request =
UploadRagFileRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setRagFile(RagFile.newBuilder().build())
.setUploadRagFileConfig(UploadRagFileConfig.newBuilder().build())
.build();
UploadRagFileResponse response = vertexRagDataServiceClient.uploadRagFile(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<UploadRagFileRequest,UploadRagFileResponse> uploadRagFileCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UploadRagFileRequest request =
UploadRagFileRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setRagFile(RagFile.newBuilder().build())
.setUploadRagFileConfig(UploadRagFileConfig.newBuilder().build())
.build();
ApiFuture<UploadRagFileResponse> future =
vertexRagDataServiceClient.uploadRagFileCallable().futureCall(request);
// Do something.
UploadRagFileResponse response = future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesAsync(RagCorpusName parent, ImportRagFilesConfig importRagFilesConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagCorpusName parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]");
ImportRagFilesConfig importRagFilesConfig = ImportRagFilesConfig.newBuilder().build();
ImportRagFilesResponse response =
vertexRagDataServiceClient.importRagFilesAsync(parent, importRagFilesConfig).get();
}
parent - Required. The name of the RagCorpus resource into which to import files. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`importRagFilesConfig - Required. The config for the RagFiles to be synced and imported
into the RagCorpus.
[VertexRagDataService.ImportRagFiles][google.cloud.aiplatform.v1beta1.VertexRagDataService.ImportRagFiles].com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesAsync(String parent, ImportRagFilesConfig importRagFilesConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString();
ImportRagFilesConfig importRagFilesConfig = ImportRagFilesConfig.newBuilder().build();
ImportRagFilesResponse response =
vertexRagDataServiceClient.importRagFilesAsync(parent, importRagFilesConfig).get();
}
parent - Required. The name of the RagCorpus resource into which to import files. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`importRagFilesConfig - Required. The config for the RagFiles to be synced and imported
into the RagCorpus.
[VertexRagDataService.ImportRagFiles][google.cloud.aiplatform.v1beta1.VertexRagDataService.ImportRagFiles].com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesAsync(ImportRagFilesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ImportRagFilesRequest request =
ImportRagFilesRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setImportRagFilesConfig(ImportRagFilesConfig.newBuilder().build())
.build();
ImportRagFilesResponse response =
vertexRagDataServiceClient.importRagFilesAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<ImportRagFilesRequest,ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ImportRagFilesRequest request =
ImportRagFilesRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setImportRagFilesConfig(ImportRagFilesConfig.newBuilder().build())
.build();
OperationFuture<ImportRagFilesResponse, ImportRagFilesOperationMetadata> future =
vertexRagDataServiceClient.importRagFilesOperationCallable().futureCall(request);
// Do something.
ImportRagFilesResponse response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<ImportRagFilesRequest,com.google.longrunning.Operation> importRagFilesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ImportRagFilesRequest request =
ImportRagFilesRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setImportRagFilesConfig(ImportRagFilesConfig.newBuilder().build())
.build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.importRagFilesCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final RagFile getRagFile(RagFileName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagFileName name = RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]");
RagFile response = vertexRagDataServiceClient.getRagFile(name);
}
name - Required. The name of the RagFile resource. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final RagFile getRagFile(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String name =
RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]").toString();
RagFile response = vertexRagDataServiceClient.getRagFile(name);
}
name - Required. The name of the RagFile resource. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final RagFile getRagFile(GetRagFileRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetRagFileRequest request =
GetRagFileRequest.newBuilder()
.setName(
RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]")
.toString())
.build();
RagFile response = vertexRagDataServiceClient.getRagFile(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRagFileRequest,RagFile> getRagFileCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetRagFileRequest request =
GetRagFileRequest.newBuilder()
.setName(
RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]")
.toString())
.build();
ApiFuture<RagFile> future =
vertexRagDataServiceClient.getRagFileCallable().futureCall(request);
// Do something.
RagFile response = future.get();
}
public final VertexRagDataServiceClient.ListRagFilesPagedResponse listRagFiles(RagCorpusName parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagCorpusName parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]");
for (RagFile element : vertexRagDataServiceClient.listRagFiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the RagCorpus from which to list the RagFiles.
Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final VertexRagDataServiceClient.ListRagFilesPagedResponse listRagFiles(String parent)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString();
for (RagFile element : vertexRagDataServiceClient.listRagFiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
parent - Required. The resource name of the RagCorpus from which to list the RagFiles.
Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final VertexRagDataServiceClient.ListRagFilesPagedResponse listRagFiles(ListRagFilesRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListRagFilesRequest request =
ListRagFilesRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (RagFile element : vertexRagDataServiceClient.listRagFiles(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<ListRagFilesRequest,VertexRagDataServiceClient.ListRagFilesPagedResponse> listRagFilesPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListRagFilesRequest request =
ListRagFilesRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<RagFile> future =
vertexRagDataServiceClient.listRagFilesPagedCallable().futureCall(request);
// Do something.
for (RagFile element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<ListRagFilesRequest,ListRagFilesResponse> listRagFilesCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListRagFilesRequest request =
ListRagFilesRequest.newBuilder()
.setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString())
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListRagFilesResponse response =
vertexRagDataServiceClient.listRagFilesCallable().call(request);
for (RagFile element : response.getRagFilesList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(RagFileName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagFileName name = RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]");
vertexRagDataServiceClient.deleteRagFileAsync(name).get();
}
name - Required. The name of the RagFile resource to be deleted. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String name =
RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]").toString();
vertexRagDataServiceClient.deleteRagFileAsync(name).get();
}
name - Required. The name of the RagFile resource to be deleted. Format:
`projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(DeleteRagFileRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
DeleteRagFileRequest request =
DeleteRagFileRequest.newBuilder()
.setName(
RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]")
.toString())
.build();
vertexRagDataServiceClient.deleteRagFileAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<DeleteRagFileRequest,com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
DeleteRagFileRequest request =
DeleteRagFileRequest.newBuilder()
.setName(
RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]")
.toString())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
vertexRagDataServiceClient.deleteRagFileOperationCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<DeleteRagFileRequest,com.google.longrunning.Operation> deleteRagFileCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
DeleteRagFileRequest request =
DeleteRagFileRequest.newBuilder()
.setName(
RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]")
.toString())
.build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.deleteRagFileCallable().futureCall(request);
// Do something.
future.get();
}
public final com.google.api.gax.longrunning.OperationFuture<RagEngineConfig,UpdateRagEngineConfigOperationMetadata> updateRagEngineConfigAsync(RagEngineConfig ragEngineConfig)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagEngineConfig ragEngineConfig = RagEngineConfig.newBuilder().build();
RagEngineConfig response =
vertexRagDataServiceClient.updateRagEngineConfigAsync(ragEngineConfig).get();
}
ragEngineConfig - Required. The updated RagEngineConfig.
NOTE: Downgrading your RagManagedDb's ComputeTier could temporarily increase request latencies until the operation is fully complete.
com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.longrunning.OperationFuture<RagEngineConfig,UpdateRagEngineConfigOperationMetadata> updateRagEngineConfigAsync(UpdateRagEngineConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UpdateRagEngineConfigRequest request =
UpdateRagEngineConfigRequest.newBuilder()
.setRagEngineConfig(RagEngineConfig.newBuilder().build())
.build();
RagEngineConfig response =
vertexRagDataServiceClient.updateRagEngineConfigAsync(request).get();
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.OperationCallable<UpdateRagEngineConfigRequest,RagEngineConfig,UpdateRagEngineConfigOperationMetadata> updateRagEngineConfigOperationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UpdateRagEngineConfigRequest request =
UpdateRagEngineConfigRequest.newBuilder()
.setRagEngineConfig(RagEngineConfig.newBuilder().build())
.build();
OperationFuture<RagEngineConfig, UpdateRagEngineConfigOperationMetadata> future =
vertexRagDataServiceClient.updateRagEngineConfigOperationCallable().futureCall(request);
// Do something.
RagEngineConfig response = future.get();
}
public final com.google.api.gax.rpc.UnaryCallable<UpdateRagEngineConfigRequest,com.google.longrunning.Operation> updateRagEngineConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
UpdateRagEngineConfigRequest request =
UpdateRagEngineConfigRequest.newBuilder()
.setRagEngineConfig(RagEngineConfig.newBuilder().build())
.build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.updateRagEngineConfigCallable().futureCall(request);
// Do something.
Operation response = future.get();
}
public final RagEngineConfig getRagEngineConfig(RagEngineConfigName name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
RagEngineConfigName name = RagEngineConfigName.of("[PROJECT]", "[LOCATION]");
RagEngineConfig response = vertexRagDataServiceClient.getRagEngineConfig(name);
}
name - Required. The name of the RagEngineConfig resource. Format:
`projects/{project}/locations/{location}/ragEngineConfig`com.google.api.gax.rpc.ApiException - if the remote call failspublic final RagEngineConfig getRagEngineConfig(String name)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
String name = RagEngineConfigName.of("[PROJECT]", "[LOCATION]").toString();
RagEngineConfig response = vertexRagDataServiceClient.getRagEngineConfig(name);
}
name - Required. The name of the RagEngineConfig resource. Format:
`projects/{project}/locations/{location}/ragEngineConfig`com.google.api.gax.rpc.ApiException - if the remote call failspublic final RagEngineConfig getRagEngineConfig(GetRagEngineConfigRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetRagEngineConfigRequest request =
GetRagEngineConfigRequest.newBuilder()
.setName(RagEngineConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
RagEngineConfig response = vertexRagDataServiceClient.getRagEngineConfig(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<GetRagEngineConfigRequest,RagEngineConfig> getRagEngineConfigCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetRagEngineConfigRequest request =
GetRagEngineConfigRequest.newBuilder()
.setName(RagEngineConfigName.of("[PROJECT]", "[LOCATION]").toString())
.build();
ApiFuture<RagEngineConfig> future =
vertexRagDataServiceClient.getRagEngineConfigCallable().futureCall(request);
// Do something.
RagEngineConfig response = future.get();
}
public final VertexRagDataServiceClient.ListLocationsPagedResponse listLocations(com.google.cloud.location.ListLocationsRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
for (Location element : vertexRagDataServiceClient.listLocations(request).iterateAll()) {
// doThingsWith(element);
}
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,VertexRagDataServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
ApiFuture<Location> future =
vertexRagDataServiceClient.listLocationsPagedCallable().futureCall(request);
// Do something.
for (Location element : future.get().iterateAll()) {
// doThingsWith(element);
}
}
public final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> listLocationsCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
ListLocationsRequest request =
ListLocationsRequest.newBuilder()
.setName("name3373707")
.setFilter("filter-1274492040")
.setPageSize(883849137)
.setPageToken("pageToken873572522")
.build();
while (true) {
ListLocationsResponse response =
vertexRagDataServiceClient.listLocationsCallable().call(request);
for (Location element : response.getLocationsList()) {
// doThingsWith(element);
}
String nextPageToken = response.getNextPageToken();
if (!Strings.isNullOrEmpty(nextPageToken)) {
request = request.toBuilder().setPageToken(nextPageToken).build();
} else {
break;
}
}
}
public final com.google.cloud.location.Location getLocation(com.google.cloud.location.GetLocationRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
Location response = vertexRagDataServiceClient.getLocation(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> getLocationCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetLocationRequest request = GetLocationRequest.newBuilder().setName("name3373707").build();
ApiFuture<Location> future =
vertexRagDataServiceClient.getLocationCallable().futureCall(request);
// Do something.
Location response = future.get();
}
public final com.google.iam.v1.Policy setIamPolicy(com.google.iam.v1.SetIamPolicyRequest request)
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
Policy response = vertexRagDataServiceClient.setIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> setIamPolicyCallable()
Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`errors.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
SetIamPolicyRequest request =
SetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setPolicy(Policy.newBuilder().build())
.setUpdateMask(FieldMask.newBuilder().build())
.build();
ApiFuture<Policy> future =
vertexRagDataServiceClient.setIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.Policy getIamPolicy(com.google.iam.v1.GetIamPolicyRequest request)
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
Policy response = vertexRagDataServiceClient.getIamPolicy(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> getIamPolicyCallable()
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
GetIamPolicyRequest request =
GetIamPolicyRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.setOptions(GetPolicyOptions.newBuilder().build())
.build();
ApiFuture<Policy> future =
vertexRagDataServiceClient.getIamPolicyCallable().futureCall(request);
// Do something.
Policy response = future.get();
}
public final com.google.iam.v1.TestIamPermissionsResponse testIamPermissions(com.google.iam.v1.TestIamPermissionsRequest request)
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
TestIamPermissionsResponse response = vertexRagDataServiceClient.testIamPermissions(request);
}
request - The request object containing all of the parameters for the API call.com.google.api.gax.rpc.ApiException - if the remote call failspublic final com.google.api.gax.rpc.UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> testIamPermissionsCallable()
Note: This operation is designed to be used for buildingpermission-aware UIs and command-line tools, not for authorizationchecking. This operation may "fail open" without warning.
Sample code:
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in
// https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
try (VertexRagDataServiceClient vertexRagDataServiceClient =
VertexRagDataServiceClient.create()) {
TestIamPermissionsRequest request =
TestIamPermissionsRequest.newBuilder()
.setResource(
EndpointName.ofProjectLocationEndpointName(
"[PROJECT]", "[LOCATION]", "[ENDPOINT]")
.toString())
.addAllPermissions(new ArrayList<String>())
.build();
ApiFuture<TestIamPermissionsResponse> future =
vertexRagDataServiceClient.testIamPermissionsCallable().futureCall(request);
// Do something.
TestIamPermissionsResponse response = future.get();
}
public final void close()
close in interface AutoCloseablepublic void shutdown()
shutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isShutdown()
isShutdown in interface com.google.api.gax.core.BackgroundResourcepublic boolean isTerminated()
isTerminated in interface com.google.api.gax.core.BackgroundResourcepublic void shutdownNow()
shutdownNow in interface com.google.api.gax.core.BackgroundResourcepublic boolean awaitTermination(long duration,
TimeUnit unit)
throws InterruptedException
awaitTermination in interface com.google.api.gax.core.BackgroundResourceInterruptedExceptionCopyright © 2025 Google LLC. All rights reserved.