Skip to content
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/genai/agentengines.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,18 @@ import {
NodeUploader,
} from '@google/genai/vertex_internal';
import * as converters from './converters/_agentengines_converters.js';
import {Sandboxes} from './sandboxes.js';
import {Sessions} from './sessions.js';
import * as types from './types.js';

export class AgentEngines extends BaseModule {
public readonly sessions: Sessions;
public readonly sandboxes: Sandboxes;

constructor(private readonly apiClient: ApiClient) {
super();
this.sessions = new Sessions(apiClient);
this.sandboxes = new Sandboxes(apiClient);
}

private async createInternal(
Expand Down
169 changes: 169 additions & 0 deletions src/genai/converters/_sandboxes_converters.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/

// Code generated by the Google Gen AI SDK generator DO NOT EDIT.

import type * as genaiTypes from '@google/genai';
import * as common from '@google/genai/vertex_internal';
import * as types from '../types.js';

export function createAgentEngineSandboxConfigToVertex(
fromObject: types.CreateAgentEngineSandboxConfig,
parentObject: Record<string, unknown>,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromDisplayName = common.getValueByPath(fromObject, ['displayName']);
if (parentObject !== undefined && fromDisplayName != null) {
common.setValueByPath(parentObject, ['displayName'], fromDisplayName);
}

const fromDescription = common.getValueByPath(fromObject, ['description']);
if (parentObject !== undefined && fromDescription != null) {
common.setValueByPath(parentObject, ['description'], fromDescription);
}

const fromTtl = common.getValueByPath(fromObject, ['ttl']);
if (parentObject !== undefined && fromTtl != null) {
common.setValueByPath(parentObject, ['ttl'], fromTtl);
}

return toObject;
}

export function createAgentEngineSandboxRequestParametersToVertex(
fromObject: types.CreateAgentEngineSandboxRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

const fromSpec = common.getValueByPath(fromObject, ['spec']);
if (fromSpec != null) {
common.setValueByPath(toObject, ['spec'], fromSpec);
}

const fromConfig = common.getValueByPath(fromObject, ['config']);
if (fromConfig != null) {
createAgentEngineSandboxConfigToVertex(fromConfig, toObject);
}

return toObject;
}

export function deleteAgentEngineSandboxRequestParametersToVertex(
fromObject: types.DeleteAgentEngineSandboxRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

return toObject;
}

export function executeCodeAgentEngineSandboxRequestParametersToVertex(
fromObject: types.ExecuteCodeAgentEngineSandboxRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

const fromInputs = common.getValueByPath(fromObject, ['inputs']);
if (fromInputs != null) {
let transformedList = fromInputs;
if (Array.isArray(transformedList)) {
transformedList = transformedList.map((item) => {
return item;
});
}
common.setValueByPath(toObject, ['inputs'], transformedList);
}

return toObject;
}

export function getAgentEngineSandboxOperationParametersToVertex(
fromObject: types.GetAgentEngineSandboxOperationParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromOperationName = common.getValueByPath(fromObject, [
'operationName',
]);
if (fromOperationName != null) {
common.setValueByPath(
toObject,
['_url', 'operationName'],
fromOperationName,
);
}

return toObject;
}

export function getAgentEngineSandboxRequestParametersToVertex(
fromObject: types.GetAgentEngineSandboxRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

return toObject;
}

export function listAgentEngineSandboxesConfigToVertex(
fromObject: types.ListAgentEngineSandboxesConfig,
parentObject: Record<string, unknown>,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromPageSize = common.getValueByPath(fromObject, ['pageSize']);
if (parentObject !== undefined && fromPageSize != null) {
common.setValueByPath(parentObject, ['_query', 'pageSize'], fromPageSize);
}

const fromPageToken = common.getValueByPath(fromObject, ['pageToken']);
if (parentObject !== undefined && fromPageToken != null) {
common.setValueByPath(parentObject, ['_query', 'pageToken'], fromPageToken);
}

const fromFilter = common.getValueByPath(fromObject, ['filter']);
if (parentObject !== undefined && fromFilter != null) {
common.setValueByPath(parentObject, ['_query', 'filter'], fromFilter);
}

return toObject;
}

export function listAgentEngineSandboxesRequestParametersToVertex(
fromObject: types.ListAgentEngineSandboxesRequestParameters,
): Record<string, unknown> {
const toObject: Record<string, unknown> = {};

const fromName = common.getValueByPath(fromObject, ['name']);
if (fromName != null) {
common.setValueByPath(toObject, ['_url', 'name'], fromName);
}

const fromConfig = common.getValueByPath(fromObject, ['config']);
if (fromConfig != null) {
listAgentEngineSandboxesConfigToVertex(fromConfig, toObject);
}

return toObject;
}
Loading
Loading