Class VertexRagDataServiceClient
- All Implemented Interfaces:
BackgroundResource,AutoCloseable
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.
|
CreateRagDataSchema |
Creates a RagDataSchema. |
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.
|
BatchCreateRagDataSchemas |
Batch Create one or more RagDataSchemas |
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.
|
GetRagDataSchema |
Gets a RagDataSchema. |
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.
|
ListRagDataSchemas |
Lists RagDataSchemas 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.
|
DeleteRagDataSchema |
Deletes a RagDataSchema. |
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.
|
BatchDeleteRagDataSchemas |
Batch Deletes one or more RagDataSchemas |
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.
|
CreateRagMetadata |
Creates a RagMetadata. |
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.
|
BatchCreateRagMetadata |
Batch Create one or more RagMetadatas |
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.
|
UpdateRagMetadata |
Updates a RagMetadata. |
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.
|
GetRagMetadata |
Gets a RagMetadata. |
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.
|
ListRagMetadata |
Lists RagMetadata in 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.
|
DeleteRagMetadata |
Deletes a RagMetadata. |
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.
|
BatchDeleteRagMetadata |
Batch Deletes one or more RagMetadata. |
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.
|
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic classstatic class -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedConstructs an instance of VertexRagDataServiceClient, using the given settings. -
Method Summary
Modifier and TypeMethodDescriptionbooleanawaitTermination(long duration, TimeUnit unit) Batch Create one or more RagDataSchemasBatch Create one or more RagDataSchemasfinal OperationCallable<BatchCreateRagDataSchemasRequest,BatchCreateRagDataSchemasResponse, BatchCreateRagDataSchemasOperationMetadata> Batch Create one or more RagDataSchemasBatch Create one or more RagMetadatasBatch Create one or more RagMetadatasfinal OperationCallable<BatchCreateRagMetadataRequest,BatchCreateRagMetadataResponse, BatchCreateRagMetadataOperationMetadata> Batch Create one or more RagMetadatasfinal OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Batch Deletes one or more RagDataSchemasBatch Deletes one or more RagDataSchemasfinal OperationCallable<BatchDeleteRagDataSchemasRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Batch Deletes one or more RagDataSchemasfinal OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Batch Deletes one or more RagMetadata.Batch Deletes one or more RagMetadata.final OperationCallable<BatchDeleteRagMetadataRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Batch Deletes one or more RagMetadata.final voidclose()static final VertexRagDataServiceClientcreate()Constructs an instance of VertexRagDataServiceClient with default settings.static final VertexRagDataServiceClientConstructs an instance of VertexRagDataServiceClient, using the given stub for making calls.static final VertexRagDataServiceClientcreate(VertexRagDataServiceSettings settings) Constructs an instance of VertexRagDataServiceClient, using the given settings.Creates a RagCorpus.createRagCorpusAsync(LocationName parent, RagCorpus ragCorpus) Creates a RagCorpus.createRagCorpusAsync(String parent, RagCorpus ragCorpus) Creates a RagCorpus.Creates a RagCorpus.Creates a RagCorpus.final RagDataSchemaCreates a RagDataSchema.final RagDataSchemacreateRagDataSchema(RagCorpusName parent, RagDataSchema ragDataSchema, String ragDataSchemaId) Creates a RagDataSchema.final RagDataSchemacreateRagDataSchema(String parent, RagDataSchema ragDataSchema, String ragDataSchemaId) Creates a RagDataSchema.Creates a RagDataSchema.final RagMetadataCreates a RagMetadata.final RagMetadatacreateRagMetadata(RagFileName parent, RagMetadata ragMetadata, String ragMetadataId) Creates a RagMetadata.final RagMetadatacreateRagMetadata(String parent, RagMetadata ragMetadata, String ragMetadataId) Creates a RagMetadata.Creates a RagMetadata.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a RagCorpus.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a RagCorpus.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusAsync(String name) Deletes a RagCorpus.Deletes a RagCorpus.final OperationCallable<DeleteRagCorpusRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a RagCorpus.final voidDeletes a RagDataSchema.final voidDeletes a RagDataSchema.final voiddeleteRagDataSchema(String name) Deletes a RagDataSchema.final UnaryCallable<DeleteRagDataSchemaRequest,com.google.protobuf.Empty> Deletes a RagDataSchema.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(DeleteRagFileRequest request) Deletes a RagFile.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> Deletes a RagFile.final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(String name) Deletes a RagFile.Deletes a RagFile.final OperationCallable<DeleteRagFileRequest,com.google.protobuf.Empty, DeleteOperationMetadata> Deletes a RagFile.final voidDeletes a RagMetadata.final voidDeletes a RagMetadata.final voiddeleteRagMetadata(String name) Deletes a RagMetadata.final UnaryCallable<DeleteRagMetadataRequest,com.google.protobuf.Empty> Deletes a RagMetadata.final PolicygetIamPolicy(GetIamPolicyRequest request) Gets the access control policy for a resource.Gets the access control policy for a resource.final LocationgetLocation(GetLocationRequest request) Gets information about a location.Gets information about a location.final OperationsClientReturns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.final RagCorpusgetRagCorpus(GetRagCorpusRequest request) Gets a RagCorpus.final RagCorpusgetRagCorpus(RagCorpusName name) Gets a RagCorpus.final RagCorpusgetRagCorpus(String name) Gets a RagCorpus.Gets a RagCorpus.final RagDataSchemagetRagDataSchema(GetRagDataSchemaRequest request) Gets a RagDataSchema.final RagDataSchemaGets a RagDataSchema.final RagDataSchemagetRagDataSchema(String name) Gets a RagDataSchema.Gets a RagDataSchema.final RagEngineConfigGets a RagEngineConfig.final RagEngineConfigGets a RagEngineConfig.final RagEngineConfiggetRagEngineConfig(String name) Gets a RagEngineConfig.Gets a RagEngineConfig.final RagFilegetRagFile(GetRagFileRequest request) Gets a RagFile.final RagFilegetRagFile(RagFileName name) Gets a RagFile.final RagFilegetRagFile(String name) Gets a RagFile.Gets a RagFile.final RagMetadatagetRagMetadata(GetRagMetadataRequest request) Gets a RagMetadata.final RagMetadataGets a RagMetadata.final RagMetadatagetRagMetadata(String name) Gets a RagMetadata.Gets a RagMetadata.getStub()importRagFilesAsync(ImportRagFilesRequest request) Import files from Google Cloud Storage or Google Drive into a RagCorpus.importRagFilesAsync(RagCorpusName parent, ImportRagFilesConfig importRagFilesConfig) Import files from Google Cloud Storage or Google Drive into a RagCorpus.importRagFilesAsync(String parent, ImportRagFilesConfig importRagFilesConfig) Import files from Google Cloud Storage or Google Drive into a RagCorpus.Import files from Google Cloud Storage or Google Drive into a RagCorpus.final OperationCallable<ImportRagFilesRequest,ImportRagFilesResponse, ImportRagFilesOperationMetadata> Import files from Google Cloud Storage or Google Drive into a RagCorpus.booleanbooleanlistLocations(ListLocationsRequest request) Lists information about the supported locations for this service.Lists information about the supported locations for this service.Lists information about the supported locations for this service.listRagCorpora(ListRagCorporaRequest request) Lists RagCorpora in a Location.listRagCorpora(LocationName parent) Lists RagCorpora in a Location.listRagCorpora(String parent) Lists RagCorpora in a Location.Lists RagCorpora in a Location.Lists RagCorpora in a Location.Lists RagDataSchemas in a Location.listRagDataSchemas(RagCorpusName parent) Lists RagDataSchemas in a Location.listRagDataSchemas(String parent) Lists RagDataSchemas in a Location.Lists RagDataSchemas in a Location.final UnaryCallable<ListRagDataSchemasRequest,VertexRagDataServiceClient.ListRagDataSchemasPagedResponse> Lists RagDataSchemas in a Location.listRagFiles(ListRagFilesRequest request) Lists RagFiles in a RagCorpus.listRagFiles(RagCorpusName parent) Lists RagFiles in a RagCorpus.listRagFiles(String parent) Lists RagFiles in a RagCorpus.Lists RagFiles in a RagCorpus.Lists RagFiles in a RagCorpus.listRagMetadata(ListRagMetadataRequest request) Lists RagMetadata in a RagFile.listRagMetadata(RagFileName parent) Lists RagMetadata in a RagFile.listRagMetadata(String parent) Lists RagMetadata in a RagFile.Lists RagMetadata in a RagFile.Lists RagMetadata in a RagFile.final PolicysetIamPolicy(SetIamPolicyRequest request) Sets the access control policy on the specified resource.Sets the access control policy on the specified resource.voidshutdown()voidReturns permissions that a caller has on the specified resource.Returns permissions that a caller has on the specified resource.updateRagCorpusAsync(RagCorpus ragCorpus) Updates a RagCorpus.Updates a RagCorpus.Updates a RagCorpus.Updates a RagCorpus.updateRagEngineConfigAsync(RagEngineConfig ragEngineConfig) Updates a RagEngineConfig.Updates a RagEngineConfig.Updates a RagEngineConfig.final OperationCallable<UpdateRagEngineConfigRequest,RagEngineConfig, UpdateRagEngineConfigOperationMetadata> Updates a RagEngineConfig.final RagMetadataupdateRagMetadata(RagMetadata ragMetadata) Updates a RagMetadata.final RagMetadataUpdates a RagMetadata.Updates a RagMetadata.final UploadRagFileResponseuploadRagFile(RagCorpusName parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig) Upload a file into a RagCorpus.final UploadRagFileResponseuploadRagFile(UploadRagFileRequest request) Upload a file into a RagCorpus.final UploadRagFileResponseuploadRagFile(String parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig) Upload a file into a RagCorpus.Upload a file into a RagCorpus.
-
Constructor Details
-
VertexRagDataServiceClient
Constructs an instance of VertexRagDataServiceClient, using the given settings. This is protected so that it is easy to make a subclass, but otherwise, the static factory methods should be preferred.- Throws:
IOException
-
VertexRagDataServiceClient
-
-
Method Details
-
create
Constructs an instance of VertexRagDataServiceClient with default settings.- Throws:
IOException
-
create
public static final VertexRagDataServiceClient create(VertexRagDataServiceSettings settings) throws IOException Constructs an instance of VertexRagDataServiceClient, using the given settings. The channels are created based on the settings passed in, or defaults for any settings that are not set.- Throws:
IOException
-
create
Constructs an instance of VertexRagDataServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(VertexRagDataServiceSettings). -
getSettings
-
getStub
-
getOperationsClient
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call. -
createRagCorpusAsync
public final OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusAsync(LocationName parent, RagCorpus ragCorpus) Creates a 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(); }- Parameters:
parent- Required. The resource name of the Location to create the RagCorpus in. Format: `projects/{project}/locations/{location}`ragCorpus- Required. The RagCorpus to create.- Throws:
ApiException- if the remote call fails
-
createRagCorpusAsync
public final OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusAsync(String parent, RagCorpus ragCorpus) Creates a 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(); }- Parameters:
parent- Required. The resource name of the Location to create the RagCorpus in. Format: `projects/{project}/locations/{location}`ragCorpus- Required. The RagCorpus to create.- Throws:
ApiException- if the remote call fails
-
createRagCorpusAsync
public final OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusAsync(CreateRagCorpusRequest request) Creates a 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()) { CreateRagCorpusRequest request = CreateRagCorpusRequest.newBuilder() .setParent(LocationName.of("[PROJECT]", "[LOCATION]").toString()) .setRagCorpus(RagCorpus.newBuilder().build()) .build(); RagCorpus response = vertexRagDataServiceClient.createRagCorpusAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createRagCorpusOperationCallable
public final OperationCallable<CreateRagCorpusRequest,RagCorpus, createRagCorpusOperationCallable()CreateRagCorpusOperationMetadata> Creates a 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()) { 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(); } -
createRagCorpusCallable
Creates a 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()) { 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(); } -
updateRagCorpusAsync
public final OperationFuture<RagCorpus,UpdateRagCorpusOperationMetadata> updateRagCorpusAsync(RagCorpus ragCorpus) Updates a 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(); }- Parameters:
ragCorpus- Required. The RagCorpus which replaces the resource on the server.- Throws:
ApiException- if the remote call fails
-
updateRagCorpusAsync
public final OperationFuture<RagCorpus,UpdateRagCorpusOperationMetadata> updateRagCorpusAsync(UpdateRagCorpusRequest request) Updates a 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()) { UpdateRagCorpusRequest request = UpdateRagCorpusRequest.newBuilder().setRagCorpus(RagCorpus.newBuilder().build()).build(); RagCorpus response = vertexRagDataServiceClient.updateRagCorpusAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateRagCorpusOperationCallable
public final OperationCallable<UpdateRagCorpusRequest,RagCorpus, updateRagCorpusOperationCallable()UpdateRagCorpusOperationMetadata> Updates a 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()) { UpdateRagCorpusRequest request = UpdateRagCorpusRequest.newBuilder().setRagCorpus(RagCorpus.newBuilder().build()).build(); OperationFuture<RagCorpus, UpdateRagCorpusOperationMetadata> future = vertexRagDataServiceClient.updateRagCorpusOperationCallable().futureCall(request); // Do something. RagCorpus response = future.get(); } -
updateRagCorpusCallable
Updates a 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()) { UpdateRagCorpusRequest request = UpdateRagCorpusRequest.newBuilder().setRagCorpus(RagCorpus.newBuilder().build()).build(); ApiFuture<Operation> future = vertexRagDataServiceClient.updateRagCorpusCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getRagCorpus
Gets a 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()) { RagCorpusName name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]"); RagCorpus response = vertexRagDataServiceClient.getRagCorpus(name); }- Parameters:
name- Required. The name of the RagCorpus resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
getRagCorpus
Gets a 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 name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString(); RagCorpus response = vertexRagDataServiceClient.getRagCorpus(name); }- Parameters:
name- Required. The name of the RagCorpus resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
getRagCorpus
Gets a 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()) { GetRagCorpusRequest request = GetRagCorpusRequest.newBuilder() .setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .build(); RagCorpus response = vertexRagDataServiceClient.getRagCorpus(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getRagCorpusCallable
Gets a 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()) { 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(); } -
listRagCorpora
public final VertexRagDataServiceClient.ListRagCorporaPagedResponse listRagCorpora(LocationName parent) Lists RagCorpora in a Location.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); } }- Parameters:
parent- Required. The resource name of the Location from which to list the RagCorpora. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listRagCorpora
Lists RagCorpora in a Location.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); } }- Parameters:
parent- Required. The resource name of the Location from which to list the RagCorpora. Format: `projects/{project}/locations/{location}`- Throws:
ApiException- if the remote call fails
-
listRagCorpora
public final VertexRagDataServiceClient.ListRagCorporaPagedResponse listRagCorpora(ListRagCorporaRequest request) Lists RagCorpora in a Location.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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listRagCorporaPagedCallable
public final UnaryCallable<ListRagCorporaRequest,VertexRagDataServiceClient.ListRagCorporaPagedResponse> listRagCorporaPagedCallable()Lists RagCorpora in a Location.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); } } -
listRagCorporaCallable
Lists RagCorpora in a Location.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; } } } -
deleteRagCorpusAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusAsync(RagCorpusName name) Deletes a 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()) { RagCorpusName name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]"); vertexRagDataServiceClient.deleteRagCorpusAsync(name).get(); }- Parameters:
name- Required. The name of the RagCorpus resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
deleteRagCorpusAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusAsync(String name) Deletes a 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 name = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString(); vertexRagDataServiceClient.deleteRagCorpusAsync(name).get(); }- Parameters:
name- Required. The name of the RagCorpus resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
deleteRagCorpusAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagCorpusAsync(DeleteRagCorpusRequest request) Deletes a 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()) { DeleteRagCorpusRequest request = DeleteRagCorpusRequest.newBuilder() .setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setForce(true) .setForceDelete(true) .build(); vertexRagDataServiceClient.deleteRagCorpusAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteRagCorpusOperationCallable
public final OperationCallable<DeleteRagCorpusRequest,com.google.protobuf.Empty, deleteRagCorpusOperationCallable()DeleteOperationMetadata> Deletes a 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()) { DeleteRagCorpusRequest request = DeleteRagCorpusRequest.newBuilder() .setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setForce(true) .setForceDelete(true) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = vertexRagDataServiceClient.deleteRagCorpusOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteRagCorpusCallable
Deletes a 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()) { DeleteRagCorpusRequest request = DeleteRagCorpusRequest.newBuilder() .setName(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setForce(true) .setForceDelete(true) .build(); ApiFuture<Operation> future = vertexRagDataServiceClient.deleteRagCorpusCallable().futureCall(request); // Do something. future.get(); } -
uploadRagFile
public final UploadRagFileResponse uploadRagFile(RagCorpusName parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig) Upload a file into a 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()) { 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); }- Parameters:
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].- Throws:
ApiException- if the remote call fails
-
uploadRagFile
public final UploadRagFileResponse uploadRagFile(String parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig) Upload a file into a 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 = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString(); RagFile ragFile = RagFile.newBuilder().build(); UploadRagFileConfig uploadRagFileConfig = UploadRagFileConfig.newBuilder().build(); UploadRagFileResponse response = vertexRagDataServiceClient.uploadRagFile(parent, ragFile, uploadRagFileConfig); }- Parameters:
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].- Throws:
ApiException- if the remote call fails
-
uploadRagFile
Upload a file into a 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()) { 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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
uploadRagFileCallable
Upload a file into a 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()) { 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(); } -
importRagFilesAsync
public final OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesAsync(RagCorpusName parent, ImportRagFilesConfig importRagFilesConfig) Import files from Google Cloud Storage or Google Drive into a 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()) { RagCorpusName parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]"); ImportRagFilesConfig importRagFilesConfig = ImportRagFilesConfig.newBuilder().build(); ImportRagFilesResponse response = vertexRagDataServiceClient.importRagFilesAsync(parent, importRagFilesConfig).get(); }- Parameters:
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].- Throws:
ApiException- if the remote call fails
-
importRagFilesAsync
public final OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesAsync(String parent, ImportRagFilesConfig importRagFilesConfig) Import files from Google Cloud Storage or Google Drive into a 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 = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString(); ImportRagFilesConfig importRagFilesConfig = ImportRagFilesConfig.newBuilder().build(); ImportRagFilesResponse response = vertexRagDataServiceClient.importRagFilesAsync(parent, importRagFilesConfig).get(); }- Parameters:
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].- Throws:
ApiException- if the remote call fails
-
importRagFilesAsync
public final OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesAsync(ImportRagFilesRequest request) Import files from Google Cloud Storage or Google Drive into a 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()) { ImportRagFilesRequest request = ImportRagFilesRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setImportRagFilesConfig(ImportRagFilesConfig.newBuilder().build()) .build(); ImportRagFilesResponse response = vertexRagDataServiceClient.importRagFilesAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
importRagFilesOperationCallable
public final OperationCallable<ImportRagFilesRequest,ImportRagFilesResponse, importRagFilesOperationCallable()ImportRagFilesOperationMetadata> Import files from Google Cloud Storage or Google Drive into a 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()) { 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(); } -
importRagFilesCallable
Import files from Google Cloud Storage or Google Drive into a 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()) { 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(); } -
getRagFile
Gets a RagFile.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); }- Parameters:
name- Required. The name of the RagFile resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`- Throws:
ApiException- if the remote call fails
-
getRagFile
Gets a RagFile.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); }- Parameters:
name- Required. The name of the RagFile resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`- Throws:
ApiException- if the remote call fails
-
getRagFile
Gets a RagFile.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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getRagFileCallable
Gets a RagFile.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(); } -
listRagFiles
public final VertexRagDataServiceClient.ListRagFilesPagedResponse listRagFiles(RagCorpusName parent) Lists RagFiles in a 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()) { RagCorpusName parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]"); for (RagFile element : vertexRagDataServiceClient.listRagFiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the RagCorpus from which to list the RagFiles. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
listRagFiles
Lists RagFiles in a 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 = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString(); for (RagFile element : vertexRagDataServiceClient.listRagFiles(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the RagCorpus from which to list the RagFiles. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
listRagFiles
public final VertexRagDataServiceClient.ListRagFilesPagedResponse listRagFiles(ListRagFilesRequest request) Lists RagFiles in a 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()) { 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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listRagFilesPagedCallable
public final UnaryCallable<ListRagFilesRequest,VertexRagDataServiceClient.ListRagFilesPagedResponse> listRagFilesPagedCallable()Lists RagFiles in a 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()) { 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); } } -
listRagFilesCallable
Lists RagFiles in a 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()) { 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; } } } -
deleteRagFileAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(RagFileName name) Deletes a RagFile.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(); }- Parameters:
name- Required. The name of the RagFile resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`- Throws:
ApiException- if the remote call fails
-
deleteRagFileAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(String name) Deletes a RagFile.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(); }- Parameters:
name- Required. The name of the RagFile resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`- Throws:
ApiException- if the remote call fails
-
deleteRagFileAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> deleteRagFileAsync(DeleteRagFileRequest request) Deletes a RagFile.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()) .setForceDelete(true) .build(); vertexRagDataServiceClient.deleteRagFileAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteRagFileOperationCallable
public final OperationCallable<DeleteRagFileRequest,com.google.protobuf.Empty, deleteRagFileOperationCallable()DeleteOperationMetadata> Deletes a RagFile.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()) .setForceDelete(true) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = vertexRagDataServiceClient.deleteRagFileOperationCallable().futureCall(request); // Do something. future.get(); } -
deleteRagFileCallable
Deletes a RagFile.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()) .setForceDelete(true) .build(); ApiFuture<Operation> future = vertexRagDataServiceClient.deleteRagFileCallable().futureCall(request); // Do something. future.get(); } -
updateRagEngineConfigAsync
public final OperationFuture<RagEngineConfig,UpdateRagEngineConfigOperationMetadata> updateRagEngineConfigAsync(RagEngineConfig ragEngineConfig) Updates a 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(); }- Parameters:
ragEngineConfig- Required. The updated RagEngineConfig.NOTE: Downgrading your RagManagedDb's ComputeTier could temporarily increase request latencies until the operation is fully complete.
- Throws:
ApiException- if the remote call fails
-
updateRagEngineConfigAsync
public final OperationFuture<RagEngineConfig,UpdateRagEngineConfigOperationMetadata> updateRagEngineConfigAsync(UpdateRagEngineConfigRequest request) Updates a 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()) { UpdateRagEngineConfigRequest request = UpdateRagEngineConfigRequest.newBuilder() .setRagEngineConfig(RagEngineConfig.newBuilder().build()) .build(); RagEngineConfig response = vertexRagDataServiceClient.updateRagEngineConfigAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateRagEngineConfigOperationCallable
public final OperationCallable<UpdateRagEngineConfigRequest,RagEngineConfig, updateRagEngineConfigOperationCallable()UpdateRagEngineConfigOperationMetadata> Updates a 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()) { UpdateRagEngineConfigRequest request = UpdateRagEngineConfigRequest.newBuilder() .setRagEngineConfig(RagEngineConfig.newBuilder().build()) .build(); OperationFuture<RagEngineConfig, UpdateRagEngineConfigOperationMetadata> future = vertexRagDataServiceClient.updateRagEngineConfigOperationCallable().futureCall(request); // Do something. RagEngineConfig response = future.get(); } -
updateRagEngineConfigCallable
Updates a 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()) { UpdateRagEngineConfigRequest request = UpdateRagEngineConfigRequest.newBuilder() .setRagEngineConfig(RagEngineConfig.newBuilder().build()) .build(); ApiFuture<Operation> future = vertexRagDataServiceClient.updateRagEngineConfigCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getRagEngineConfig
Gets a 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()) { RagEngineConfigName name = RagEngineConfigName.of("[PROJECT]", "[LOCATION]"); RagEngineConfig response = vertexRagDataServiceClient.getRagEngineConfig(name); }- Parameters:
name- Required. The name of the RagEngineConfig resource. Format: `projects/{project}/locations/{location}/ragEngineConfig`- Throws:
ApiException- if the remote call fails
-
getRagEngineConfig
Gets a 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()) { String name = RagEngineConfigName.of("[PROJECT]", "[LOCATION]").toString(); RagEngineConfig response = vertexRagDataServiceClient.getRagEngineConfig(name); }- Parameters:
name- Required. The name of the RagEngineConfig resource. Format: `projects/{project}/locations/{location}/ragEngineConfig`- Throws:
ApiException- if the remote call fails
-
getRagEngineConfig
Gets a 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()) { GetRagEngineConfigRequest request = GetRagEngineConfigRequest.newBuilder() .setName(RagEngineConfigName.of("[PROJECT]", "[LOCATION]").toString()) .build(); RagEngineConfig response = vertexRagDataServiceClient.getRagEngineConfig(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getRagEngineConfigCallable
Gets a 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()) { GetRagEngineConfigRequest request = GetRagEngineConfigRequest.newBuilder() .setName(RagEngineConfigName.of("[PROJECT]", "[LOCATION]").toString()) .build(); ApiFuture<RagEngineConfig> future = vertexRagDataServiceClient.getRagEngineConfigCallable().futureCall(request); // Do something. RagEngineConfig response = future.get(); } -
createRagDataSchema
public final RagDataSchema createRagDataSchema(RagCorpusName parent, RagDataSchema ragDataSchema, String ragDataSchemaId) Creates a RagDataSchema.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]"); RagDataSchema ragDataSchema = RagDataSchema.newBuilder().build(); String ragDataSchemaId = "ragDataSchemaId-1094185826"; RagDataSchema response = vertexRagDataServiceClient.createRagDataSchema(parent, ragDataSchema, ragDataSchemaId); }- Parameters:
parent- Required. The resource name of the RagCorpus to create the RagDataSchema in. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`ragDataSchema- Required. The RagDataSchema to create.ragDataSchemaId- Optional. The ID to use for the RagDataSchema, which will become the final component of the RagDataSchema's resource name if the user chooses to specify. Otherwise, RagDataSchema id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createRagDataSchema
public final RagDataSchema createRagDataSchema(String parent, RagDataSchema ragDataSchema, String ragDataSchemaId) Creates a RagDataSchema.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(); RagDataSchema ragDataSchema = RagDataSchema.newBuilder().build(); String ragDataSchemaId = "ragDataSchemaId-1094185826"; RagDataSchema response = vertexRagDataServiceClient.createRagDataSchema(parent, ragDataSchema, ragDataSchemaId); }- Parameters:
parent- Required. The resource name of the RagCorpus to create the RagDataSchema in. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`ragDataSchema- Required. The RagDataSchema to create.ragDataSchemaId- Optional. The ID to use for the RagDataSchema, which will become the final component of the RagDataSchema's resource name if the user chooses to specify. Otherwise, RagDataSchema id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createRagDataSchema
Creates a RagDataSchema.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()) { CreateRagDataSchemaRequest request = CreateRagDataSchemaRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setRagDataSchema(RagDataSchema.newBuilder().build()) .setRagDataSchemaId("ragDataSchemaId-1094185826") .build(); RagDataSchema response = vertexRagDataServiceClient.createRagDataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createRagDataSchemaCallable
Creates a RagDataSchema.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()) { CreateRagDataSchemaRequest request = CreateRagDataSchemaRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setRagDataSchema(RagDataSchema.newBuilder().build()) .setRagDataSchemaId("ragDataSchemaId-1094185826") .build(); ApiFuture<RagDataSchema> future = vertexRagDataServiceClient.createRagDataSchemaCallable().futureCall(request); // Do something. RagDataSchema response = future.get(); } -
batchCreateRagDataSchemasAsync
public final OperationFuture<BatchCreateRagDataSchemasResponse,BatchCreateRagDataSchemasOperationMetadata> batchCreateRagDataSchemasAsync(BatchCreateRagDataSchemasRequest request) Batch Create one or more RagDataSchemasSample 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()) { BatchCreateRagDataSchemasRequest request = BatchCreateRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .addAllRequests(new ArrayList<CreateRagDataSchemaRequest>()) .build(); BatchCreateRagDataSchemasResponse response = vertexRagDataServiceClient.batchCreateRagDataSchemasAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchCreateRagDataSchemasOperationCallable
public final OperationCallable<BatchCreateRagDataSchemasRequest,BatchCreateRagDataSchemasResponse, batchCreateRagDataSchemasOperationCallable()BatchCreateRagDataSchemasOperationMetadata> Batch Create one or more RagDataSchemasSample 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()) { BatchCreateRagDataSchemasRequest request = BatchCreateRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .addAllRequests(new ArrayList<CreateRagDataSchemaRequest>()) .build(); OperationFuture<BatchCreateRagDataSchemasResponse, BatchCreateRagDataSchemasOperationMetadata> future = vertexRagDataServiceClient .batchCreateRagDataSchemasOperationCallable() .futureCall(request); // Do something. BatchCreateRagDataSchemasResponse response = future.get(); } -
batchCreateRagDataSchemasCallable
public final UnaryCallable<BatchCreateRagDataSchemasRequest,Operation> batchCreateRagDataSchemasCallable()Batch Create one or more RagDataSchemasSample 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()) { BatchCreateRagDataSchemasRequest request = BatchCreateRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .addAllRequests(new ArrayList<CreateRagDataSchemaRequest>()) .build(); ApiFuture<Operation> future = vertexRagDataServiceClient.batchCreateRagDataSchemasCallable().futureCall(request); // Do something. Operation response = future.get(); } -
getRagDataSchema
Gets a RagDataSchema.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()) { RagDataSchemaName name = RagDataSchemaName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]"); RagDataSchema response = vertexRagDataServiceClient.getRagDataSchema(name); }- Parameters:
name- Required. The name of the RagDataSchema resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragDataSchemas/{rag_data_schema}`- Throws:
ApiException- if the remote call fails
-
getRagDataSchema
Gets a RagDataSchema.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 = RagDataSchemaName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]") .toString(); RagDataSchema response = vertexRagDataServiceClient.getRagDataSchema(name); }- Parameters:
name- Required. The name of the RagDataSchema resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragDataSchemas/{rag_data_schema}`- Throws:
ApiException- if the remote call fails
-
getRagDataSchema
Gets a RagDataSchema.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()) { GetRagDataSchemaRequest request = GetRagDataSchemaRequest.newBuilder() .setName( RagDataSchemaName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]") .toString()) .build(); RagDataSchema response = vertexRagDataServiceClient.getRagDataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getRagDataSchemaCallable
Gets a RagDataSchema.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()) { GetRagDataSchemaRequest request = GetRagDataSchemaRequest.newBuilder() .setName( RagDataSchemaName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]") .toString()) .build(); ApiFuture<RagDataSchema> future = vertexRagDataServiceClient.getRagDataSchemaCallable().futureCall(request); // Do something. RagDataSchema response = future.get(); } -
listRagDataSchemas
public final VertexRagDataServiceClient.ListRagDataSchemasPagedResponse listRagDataSchemas(RagCorpusName parent) Lists RagDataSchemas in a Location.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 (RagDataSchema element : vertexRagDataServiceClient.listRagDataSchemas(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the RagCorpus from which to list the RagDataSchemas. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
listRagDataSchemas
public final VertexRagDataServiceClient.ListRagDataSchemasPagedResponse listRagDataSchemas(String parent) Lists RagDataSchemas in a Location.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 (RagDataSchema element : vertexRagDataServiceClient.listRagDataSchemas(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the RagCorpus from which to list the RagDataSchemas. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`- Throws:
ApiException- if the remote call fails
-
listRagDataSchemas
public final VertexRagDataServiceClient.ListRagDataSchemasPagedResponse listRagDataSchemas(ListRagDataSchemasRequest request) Lists RagDataSchemas in a Location.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()) { ListRagDataSchemasRequest request = ListRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (RagDataSchema element : vertexRagDataServiceClient.listRagDataSchemas(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listRagDataSchemasPagedCallable
public final UnaryCallable<ListRagDataSchemasRequest,VertexRagDataServiceClient.ListRagDataSchemasPagedResponse> listRagDataSchemasPagedCallable()Lists RagDataSchemas in a Location.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()) { ListRagDataSchemasRequest request = ListRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<RagDataSchema> future = vertexRagDataServiceClient.listRagDataSchemasPagedCallable().futureCall(request); // Do something. for (RagDataSchema element : future.get().iterateAll()) { // doThingsWith(element); } } -
listRagDataSchemasCallable
public final UnaryCallable<ListRagDataSchemasRequest,ListRagDataSchemasResponse> listRagDataSchemasCallable()Lists RagDataSchemas in a Location.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()) { ListRagDataSchemasRequest request = ListRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListRagDataSchemasResponse response = vertexRagDataServiceClient.listRagDataSchemasCallable().call(request); for (RagDataSchema element : response.getRagDataSchemasList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteRagDataSchema
Deletes a RagDataSchema.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()) { RagDataSchemaName name = RagDataSchemaName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]"); vertexRagDataServiceClient.deleteRagDataSchema(name); }- Parameters:
name- Required. The name of the RagDataSchema resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragDataSchemas/{rag_data_schema}`- Throws:
ApiException- if the remote call fails
-
deleteRagDataSchema
Deletes a RagDataSchema.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 = RagDataSchemaName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]") .toString(); vertexRagDataServiceClient.deleteRagDataSchema(name); }- Parameters:
name- Required. The name of the RagDataSchema resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragDataSchemas/{rag_data_schema}`- Throws:
ApiException- if the remote call fails
-
deleteRagDataSchema
Deletes a RagDataSchema.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()) { DeleteRagDataSchemaRequest request = DeleteRagDataSchemaRequest.newBuilder() .setName( RagDataSchemaName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]") .toString()) .build(); vertexRagDataServiceClient.deleteRagDataSchema(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteRagDataSchemaCallable
public final UnaryCallable<DeleteRagDataSchemaRequest,com.google.protobuf.Empty> deleteRagDataSchemaCallable()Deletes a RagDataSchema.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()) { DeleteRagDataSchemaRequest request = DeleteRagDataSchemaRequest.newBuilder() .setName( RagDataSchemaName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_DATA_SCHEMA]") .toString()) .build(); ApiFuture<Empty> future = vertexRagDataServiceClient.deleteRagDataSchemaCallable().futureCall(request); // Do something. future.get(); } -
batchDeleteRagDataSchemasAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> batchDeleteRagDataSchemasAsync(BatchDeleteRagDataSchemasRequest request) Batch Deletes one or more RagDataSchemasSample 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()) { BatchDeleteRagDataSchemasRequest request = BatchDeleteRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .addAllNames(new ArrayList<String>()) .build(); vertexRagDataServiceClient.batchDeleteRagDataSchemasAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchDeleteRagDataSchemasOperationCallable
public final OperationCallable<BatchDeleteRagDataSchemasRequest,com.google.protobuf.Empty, batchDeleteRagDataSchemasOperationCallable()DeleteOperationMetadata> Batch Deletes one or more RagDataSchemasSample 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()) { BatchDeleteRagDataSchemasRequest request = BatchDeleteRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .addAllNames(new ArrayList<String>()) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = vertexRagDataServiceClient .batchDeleteRagDataSchemasOperationCallable() .futureCall(request); // Do something. future.get(); } -
batchDeleteRagDataSchemasCallable
public final UnaryCallable<BatchDeleteRagDataSchemasRequest,Operation> batchDeleteRagDataSchemasCallable()Batch Deletes one or more RagDataSchemasSample 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()) { BatchDeleteRagDataSchemasRequest request = BatchDeleteRagDataSchemasRequest.newBuilder() .setParent(RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString()) .addAllNames(new ArrayList<String>()) .build(); ApiFuture<Operation> future = vertexRagDataServiceClient.batchDeleteRagDataSchemasCallable().futureCall(request); // Do something. future.get(); } -
createRagMetadata
public final RagMetadata createRagMetadata(RagFileName parent, RagMetadata ragMetadata, String ragMetadataId) Creates a RagMetadata.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 parent = RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]"); RagMetadata ragMetadata = RagMetadata.newBuilder().build(); String ragMetadataId = "ragMetadataId-818296094"; RagMetadata response = vertexRagDataServiceClient.createRagMetadata(parent, ragMetadata, ragMetadataId); }- Parameters:
parent- Required. The parent resource where this metadata will be created. Format: `projects/{project_number}/locations/{location_id}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`ragMetadata- Required. The metadata to create.ragMetadataId- Optional. The ID to use for the metadata, which will become the final component of the metadata's resource name if the user chooses to specify. Otherwise, metadata id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createRagMetadata
public final RagMetadata createRagMetadata(String parent, RagMetadata ragMetadata, String ragMetadataId) Creates a RagMetadata.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 = RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]").toString(); RagMetadata ragMetadata = RagMetadata.newBuilder().build(); String ragMetadataId = "ragMetadataId-818296094"; RagMetadata response = vertexRagDataServiceClient.createRagMetadata(parent, ragMetadata, ragMetadataId); }- Parameters:
parent- Required. The parent resource where this metadata will be created. Format: `projects/{project_number}/locations/{location_id}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`ragMetadata- Required. The metadata to create.ragMetadataId- Optional. The ID to use for the metadata, which will become the final component of the metadata's resource name if the user chooses to specify. Otherwise, metadata id will be generated by system.This value should be up to 63 characters, and valid characters are /[a-z][0-9]-/. The first character must be a letter, the last could be a letter or a number.
- Throws:
ApiException- if the remote call fails
-
createRagMetadata
Creates a RagMetadata.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()) { CreateRagMetadataRequest request = CreateRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .setRagMetadata(RagMetadata.newBuilder().build()) .setRagMetadataId("ragMetadataId-818296094") .build(); RagMetadata response = vertexRagDataServiceClient.createRagMetadata(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
createRagMetadataCallable
Creates a RagMetadata.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()) { CreateRagMetadataRequest request = CreateRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .setRagMetadata(RagMetadata.newBuilder().build()) .setRagMetadataId("ragMetadataId-818296094") .build(); ApiFuture<RagMetadata> future = vertexRagDataServiceClient.createRagMetadataCallable().futureCall(request); // Do something. RagMetadata response = future.get(); } -
batchCreateRagMetadataAsync
public final OperationFuture<BatchCreateRagMetadataResponse,BatchCreateRagMetadataOperationMetadata> batchCreateRagMetadataAsync(BatchCreateRagMetadataRequest request) Batch Create one or more RagMetadatasSample 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()) { BatchCreateRagMetadataRequest request = BatchCreateRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .addAllRequests(new ArrayList<CreateRagMetadataRequest>()) .build(); BatchCreateRagMetadataResponse response = vertexRagDataServiceClient.batchCreateRagMetadataAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchCreateRagMetadataOperationCallable
public final OperationCallable<BatchCreateRagMetadataRequest,BatchCreateRagMetadataResponse, batchCreateRagMetadataOperationCallable()BatchCreateRagMetadataOperationMetadata> Batch Create one or more RagMetadatasSample 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()) { BatchCreateRagMetadataRequest request = BatchCreateRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .addAllRequests(new ArrayList<CreateRagMetadataRequest>()) .build(); OperationFuture<BatchCreateRagMetadataResponse, BatchCreateRagMetadataOperationMetadata> future = vertexRagDataServiceClient .batchCreateRagMetadataOperationCallable() .futureCall(request); // Do something. BatchCreateRagMetadataResponse response = future.get(); } -
batchCreateRagMetadataCallable
public final UnaryCallable<BatchCreateRagMetadataRequest,Operation> batchCreateRagMetadataCallable()Batch Create one or more RagMetadatasSample 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()) { BatchCreateRagMetadataRequest request = BatchCreateRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .addAllRequests(new ArrayList<CreateRagMetadataRequest>()) .build(); ApiFuture<Operation> future = vertexRagDataServiceClient.batchCreateRagMetadataCallable().futureCall(request); // Do something. Operation response = future.get(); } -
updateRagMetadata
Updates a RagMetadata.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()) { RagMetadata ragMetadata = RagMetadata.newBuilder().build(); RagMetadata response = vertexRagDataServiceClient.updateRagMetadata(ragMetadata); }- Parameters:
ragMetadata- Required. The RagMetadata which replaces the resource on the server.- Throws:
ApiException- if the remote call fails
-
updateRagMetadata
Updates a RagMetadata.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()) { UpdateRagMetadataRequest request = UpdateRagMetadataRequest.newBuilder() .setRagMetadata(RagMetadata.newBuilder().build()) .build(); RagMetadata response = vertexRagDataServiceClient.updateRagMetadata(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
updateRagMetadataCallable
Updates a RagMetadata.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()) { UpdateRagMetadataRequest request = UpdateRagMetadataRequest.newBuilder() .setRagMetadata(RagMetadata.newBuilder().build()) .build(); ApiFuture<RagMetadata> future = vertexRagDataServiceClient.updateRagMetadataCallable().futureCall(request); // Do something. RagMetadata response = future.get(); } -
getRagMetadata
Gets a RagMetadata.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()) { RagMetadataName name = RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]"); RagMetadata response = vertexRagDataServiceClient.getRagMetadata(name); }- Parameters:
name- Required. The name of the RagMetadata resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}/ragMetadata/{rag_metadata}`- Throws:
ApiException- if the remote call fails
-
getRagMetadata
Gets a RagMetadata.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 = RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]") .toString(); RagMetadata response = vertexRagDataServiceClient.getRagMetadata(name); }- Parameters:
name- Required. The name of the RagMetadata resource. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}/ragMetadata/{rag_metadata}`- Throws:
ApiException- if the remote call fails
-
getRagMetadata
Gets a RagMetadata.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()) { GetRagMetadataRequest request = GetRagMetadataRequest.newBuilder() .setName( RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]") .toString()) .build(); RagMetadata response = vertexRagDataServiceClient.getRagMetadata(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getRagMetadataCallable
Gets a RagMetadata.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()) { GetRagMetadataRequest request = GetRagMetadataRequest.newBuilder() .setName( RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]") .toString()) .build(); ApiFuture<RagMetadata> future = vertexRagDataServiceClient.getRagMetadataCallable().futureCall(request); // Do something. RagMetadata response = future.get(); } -
listRagMetadata
public final VertexRagDataServiceClient.ListRagMetadataPagedResponse listRagMetadata(RagFileName parent) Lists RagMetadata in a RagFile.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 parent = RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]"); for (RagMetadata element : vertexRagDataServiceClient.listRagMetadata(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the RagFile from which to list the RagMetadata. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`- Throws:
ApiException- if the remote call fails
-
listRagMetadata
Lists RagMetadata in a RagFile.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 = RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]").toString(); for (RagMetadata element : vertexRagDataServiceClient.listRagMetadata(parent).iterateAll()) { // doThingsWith(element); } }- Parameters:
parent- Required. The resource name of the RagFile from which to list the RagMetadata. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}`- Throws:
ApiException- if the remote call fails
-
listRagMetadata
public final VertexRagDataServiceClient.ListRagMetadataPagedResponse listRagMetadata(ListRagMetadataRequest request) Lists RagMetadata in a RagFile.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()) { ListRagMetadataRequest request = ListRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); for (RagMetadata element : vertexRagDataServiceClient.listRagMetadata(request).iterateAll()) { // doThingsWith(element); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listRagMetadataPagedCallable
public final UnaryCallable<ListRagMetadataRequest,VertexRagDataServiceClient.ListRagMetadataPagedResponse> listRagMetadataPagedCallable()Lists RagMetadata in a RagFile.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()) { ListRagMetadataRequest request = ListRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); ApiFuture<RagMetadata> future = vertexRagDataServiceClient.listRagMetadataPagedCallable().futureCall(request); // Do something. for (RagMetadata element : future.get().iterateAll()) { // doThingsWith(element); } } -
listRagMetadataCallable
public final UnaryCallable<ListRagMetadataRequest,ListRagMetadataResponse> listRagMetadataCallable()Lists RagMetadata in a RagFile.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()) { ListRagMetadataRequest request = ListRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .setPageSize(883849137) .setPageToken("pageToken873572522") .build(); while (true) { ListRagMetadataResponse response = vertexRagDataServiceClient.listRagMetadataCallable().call(request); for (RagMetadata element : response.getRagMetadataList()) { // doThingsWith(element); } String nextPageToken = response.getNextPageToken(); if (!Strings.isNullOrEmpty(nextPageToken)) { request = request.toBuilder().setPageToken(nextPageToken).build(); } else { break; } } } -
deleteRagMetadata
Deletes a RagMetadata.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()) { RagMetadataName name = RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]"); vertexRagDataServiceClient.deleteRagMetadata(name); }- Parameters:
name- Required. The name of the RagMetadata resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}/ragMetadata/{rag_metadata}`- Throws:
ApiException- if the remote call fails
-
deleteRagMetadata
Deletes a RagMetadata.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 = RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]") .toString(); vertexRagDataServiceClient.deleteRagMetadata(name); }- Parameters:
name- Required. The name of the RagMetadata resource to be deleted. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}/ragFiles/{rag_file}/ragMetadata/{rag_metadata}`- Throws:
ApiException- if the remote call fails
-
deleteRagMetadata
Deletes a RagMetadata.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()) { DeleteRagMetadataRequest request = DeleteRagMetadataRequest.newBuilder() .setName( RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]") .toString()) .build(); vertexRagDataServiceClient.deleteRagMetadata(request); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
deleteRagMetadataCallable
public final UnaryCallable<DeleteRagMetadataRequest,com.google.protobuf.Empty> deleteRagMetadataCallable()Deletes a RagMetadata.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()) { DeleteRagMetadataRequest request = DeleteRagMetadataRequest.newBuilder() .setName( RagMetadataName.of( "[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]", "[RAG_METADATA]") .toString()) .build(); ApiFuture<Empty> future = vertexRagDataServiceClient.deleteRagMetadataCallable().futureCall(request); // Do something. future.get(); } -
batchDeleteRagMetadataAsync
public final OperationFuture<com.google.protobuf.Empty,DeleteOperationMetadata> batchDeleteRagMetadataAsync(BatchDeleteRagMetadataRequest request) Batch Deletes one or more RagMetadata.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()) { BatchDeleteRagMetadataRequest request = BatchDeleteRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .addAllNames(new ArrayList<String>()) .build(); vertexRagDataServiceClient.batchDeleteRagMetadataAsync(request).get(); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
batchDeleteRagMetadataOperationCallable
public final OperationCallable<BatchDeleteRagMetadataRequest,com.google.protobuf.Empty, batchDeleteRagMetadataOperationCallable()DeleteOperationMetadata> Batch Deletes one or more RagMetadata.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()) { BatchDeleteRagMetadataRequest request = BatchDeleteRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .addAllNames(new ArrayList<String>()) .build(); OperationFuture<Empty, DeleteOperationMetadata> future = vertexRagDataServiceClient.batchDeleteRagMetadataOperationCallable().futureCall(request); // Do something. future.get(); } -
batchDeleteRagMetadataCallable
public final UnaryCallable<BatchDeleteRagMetadataRequest,Operation> batchDeleteRagMetadataCallable()Batch Deletes one or more RagMetadata.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()) { BatchDeleteRagMetadataRequest request = BatchDeleteRagMetadataRequest.newBuilder() .setParent( RagFileName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]", "[RAG_FILE]") .toString()) .addAllNames(new ArrayList<String>()) .build(); ApiFuture<Operation> future = vertexRagDataServiceClient.batchDeleteRagMetadataCallable().futureCall(request); // Do something. future.get(); } -
listLocations
public final VertexRagDataServiceClient.ListLocationsPagedResponse listLocations(ListLocationsRequest request) Lists information about the supported locations for this service.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); } }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
listLocationsPagedCallable
public final UnaryCallable<ListLocationsRequest,VertexRagDataServiceClient.ListLocationsPagedResponse> listLocationsPagedCallable()Lists information about the supported locations for this service.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); } } -
listLocationsCallable
Lists information about the supported locations for this service.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; } } } -
getLocation
Gets information about a location.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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getLocationCallable
Gets information about a location.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(); } -
setIamPolicy
Sets the access control policy on the specified resource. Replacesany existing policy.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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
setIamPolicyCallable
Sets the access control policy on the specified resource. Replacesany existing policy.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(); } -
getIamPolicy
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
getIamPolicyCallable
Gets the access control policy for a resource. Returns an empty policyif the resource exists and does not have a policy set.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(); } -
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.
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); }- Parameters:
request- The request object containing all of the parameters for the API call.- Throws:
ApiException- if the remote call fails
-
testIamPermissionsCallable
public final UnaryCallable<TestIamPermissionsRequest,TestIamPermissionsResponse> testIamPermissionsCallable()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.
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(); } -
close
public final void close()- Specified by:
closein interfaceAutoCloseable
-
shutdown
public void shutdown()- Specified by:
shutdownin interfaceBackgroundResource
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdownin interfaceBackgroundResource
-
isTerminated
public boolean isTerminated()- Specified by:
isTerminatedin interfaceBackgroundResource
-
shutdownNow
public void shutdownNow()- Specified by:
shutdownNowin interfaceBackgroundResource
-
awaitTermination
- Specified by:
awaitTerminationin interfaceBackgroundResource- Throws:
InterruptedException
-