- 3.52.0 (latest)
- 3.50.0
- 3.49.0
- 3.48.0
- 3.47.0
- 3.46.0
- 3.45.0
- 3.44.0
- 3.43.0
- 3.42.0
- 3.41.0
- 3.40.0
- 3.38.0
- 3.37.0
- 3.36.0
- 3.35.0
- 3.34.0
- 3.33.0
- 3.32.0
- 3.31.0
- 3.30.0
- 3.29.0
- 3.28.0
- 3.25.0
- 3.24.0
- 3.23.0
- 3.22.0
- 3.21.0
- 3.20.0
- 3.19.0
- 3.18.0
- 3.17.0
- 3.16.0
- 3.15.0
- 3.14.0
- 3.13.0
- 3.12.0
- 3.11.0
- 3.10.0
- 3.9.0
- 3.8.0
- 3.7.0
- 3.6.0
- 3.5.0
- 3.4.2
- 3.3.0
- 3.2.0
- 3.0.0
- 2.9.8
- 2.8.9
- 2.7.4
- 2.5.3
- 2.4.0
GitHub Repository | Product Reference | REST Documentation | RPC Documentation |
Service Description: A service for managing user data for RAG.
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
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
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
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
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 |
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 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.
Static Methods
create()
public static final VertexRagDataServiceClient create()
Constructs an instance of VertexRagDataServiceClient with default settings.
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(VertexRagDataServiceSettings settings)
public static final VertexRagDataServiceClient create(VertexRagDataServiceSettings settings)
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.
Parameter | |
---|---|
Name | Description |
settings |
VertexRagDataServiceSettings |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient |
Exceptions | |
---|---|
Type | Description |
IOException |
create(VertexRagDataServiceStub stub)
public static final VertexRagDataServiceClient create(VertexRagDataServiceStub stub)
Constructs an instance of VertexRagDataServiceClient, using the given stub for making calls. This is for advanced usage - prefer using create(VertexRagDataServiceSettings).
Parameter | |
---|---|
Name | Description |
stub |
VertexRagDataServiceStub |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient |
Constructors
VertexRagDataServiceClient(VertexRagDataServiceSettings settings)
protected VertexRagDataServiceClient(VertexRagDataServiceSettings settings)
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.
Parameter | |
---|---|
Name | Description |
settings |
VertexRagDataServiceSettings |
VertexRagDataServiceClient(VertexRagDataServiceStub stub)
protected VertexRagDataServiceClient(VertexRagDataServiceStub stub)
Parameter | |
---|---|
Name | Description |
stub |
VertexRagDataServiceStub |
Methods
awaitTermination(long duration, TimeUnit unit)
public boolean awaitTermination(long duration, TimeUnit unit)
Parameters | |
---|---|
Name | Description |
duration |
long |
unit |
TimeUnit |
Returns | |
---|---|
Type | Description |
boolean |
Exceptions | |
---|---|
Type | Description |
InterruptedException |
close()
public final void close()
createRagCorpusAsync(CreateRagCorpusRequest request)
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();
}
Parameter | |
---|---|
Name | Description |
request |
CreateRagCorpusRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> |
createRagCorpusAsync(LocationName parent, RagCorpus ragCorpus)
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 | |
---|---|
Name | Description |
parent |
LocationName Required. The resource name of the Location to create the RagCorpus in. Format:
|
ragCorpus |
RagCorpus Required. The RagCorpus to create. |
Returns | |
---|---|
Type | Description |
OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> |
createRagCorpusAsync(String parent, RagCorpus ragCorpus)
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 | |
---|---|
Name | Description |
parent |
String Required. The resource name of the Location to create the RagCorpus in. Format:
|
ragCorpus |
RagCorpus Required. The RagCorpus to create. |
Returns | |
---|---|
Type | Description |
OperationFuture<RagCorpus,CreateRagCorpusOperationMetadata> |
createRagCorpusCallable()
public final UnaryCallable<CreateRagCorpusRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<CreateRagCorpusRequest,Operation> |
createRagCorpusOperationCallable()
public final OperationCallable<CreateRagCorpusRequest,RagCorpus,CreateRagCorpusOperationMetadata> createRagCorpusOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<CreateRagCorpusRequest,RagCorpus,CreateRagCorpusOperationMetadata> |
deleteRagCorpusAsync(DeleteRagCorpusRequest request)
public final OperationFuture<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)
.build();
vertexRagDataServiceClient.deleteRagCorpusAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request |
DeleteRagCorpusRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteRagCorpusAsync(RagCorpusName name)
public final OperationFuture<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();
}
Parameter | |
---|---|
Name | Description |
name |
RagCorpusName Required. The name of the RagCorpus resource to be deleted. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteRagCorpusAsync(String name)
public final OperationFuture<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();
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the RagCorpus resource to be deleted. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteRagCorpusCallable()
public final UnaryCallable<DeleteRagCorpusRequest,Operation> 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)
.build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.deleteRagCorpusCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteRagCorpusRequest,Operation> |
deleteRagCorpusOperationCallable()
public final OperationCallable<DeleteRagCorpusRequest,Empty,DeleteOperationMetadata> deleteRagCorpusOperationCallable()
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)
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
vertexRagDataServiceClient.deleteRagCorpusOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteRagCorpusRequest,Empty,DeleteOperationMetadata> |
deleteRagFileAsync(DeleteRagFileRequest request)
public final OperationFuture<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())
.build();
vertexRagDataServiceClient.deleteRagFileAsync(request).get();
}
Parameter | |
---|---|
Name | Description |
request |
DeleteRagFileRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteRagFileAsync(RagFileName name)
public final OperationFuture<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();
}
Parameter | |
---|---|
Name | Description |
name |
RagFileName Required. The name of the RagFile resource to be deleted. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteRagFileAsync(String name)
public final OperationFuture<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();
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the RagFile resource to be deleted. Format:
|
Returns | |
---|---|
Type | Description |
OperationFuture<Empty,DeleteOperationMetadata> |
deleteRagFileCallable()
public final UnaryCallable<DeleteRagFileRequest,Operation> 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())
.build();
ApiFuture<Operation> future =
vertexRagDataServiceClient.deleteRagFileCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<DeleteRagFileRequest,Operation> |
deleteRagFileOperationCallable()
public final OperationCallable<DeleteRagFileRequest,Empty,DeleteOperationMetadata> deleteRagFileOperationCallable()
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())
.build();
OperationFuture<Empty, DeleteOperationMetadata> future =
vertexRagDataServiceClient.deleteRagFileOperationCallable().futureCall(request);
// Do something.
future.get();
}
Returns | |
---|---|
Type | Description |
OperationCallable<DeleteRagFileRequest,Empty,DeleteOperationMetadata> |
getIamPolicy(GetIamPolicyRequest request)
public final Policy getIamPolicy(GetIamPolicyRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
com.google.iam.v1.GetIamPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.iam.v1.Policy |
getIamPolicyCallable()
public final UnaryCallable<GetIamPolicyRequest,Policy> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.iam.v1.GetIamPolicyRequest,com.google.iam.v1.Policy> |
getLocation(GetLocationRequest request)
public final Location getLocation(GetLocationRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
com.google.cloud.location.GetLocationRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.cloud.location.Location |
getLocationCallable()
public final UnaryCallable<GetLocationRequest,Location> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.GetLocationRequest,com.google.cloud.location.Location> |
getOperationsClient()
public final OperationsClient getOperationsClient()
Returns the OperationsClient that can be used to query the status of a long-running operation returned by another API method call.
Returns | |
---|---|
Type | Description |
OperationsClient |
getRagCorpus(GetRagCorpusRequest request)
public final RagCorpus getRagCorpus(GetRagCorpusRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
GetRagCorpusRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RagCorpus |
getRagCorpus(RagCorpusName name)
public final RagCorpus getRagCorpus(RagCorpusName name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
RagCorpusName Required. The name of the RagCorpus resource. Format:
|
Returns | |
---|---|
Type | Description |
RagCorpus |
getRagCorpus(String name)
public final RagCorpus getRagCorpus(String name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the RagCorpus resource. Format:
|
Returns | |
---|---|
Type | Description |
RagCorpus |
getRagCorpusCallable()
public final UnaryCallable<GetRagCorpusRequest,RagCorpus> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetRagCorpusRequest,RagCorpus> |
getRagFile(GetRagFileRequest request)
public final RagFile getRagFile(GetRagFileRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
GetRagFileRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
RagFile |
getRagFile(RagFileName name)
public final RagFile getRagFile(RagFileName name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
RagFileName Required. The name of the RagFile resource. Format:
|
Returns | |
---|---|
Type | Description |
RagFile |
getRagFile(String name)
public final RagFile getRagFile(String name)
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);
}
Parameter | |
---|---|
Name | Description |
name |
String Required. The name of the RagFile resource. Format:
|
Returns | |
---|---|
Type | Description |
RagFile |
getRagFileCallable()
public final UnaryCallable<GetRagFileRequest,RagFile> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<GetRagFileRequest,RagFile> |
getSettings()
public final VertexRagDataServiceSettings getSettings()
Returns | |
---|---|
Type | Description |
VertexRagDataServiceSettings |
getStub()
public VertexRagDataServiceStub getStub()
Returns | |
---|---|
Type | Description |
VertexRagDataServiceStub |
importRagFilesAsync(ImportRagFilesRequest request)
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();
}
Parameter | |
---|---|
Name | Description |
request |
ImportRagFilesRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
importRagFilesAsync(RagCorpusName parent, ImportRagFilesConfig importRagFilesConfig)
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 | |
---|---|
Name | Description |
parent |
RagCorpusName Required. The name of the RagCorpus resource into which to import files. Format:
|
importRagFilesConfig |
ImportRagFilesConfig Required. The config for the RagFiles to be synced and imported into the RagCorpus. VertexRagDataService.ImportRagFiles. |
Returns | |
---|---|
Type | Description |
OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
importRagFilesAsync(String parent, ImportRagFilesConfig importRagFilesConfig)
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 | |
---|---|
Name | Description |
parent |
String Required. The name of the RagCorpus resource into which to import files. Format:
|
importRagFilesConfig |
ImportRagFilesConfig Required. The config for the RagFiles to be synced and imported into the RagCorpus. VertexRagDataService.ImportRagFiles. |
Returns | |
---|---|
Type | Description |
OperationFuture<ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
importRagFilesCallable()
public final UnaryCallable<ImportRagFilesRequest,Operation> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ImportRagFilesRequest,Operation> |
importRagFilesOperationCallable()
public final OperationCallable<ImportRagFilesRequest,ImportRagFilesResponse,ImportRagFilesOperationMetadata> importRagFilesOperationCallable()
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();
}
Returns | |
---|---|
Type | Description |
OperationCallable<ImportRagFilesRequest,ImportRagFilesResponse,ImportRagFilesOperationMetadata> |
isShutdown()
public boolean isShutdown()
Returns | |
---|---|
Type | Description |
boolean |
isTerminated()
public boolean isTerminated()
Returns | |
---|---|
Type | Description |
boolean |
listLocations(ListLocationsRequest request)
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);
}
}
Parameter | |
---|---|
Name | Description |
request |
com.google.cloud.location.ListLocationsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient.ListLocationsPagedResponse |
listLocationsCallable()
public final UnaryCallable<ListLocationsRequest,ListLocationsResponse> 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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,com.google.cloud.location.ListLocationsResponse> |
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.cloud.location.ListLocationsRequest,ListLocationsPagedResponse> |
listRagCorpora(ListRagCorporaRequest request)
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);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListRagCorporaRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient.ListRagCorporaPagedResponse |
listRagCorpora(LocationName parent)
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);
}
}
Parameter | |
---|---|
Name | Description |
parent |
LocationName Required. The resource name of the Location from which to list the RagCorpora.
Format: |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient.ListRagCorporaPagedResponse |
listRagCorpora(String parent)
public final VertexRagDataServiceClient.ListRagCorporaPagedResponse listRagCorpora(String 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()) {
String parent = LocationName.of("[PROJECT]", "[LOCATION]").toString();
for (RagCorpus element : vertexRagDataServiceClient.listRagCorpora(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The resource name of the Location from which to list the RagCorpora.
Format: |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient.ListRagCorporaPagedResponse |
listRagCorporaCallable()
public final UnaryCallable<ListRagCorporaRequest,ListRagCorporaResponse> 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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRagCorporaRequest,ListRagCorporaResponse> |
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRagCorporaRequest,ListRagCorporaPagedResponse> |
listRagFiles(ListRagFilesRequest request)
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);
}
}
Parameter | |
---|---|
Name | Description |
request |
ListRagFilesRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient.ListRagFilesPagedResponse |
listRagFiles(RagCorpusName parent)
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);
}
}
Parameter | |
---|---|
Name | Description |
parent |
RagCorpusName Required. The resource name of the RagCorpus from which to list the RagFiles.
Format: |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient.ListRagFilesPagedResponse |
listRagFiles(String parent)
public final VertexRagDataServiceClient.ListRagFilesPagedResponse listRagFiles(String 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()) {
String parent = RagCorpusName.of("[PROJECT]", "[LOCATION]", "[RAG_CORPUS]").toString();
for (RagFile element : vertexRagDataServiceClient.listRagFiles(parent).iterateAll()) {
// doThingsWith(element);
}
}
Parameter | |
---|---|
Name | Description |
parent |
String Required. The resource name of the RagCorpus from which to list the RagFiles.
Format: |
Returns | |
---|---|
Type | Description |
VertexRagDataServiceClient.ListRagFilesPagedResponse |
listRagFilesCallable()
public final UnaryCallable<ListRagFilesRequest,ListRagFilesResponse> 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;
}
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRagFilesRequest,ListRagFilesResponse> |
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);
}
}
Returns | |
---|---|
Type | Description |
UnaryCallable<ListRagFilesRequest,ListRagFilesPagedResponse> |
setIamPolicy(SetIamPolicyRequest request)
public final Policy setIamPolicy(SetIamPolicyRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
com.google.iam.v1.SetIamPolicyRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.iam.v1.Policy |
setIamPolicyCallable()
public final UnaryCallable<SetIamPolicyRequest,Policy> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.iam.v1.SetIamPolicyRequest,com.google.iam.v1.Policy> |
shutdown()
public void shutdown()
shutdownNow()
public void shutdownNow()
testIamPermissions(TestIamPermissionsRequest request)
public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
com.google.iam.v1.TestIamPermissionsRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
com.google.iam.v1.TestIamPermissionsResponse |
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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<com.google.iam.v1.TestIamPermissionsRequest,com.google.iam.v1.TestIamPermissionsResponse> |
uploadRagFile(RagCorpusName parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig)
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 | |
---|---|
Name | Description |
parent |
RagCorpusName Required. The name of the RagCorpus resource into which to upload the file.
Format: |
ragFile |
RagFile Required. The RagFile to upload. |
uploadRagFileConfig |
UploadRagFileConfig Required. The config for the RagFiles to be uploaded into the RagCorpus. VertexRagDataService.UploadRagFile. |
Returns | |
---|---|
Type | Description |
UploadRagFileResponse |
uploadRagFile(UploadRagFileRequest request)
public final UploadRagFileResponse uploadRagFile(UploadRagFileRequest request)
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);
}
Parameter | |
---|---|
Name | Description |
request |
UploadRagFileRequest The request object containing all of the parameters for the API call. |
Returns | |
---|---|
Type | Description |
UploadRagFileResponse |
uploadRagFile(String parent, RagFile ragFile, UploadRagFileConfig uploadRagFileConfig)
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 | |
---|---|
Name | Description |
parent |
String Required. The name of the RagCorpus resource into which to upload the file.
Format: |
ragFile |
RagFile Required. The RagFile to upload. |
uploadRagFileConfig |
UploadRagFileConfig Required. The config for the RagFiles to be uploaded into the RagCorpus. VertexRagDataService.UploadRagFile. |
Returns | |
---|---|
Type | Description |
UploadRagFileResponse |
uploadRagFileCallable()
public final UnaryCallable<UploadRagFileRequest,UploadRagFileResponse> 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();
}
Returns | |
---|---|
Type | Description |
UnaryCallable<UploadRagFileRequest,UploadRagFileResponse> |