Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.google.cloud.vertexai.genai;

import okhttp3.Headers;
import okhttp3.ResponseBody;

/** The API response contains a response to a call to the GenAI APIs. */
abstract class ApiResponse implements AutoCloseable {
/** Gets the ResponseBody. */
public abstract ResponseBody getBody();

/** Returns all of the headers from the response. */
public abstract Headers getHeaders();

@Override
public abstract void close();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Auto-generated code. Do not edit.

package com.google.cloud.vertexai.genai;

import com.google.cloud.vertexai.genai.types.AgentEngineOperation;
import com.google.cloud.vertexai.genai.types.CreateAgentEngineConfig;
import com.google.cloud.vertexai.genai.types.DeleteAgentEngineConfig;
import com.google.cloud.vertexai.genai.types.DeleteAgentEngineOperation;
import com.google.cloud.vertexai.genai.types.GetAgentEngineConfig;
import com.google.cloud.vertexai.genai.types.GetAgentEngineOperationConfig;
import com.google.cloud.vertexai.genai.types.ListAgentEngineConfig;
import com.google.cloud.vertexai.genai.types.ListReasoningEnginesResponse;
import com.google.cloud.vertexai.genai.types.QueryAgentEngineConfig;
import com.google.cloud.vertexai.genai.types.QueryReasoningEngineResponse;
import com.google.cloud.vertexai.genai.types.ReasoningEngine;
import com.google.cloud.vertexai.genai.types.UpdateAgentEngineConfig;
import com.google.genai.ApiClient;
import com.google.genai.ApiResponse;
import com.google.genai.Common.BuiltRequest;
import java.util.concurrent.CompletableFuture;

/** Async module of {@link AgentEngines} */
public final class AsyncAgentEngines {

AgentEngines agentEngines;
ApiClient apiClient;

public AsyncAgentEngines(ApiClient apiClient) {
this.apiClient = apiClient;
this.agentEngines = new AgentEngines(apiClient);
}

CompletableFuture<AgentEngineOperation> privateCreate(CreateAgentEngineConfig config) {
BuiltRequest builtRequest = agentEngines.buildRequestForPrivateCreate(config);
return this.apiClient
.asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return agentEngines.processResponseForPrivateCreate(res, config);
}
});
}

CompletableFuture<DeleteAgentEngineOperation> privateDelete(
String name, boolean force, DeleteAgentEngineConfig config) {
BuiltRequest builtRequest = agentEngines.buildRequestForPrivateDelete(name, force, config);
return this.apiClient
.asyncRequest(
"delete", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return agentEngines.processResponseForPrivateDelete(res, config);
}
});
}

CompletableFuture<ReasoningEngine> privateGet(String name, GetAgentEngineConfig config) {
BuiltRequest builtRequest = agentEngines.buildRequestForPrivateGet(name, config);
return this.apiClient
.asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return agentEngines.processResponseForPrivateGet(res, config);
}
});
}

CompletableFuture<ListReasoningEnginesResponse> privateList(ListAgentEngineConfig config) {
BuiltRequest builtRequest = agentEngines.buildRequestForPrivateList(config);
return this.apiClient
.asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return agentEngines.processResponseForPrivateList(res, config);
}
});
}

CompletableFuture<AgentEngineOperation> privateGetAgentOperation(
String operationName, GetAgentEngineOperationConfig config) {
BuiltRequest builtRequest =
agentEngines.buildRequestForPrivateGetAgentOperation(operationName, config);
return this.apiClient
.asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return agentEngines.processResponseForPrivateGetAgentOperation(res, config);
}
});
}

CompletableFuture<QueryReasoningEngineResponse> privateQuery(
String name, QueryAgentEngineConfig config) {
BuiltRequest builtRequest = agentEngines.buildRequestForPrivateQuery(name, config);
return this.apiClient
.asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return agentEngines.processResponseForPrivateQuery(res, config);
}
});
}

CompletableFuture<AgentEngineOperation> privateUpdate(
String name, UpdateAgentEngineConfig config) {
BuiltRequest builtRequest = agentEngines.buildRequestForPrivateUpdate(name, config);
return this.apiClient
.asyncRequest("patch", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return agentEngines.processResponseForPrivateUpdate(res, config);
}
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
/*
* Copyright 2025 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Auto-generated code. Do not edit.

package com.google.cloud.vertexai.genai;

import com.google.cloud.vertexai.genai.types.AssembleDatasetConfig;
import com.google.cloud.vertexai.genai.types.CreateMultimodalDatasetConfig;
import com.google.cloud.vertexai.genai.types.GeminiRequestReadConfig;
import com.google.cloud.vertexai.genai.types.GetMultimodalDatasetOperationConfig;
import com.google.cloud.vertexai.genai.types.ListMultimodalDatasetsConfig;
import com.google.cloud.vertexai.genai.types.ListMultimodalDatasetsResponse;
import com.google.cloud.vertexai.genai.types.MultimodalDataset;
import com.google.cloud.vertexai.genai.types.MultimodalDatasetOperation;
import com.google.cloud.vertexai.genai.types.SchemaTablesDatasetMetadata;
import com.google.cloud.vertexai.genai.types.UpdateMultimodalDatasetConfig;
import com.google.cloud.vertexai.genai.types.VertexBaseConfig;
import com.google.genai.ApiClient;
import com.google.genai.ApiResponse;
import com.google.genai.Common.BuiltRequest;
import com.google.genai.types.EncryptionSpec;
import java.util.concurrent.CompletableFuture;

/** Async module of {@link Datasets} */
public final class AsyncDatasets {

Datasets datasets;
ApiClient apiClient;

public AsyncDatasets(ApiClient apiClient) {
this.apiClient = apiClient;
this.datasets = new Datasets(apiClient);
}

CompletableFuture<MultimodalDatasetOperation> privateAssembleMultimodalDataset(
String name, GeminiRequestReadConfig geminiRequestReadConfig, AssembleDatasetConfig config) {
BuiltRequest builtRequest =
datasets.buildRequestForPrivateAssembleMultimodalDataset(
name, geminiRequestReadConfig, config);
return this.apiClient
.asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return datasets.processResponseForPrivateAssembleMultimodalDataset(res, config);
}
});
}

CompletableFuture<MultimodalDatasetOperation> privateCreateMultimodalDataset(
String name,
String displayName,
String metadataSchemaUri,
SchemaTablesDatasetMetadata metadata,
String description,
EncryptionSpec encryptionSpec,
CreateMultimodalDatasetConfig config) {
BuiltRequest builtRequest =
datasets.buildRequestForPrivateCreateMultimodalDataset(
name, displayName, metadataSchemaUri, metadata, description, encryptionSpec, config);
return this.apiClient
.asyncRequest("post", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return datasets.processResponseForPrivateCreateMultimodalDataset(res, config);
}
});
}

CompletableFuture<MultimodalDatasetOperation> privateDeleteMultimodalDataset(
String name, VertexBaseConfig config) {
BuiltRequest builtRequest =
datasets.buildRequestForPrivateDeleteMultimodalDataset(name, config);
return this.apiClient
.asyncRequest(
"delete", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return datasets.processResponseForPrivateDeleteMultimodalDataset(res, config);
}
});
}

CompletableFuture<MultimodalDataset> privateGetMultimodalDataset(
String name, VertexBaseConfig config) {
BuiltRequest builtRequest = datasets.buildRequestForPrivateGetMultimodalDataset(name, config);
return this.apiClient
.asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return datasets.processResponseForPrivateGetMultimodalDataset(res, config);
}
});
}

CompletableFuture<MultimodalDatasetOperation> privateGetMultimodalDatasetOperation(
String datasetId, String operationId, GetMultimodalDatasetOperationConfig config) {
BuiltRequest builtRequest =
datasets.buildRequestForPrivateGetMultimodalDatasetOperation(
datasetId, operationId, config);
return this.apiClient
.asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return datasets.processResponseForPrivateGetMultimodalDatasetOperation(res, config);
}
});
}

CompletableFuture<ListMultimodalDatasetsResponse> privateListMultimodalDatasets(
ListMultimodalDatasetsConfig config) {
BuiltRequest builtRequest = datasets.buildRequestForPrivateListMultimodalDatasets(config);
return this.apiClient
.asyncRequest("get", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return datasets.processResponseForPrivateListMultimodalDatasets(res, config);
}
});
}

CompletableFuture<MultimodalDataset> privateUpdateMultimodalDataset(
String name,
String displayName,
SchemaTablesDatasetMetadata metadata,
String description,
EncryptionSpec encryptionSpec,
UpdateMultimodalDatasetConfig config) {
BuiltRequest builtRequest =
datasets.buildRequestForPrivateUpdateMultimodalDataset(
name, displayName, metadata, description, encryptionSpec, config);
return this.apiClient
.asyncRequest("patch", builtRequest.path(), builtRequest.body(), builtRequest.httpOptions())
.thenApplyAsync(
response -> {
try (ApiResponse res = response) {
return datasets.processResponseForPrivateUpdateMultimodalDataset(res, config);
}
});
}
}
Loading
Loading