diff --git a/src/agentengines.ts b/src/agentengines.ts index ac654d4e..70b9fd75 100644 --- a/src/agentengines.ts +++ b/src/agentengines.ts @@ -17,13 +17,11 @@ import * as types from './types.js'; export class AgentEngines extends BaseModule { public readonly sessions: Sessions; public readonly sandboxes: Sandboxes; - public readonly memories: Memories; constructor(private readonly apiClient: ApiClient) { super(); this.sessions = new Sessions(apiClient); this.sandboxes = new Sandboxes(apiClient); - this.memories = new Memories(apiClient); } async createInternal( diff --git a/src/converters/_memories_converters.ts b/src/converters/_memories_converters.ts deleted file mode 100644 index c51ec829..00000000 --- a/src/converters/_memories_converters.ts +++ /dev/null @@ -1,740 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -// Code generated by the Google Gen AI SDK generator DO NOT EDIT. - -import * as common from '@google/genai/vertex_internal'; -import * as types from '../types.js'; - -export function agentEngineMemoryConfigToVertex( - fromObject: types.AgentEngineMemoryConfig, - parentObject: Record, -): Record { - const toObject: Record = {}; - - 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); - } - - const fromExpireTime = common.getValueByPath(fromObject, ['expireTime']); - if (parentObject !== undefined && fromExpireTime != null) { - common.setValueByPath(parentObject, ['expireTime'], fromExpireTime); - } - - const fromRevisionExpireTime = common.getValueByPath(fromObject, [ - 'revisionExpireTime', - ]); - if (parentObject !== undefined && fromRevisionExpireTime != null) { - common.setValueByPath( - parentObject, - ['revisionExpireTime'], - fromRevisionExpireTime, - ); - } - - const fromRevisionTtl = common.getValueByPath(fromObject, ['revisionTtl']); - if (parentObject !== undefined && fromRevisionTtl != null) { - common.setValueByPath(parentObject, ['revisionTtl'], fromRevisionTtl); - } - - const fromDisableMemoryRevisions = common.getValueByPath(fromObject, [ - 'disableMemoryRevisions', - ]); - if (parentObject !== undefined && fromDisableMemoryRevisions != null) { - common.setValueByPath( - parentObject, - ['disableMemoryRevisions'], - fromDisableMemoryRevisions, - ); - } - - const fromTopics = common.getValueByPath(fromObject, ['topics']); - if (parentObject !== undefined && fromTopics != null) { - let transformedList = fromTopics; - if (Array.isArray(transformedList)) { - transformedList = transformedList.map((item) => { - return item; - }); - } - common.setValueByPath(parentObject, ['topics'], transformedList); - } - - const fromMetadata = common.getValueByPath(fromObject, ['metadata']); - if (parentObject !== undefined && fromMetadata != null) { - common.setValueByPath(parentObject, ['metadata'], fromMetadata); - } - - const fromMemoryId = common.getValueByPath(fromObject, ['memoryId']); - if (parentObject !== undefined && fromMemoryId != null) { - common.setValueByPath(parentObject, ['_query', 'memoryId'], fromMemoryId); - } - - return toObject; -} - -export function createAgentEngineMemoryRequestParametersToVertex( - fromObject: types.CreateAgentEngineMemoryRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromFact = common.getValueByPath(fromObject, ['fact']); - if (fromFact != null) { - common.setValueByPath(toObject, ['fact'], fromFact); - } - - const fromScope = common.getValueByPath(fromObject, ['scope']); - if (fromScope != null) { - common.setValueByPath(toObject, ['scope'], fromScope); - } - - const fromConfig = common.getValueByPath(fromObject, ['config']); - if (fromConfig != null) { - agentEngineMemoryConfigToVertex(fromConfig, toObject); - } - - return toObject; -} - -export function deleteAgentEngineMemoryRequestParametersToVertex( - fromObject: types.DeleteAgentEngineMemoryRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - return toObject; -} - -export function generateAgentEngineMemoriesConfigToVertex( - fromObject: types.GenerateAgentEngineMemoriesConfig, - parentObject: Record, -): Record { - const toObject: Record = {}; - - const fromDisableConsolidation = common.getValueByPath(fromObject, [ - 'disableConsolidation', - ]); - if (parentObject !== undefined && fromDisableConsolidation != null) { - common.setValueByPath( - parentObject, - ['disableConsolidation'], - fromDisableConsolidation, - ); - } - - const fromRevisionLabels = common.getValueByPath(fromObject, [ - 'revisionLabels', - ]); - if (parentObject !== undefined && fromRevisionLabels != null) { - common.setValueByPath(parentObject, ['revisionLabels'], fromRevisionLabels); - } - - const fromRevisionExpireTime = common.getValueByPath(fromObject, [ - 'revisionExpireTime', - ]); - if (parentObject !== undefined && fromRevisionExpireTime != null) { - common.setValueByPath( - parentObject, - ['revisionExpireTime'], - fromRevisionExpireTime, - ); - } - - const fromRevisionTtl = common.getValueByPath(fromObject, ['revisionTtl']); - if (parentObject !== undefined && fromRevisionTtl != null) { - common.setValueByPath(parentObject, ['revisionTtl'], fromRevisionTtl); - } - - const fromDisableMemoryRevisions = common.getValueByPath(fromObject, [ - 'disableMemoryRevisions', - ]); - if (parentObject !== undefined && fromDisableMemoryRevisions != null) { - common.setValueByPath( - parentObject, - ['disableMemoryRevisions'], - fromDisableMemoryRevisions, - ); - } - - const fromMetadata = common.getValueByPath(fromObject, ['metadata']); - if (parentObject !== undefined && fromMetadata != null) { - common.setValueByPath(parentObject, ['metadata'], fromMetadata); - } - - const fromMetadataMergeStrategy = common.getValueByPath(fromObject, [ - 'metadataMergeStrategy', - ]); - if (parentObject !== undefined && fromMetadataMergeStrategy != null) { - common.setValueByPath( - parentObject, - ['metadataMergeStrategy'], - fromMetadataMergeStrategy, - ); - } - - const fromAllowedTopics = common.getValueByPath(fromObject, [ - 'allowedTopics', - ]); - if (parentObject !== undefined && fromAllowedTopics != null) { - let transformedList = fromAllowedTopics; - if (Array.isArray(transformedList)) { - transformedList = transformedList.map((item) => { - return item; - }); - } - common.setValueByPath(parentObject, ['allowedTopics'], transformedList); - } - - return toObject; -} - -export function generateAgentEngineMemoriesRequestParametersToVertex( - fromObject: types.GenerateAgentEngineMemoriesRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromVertexSessionSource = common.getValueByPath(fromObject, [ - 'vertexSessionSource', - ]); - if (fromVertexSessionSource != null) { - common.setValueByPath( - toObject, - ['vertexSessionSource'], - fromVertexSessionSource, - ); - } - - const fromDirectContentsSource = common.getValueByPath(fromObject, [ - 'directContentsSource', - ]); - if (fromDirectContentsSource != null) { - common.setValueByPath( - toObject, - ['directContentsSource'], - fromDirectContentsSource, - ); - } - - const fromDirectMemoriesSource = common.getValueByPath(fromObject, [ - 'directMemoriesSource', - ]); - if (fromDirectMemoriesSource != null) { - common.setValueByPath( - toObject, - ['directMemoriesSource'], - fromDirectMemoriesSource, - ); - } - - const fromScope = common.getValueByPath(fromObject, ['scope']); - if (fromScope != null) { - common.setValueByPath(toObject, ['scope'], fromScope); - } - - const fromConfig = common.getValueByPath(fromObject, ['config']); - if (fromConfig != null) { - generateAgentEngineMemoriesConfigToVertex(fromConfig, toObject); - } - - return toObject; -} - -export function getAgentEngineGenerateMemoriesOperationParametersToVertex( - fromObject: types.GetAgentEngineGenerateMemoriesOperationParameters, -): Record { - const toObject: Record = {}; - - const fromOperationName = common.getValueByPath(fromObject, [ - 'operationName', - ]); - if (fromOperationName != null) { - common.setValueByPath( - toObject, - ['_url', 'operationName'], - fromOperationName, - ); - } - - return toObject; -} - -export function getAgentEngineMemoryOperationParametersToVertex( - fromObject: types.GetAgentEngineMemoryOperationParameters, -): Record { - const toObject: Record = {}; - - const fromOperationName = common.getValueByPath(fromObject, [ - 'operationName', - ]); - if (fromOperationName != null) { - common.setValueByPath( - toObject, - ['_url', 'operationName'], - fromOperationName, - ); - } - - return toObject; -} - -export function getAgentEngineMemoryRequestParametersToVertex( - fromObject: types.GetAgentEngineMemoryRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - return toObject; -} - -export function ingestEventsConfigToVertex( - fromObject: types.IngestEventsConfig, - parentObject: Record, -): Record { - const toObject: Record = {}; - - const fromForceFlush = common.getValueByPath(fromObject, ['forceFlush']); - if (parentObject !== undefined && fromForceFlush != null) { - common.setValueByPath(parentObject, ['forceFlush'], fromForceFlush); - } - - const fromRevisionLabels = common.getValueByPath(fromObject, [ - 'revisionLabels', - ]); - if (parentObject !== undefined && fromRevisionLabels != null) { - common.setValueByPath(parentObject, ['revisionLabels'], fromRevisionLabels); - } - - const fromRevisionExpireTime = common.getValueByPath(fromObject, [ - 'revisionExpireTime', - ]); - if (parentObject !== undefined && fromRevisionExpireTime != null) { - common.setValueByPath( - parentObject, - ['revisionExpireTime'], - fromRevisionExpireTime, - ); - } - - const fromRevisionTtl = common.getValueByPath(fromObject, ['revisionTtl']); - if (parentObject !== undefined && fromRevisionTtl != null) { - common.setValueByPath(parentObject, ['revisionTtl'], fromRevisionTtl); - } - - const fromDisableMemoryRevisions = common.getValueByPath(fromObject, [ - 'disableMemoryRevisions', - ]); - if (parentObject !== undefined && fromDisableMemoryRevisions != null) { - common.setValueByPath( - parentObject, - ['disableMemoryRevisions'], - fromDisableMemoryRevisions, - ); - } - - const fromMetadata = common.getValueByPath(fromObject, ['metadata']); - if (parentObject !== undefined && fromMetadata != null) { - common.setValueByPath(parentObject, ['metadata'], fromMetadata); - } - - const fromMetadataMergeStrategy = common.getValueByPath(fromObject, [ - 'metadataMergeStrategy', - ]); - if (parentObject !== undefined && fromMetadataMergeStrategy != null) { - common.setValueByPath( - parentObject, - ['metadataMergeStrategy'], - fromMetadataMergeStrategy, - ); - } - - return toObject; -} - -export function ingestEventsRequestParametersToVertex( - fromObject: types.IngestEventsRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromStreamId = common.getValueByPath(fromObject, ['streamId']); - if (fromStreamId != null) { - common.setValueByPath(toObject, ['streamId'], fromStreamId); - } - - const fromDirectContentsSource = common.getValueByPath(fromObject, [ - 'directContentsSource', - ]); - if (fromDirectContentsSource != null) { - common.setValueByPath( - toObject, - ['directContentsSource'], - fromDirectContentsSource, - ); - } - - const fromScope = common.getValueByPath(fromObject, ['scope']); - if (fromScope != null) { - common.setValueByPath(toObject, ['scope'], fromScope); - } - - const fromGenerationTriggerConfig = common.getValueByPath(fromObject, [ - 'generationTriggerConfig', - ]); - if (fromGenerationTriggerConfig != null) { - common.setValueByPath( - toObject, - ['generationTriggerConfig'], - fromGenerationTriggerConfig, - ); - } - - const fromConfig = common.getValueByPath(fromObject, ['config']); - if (fromConfig != null) { - ingestEventsConfigToVertex(fromConfig, toObject); - } - - return toObject; -} - -export function listAgentEngineMemoryConfigToVertex( - fromObject: types.ListAgentEngineMemoryConfig, - parentObject: Record, -): Record { - const toObject: Record = {}; - - 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); - } - - const fromOrderBy = common.getValueByPath(fromObject, ['orderBy']); - if (parentObject !== undefined && fromOrderBy != null) { - common.setValueByPath(parentObject, ['_query', 'orderBy'], fromOrderBy); - } - - return toObject; -} - -export function listAgentEngineMemoryRequestParametersToVertex( - fromObject: types.ListAgentEngineMemoryRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromConfig = common.getValueByPath(fromObject, ['config']); - if (fromConfig != null) { - listAgentEngineMemoryConfigToVertex(fromConfig, toObject); - } - - return toObject; -} - -export function purgeAgentEngineMemoriesRequestParametersToVertex( - fromObject: types.PurgeAgentEngineMemoriesRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromFilter = common.getValueByPath(fromObject, ['filter']); - if (fromFilter != null) { - common.setValueByPath(toObject, ['filter'], fromFilter); - } - - const fromFilterGroups = common.getValueByPath(fromObject, ['filterGroups']); - if (fromFilterGroups != null) { - let transformedList = fromFilterGroups; - if (Array.isArray(transformedList)) { - transformedList = transformedList.map((item) => { - return item; - }); - } - common.setValueByPath(toObject, ['filterGroups'], transformedList); - } - - const fromForce = common.getValueByPath(fromObject, ['force']); - if (fromForce != null) { - common.setValueByPath(toObject, ['force'], fromForce); - } - - return toObject; -} - -export function retrieveAgentEngineMemoriesConfigToVertex( - fromObject: types.RetrieveAgentEngineMemoriesConfig, - parentObject: Record, -): Record { - const toObject: Record = {}; - - const fromFilter = common.getValueByPath(fromObject, ['filter']); - if (parentObject !== undefined && fromFilter != null) { - common.setValueByPath(parentObject, ['filter'], fromFilter); - } - - const fromFilterGroups = common.getValueByPath(fromObject, ['filterGroups']); - if (parentObject !== undefined && fromFilterGroups != null) { - let transformedList = fromFilterGroups; - if (Array.isArray(transformedList)) { - transformedList = transformedList.map((item) => { - return item; - }); - } - common.setValueByPath(parentObject, ['filterGroups'], transformedList); - } - - const fromMemoryTypes = common.getValueByPath(fromObject, ['memoryTypes']); - if (parentObject !== undefined && fromMemoryTypes != null) { - common.setValueByPath(parentObject, ['memoryTypes'], fromMemoryTypes); - } - - return toObject; -} - -export function retrieveAgentEngineMemoriesRequestParametersToVertex( - fromObject: types.RetrieveAgentEngineMemoriesRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromScope = common.getValueByPath(fromObject, ['scope']); - if (fromScope != null) { - common.setValueByPath(toObject, ['scope'], fromScope); - } - - const fromSimilaritySearchParams = common.getValueByPath(fromObject, [ - 'similaritySearchParams', - ]); - if (fromSimilaritySearchParams != null) { - common.setValueByPath( - toObject, - ['similaritySearchParams'], - fromSimilaritySearchParams, - ); - } - - const fromSimpleRetrievalParams = common.getValueByPath(fromObject, [ - 'simpleRetrievalParams', - ]); - if (fromSimpleRetrievalParams != null) { - common.setValueByPath( - toObject, - ['simpleRetrievalParams'], - fromSimpleRetrievalParams, - ); - } - - const fromConfig = common.getValueByPath(fromObject, ['config']); - if (fromConfig != null) { - retrieveAgentEngineMemoriesConfigToVertex(fromConfig, toObject); - } - - return toObject; -} - -export function retrieveMemoryProfilesRequestParametersToVertex( - fromObject: types.RetrieveMemoryProfilesRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromScope = common.getValueByPath(fromObject, ['scope']); - if (fromScope != null) { - common.setValueByPath(toObject, ['scope'], fromScope); - } - - return toObject; -} - -export function rollbackAgentEngineMemoryRequestParametersToVertex( - fromObject: types.RollbackAgentEngineMemoryRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromTargetRevisionId = common.getValueByPath(fromObject, [ - 'targetRevisionId', - ]); - if (fromTargetRevisionId != null) { - common.setValueByPath(toObject, ['targetRevisionId'], fromTargetRevisionId); - } - - return toObject; -} - -export function updateAgentEngineMemoryConfigToVertex( - fromObject: types.UpdateAgentEngineMemoryConfig, - parentObject: Record, -): Record { - const toObject: Record = {}; - - 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); - } - - const fromExpireTime = common.getValueByPath(fromObject, ['expireTime']); - if (parentObject !== undefined && fromExpireTime != null) { - common.setValueByPath(parentObject, ['expireTime'], fromExpireTime); - } - - const fromRevisionExpireTime = common.getValueByPath(fromObject, [ - 'revisionExpireTime', - ]); - if (parentObject !== undefined && fromRevisionExpireTime != null) { - common.setValueByPath( - parentObject, - ['revisionExpireTime'], - fromRevisionExpireTime, - ); - } - - const fromRevisionTtl = common.getValueByPath(fromObject, ['revisionTtl']); - if (parentObject !== undefined && fromRevisionTtl != null) { - common.setValueByPath(parentObject, ['revisionTtl'], fromRevisionTtl); - } - - const fromDisableMemoryRevisions = common.getValueByPath(fromObject, [ - 'disableMemoryRevisions', - ]); - if (parentObject !== undefined && fromDisableMemoryRevisions != null) { - common.setValueByPath( - parentObject, - ['disableMemoryRevisions'], - fromDisableMemoryRevisions, - ); - } - - const fromTopics = common.getValueByPath(fromObject, ['topics']); - if (parentObject !== undefined && fromTopics != null) { - let transformedList = fromTopics; - if (Array.isArray(transformedList)) { - transformedList = transformedList.map((item) => { - return item; - }); - } - common.setValueByPath(parentObject, ['topics'], transformedList); - } - - const fromMetadata = common.getValueByPath(fromObject, ['metadata']); - if (parentObject !== undefined && fromMetadata != null) { - common.setValueByPath(parentObject, ['metadata'], fromMetadata); - } - - const fromMemoryId = common.getValueByPath(fromObject, ['memoryId']); - if (parentObject !== undefined && fromMemoryId != null) { - common.setValueByPath(parentObject, ['_query', 'memoryId'], fromMemoryId); - } - - const fromUpdateMask = common.getValueByPath(fromObject, ['updateMask']); - if (parentObject !== undefined && fromUpdateMask != null) { - common.setValueByPath( - parentObject, - ['_query', 'updateMask'], - fromUpdateMask, - ); - } - - return toObject; -} - -export function updateAgentEngineMemoryRequestParametersToVertex( - fromObject: types.UpdateAgentEngineMemoryRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromFact = common.getValueByPath(fromObject, ['fact']); - if (fromFact != null) { - common.setValueByPath(toObject, ['fact'], fromFact); - } - - const fromScope = common.getValueByPath(fromObject, ['scope']); - if (fromScope != null) { - common.setValueByPath(toObject, ['scope'], fromScope); - } - - const fromConfig = common.getValueByPath(fromObject, ['config']); - if (fromConfig != null) { - updateAgentEngineMemoryConfigToVertex(fromConfig, toObject); - } - - return toObject; -} diff --git a/src/converters/_memoryrevisions_converters.ts b/src/converters/_memoryrevisions_converters.ts deleted file mode 100644 index d963a398..00000000 --- a/src/converters/_memoryrevisions_converters.ts +++ /dev/null @@ -1,65 +0,0 @@ -/** - * @license - * Copyright 2025 Google LLC - * SPDX-License-Identifier: Apache-2.0 - */ - -// Code generated by the Google Gen AI SDK generator DO NOT EDIT. - -import * as common from '@google/genai/vertex_internal'; -import * as types from '../types.js'; - -export function getAgentEngineMemoryRevisionRequestParametersToVertex( - fromObject: types.GetAgentEngineMemoryRevisionRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - return toObject; -} - -export function listAgentEngineMemoryRevisionsConfigToVertex( - fromObject: types.ListAgentEngineMemoryRevisionsConfig, - parentObject: Record, -): Record { - const toObject: Record = {}; - - 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 listAgentEngineMemoryRevisionsRequestParametersToVertex( - fromObject: types.ListAgentEngineMemoryRevisionsRequestParameters, -): Record { - const toObject: Record = {}; - - const fromName = common.getValueByPath(fromObject, ['name']); - if (fromName != null) { - common.setValueByPath(toObject, ['_url', 'name'], fromName); - } - - const fromConfig = common.getValueByPath(fromObject, ['config']); - if (fromConfig != null) { - listAgentEngineMemoryRevisionsConfigToVertex(fromConfig, toObject); - } - - return toObject; -} diff --git a/src/types/common.ts b/src/types/common.ts index 4c1f5580..94c755e7 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -64,42 +64,6 @@ export enum ManagedTopicEnum { EXPLICIT_INSTRUCTIONS = 'EXPLICIT_INSTRUCTIONS', } -/** The type of the memory. */ -export enum MemoryType { - /** - * Represents an unspecified memory type. This value should not be used. - */ - MEMORY_TYPE_UNSPECIFIED = 'MEMORY_TYPE_UNSPECIFIED', - /** - * Indicates belonging to a collection of natural language memories. - */ - NATURAL_LANGUAGE_COLLECTION = 'NATURAL_LANGUAGE_COLLECTION', - /** - * Indicates belonging to a structured profile. - */ - STRUCTURED_PROFILE = 'STRUCTURED_PROFILE', -} - -/** Represents the operator to apply to the filter. If not set, then EQUAL will be used. */ -export enum Operator { - /** - * Represents an unspecified operator. Defaults to EQUAL. - */ - OPERATOR_UNSPECIFIED = 'OPERATOR_UNSPECIFIED', - /** - * Equal to. - */ - EQUAL = 'EQUAL', - /** - * Greater than. - */ - GREATER_THAN = 'GREATER_THAN', - /** - * Less than. - */ - LESS_THAN = 'LESS_THAN', -} - /** The coding language supported in this environment. */ export enum Language { /** @@ -236,46 +200,6 @@ export enum Framework { ANGULAR = 'ANGULAR', } -/** The strategy to use when applying metadata to existing memories during consolidation. */ -export enum MemoryMetadataMergeStrategy { - /** - * The metadata merge strategy is unspecified. - */ - METADATA_MERGE_STRATEGY_UNSPECIFIED = 'METADATA_MERGE_STRATEGY_UNSPECIFIED', - /** - * Replace the metadata of the updated memories with the new metadata. - */ - OVERWRITE = 'OVERWRITE', - /** - * Append new metadata to the existing metadata. If there are duplicate keys, the existing values will be overwritten. - */ - MERGE = 'MERGE', - /** - * Restrict consolidation to memories that have exactly the same metadata as the request. If a memory doesn't have the same metadata, it is not eligible for consolidation. - */ - REQUIRE_EXACT_MATCH = 'REQUIRE_EXACT_MATCH', -} - -/** The action to take. */ -export enum GenerateMemoriesResponseGeneratedMemoryAction { - /** - * The action is unspecified. - */ - ACTION_UNSPECIFIED = 'ACTION_UNSPECIFIED', - /** - * The memory was created. - */ - CREATED = 'CREATED', - /** - * The memory was updated. The `fact` field may not be updated if the existing fact is still accurate. - */ - UPDATED = 'UPDATED', - /** - * The memory was deleted. - */ - DELETED = 'DELETED', -} - /** State of the Skill Revision. */ export enum SkillRevisionState { /** @@ -300,6 +224,22 @@ export enum SkillRevisionState { DELETING = 'DELETING', } +/** The type of the memory. */ +export enum MemoryType { + /** + * Represents an unspecified memory type. This value should not be used. + */ + MEMORY_TYPE_UNSPECIFIED = 'MEMORY_TYPE_UNSPECIFIED', + /** + * Indicates belonging to a collection of natural language memories. + */ + NATURAL_LANGUAGE_COLLECTION = 'NATURAL_LANGUAGE_COLLECTION', + /** + * Indicates belonging to a structured profile. + */ + STRUCTURED_PROFILE = 'STRUCTURED_PROFILE', +} + /** Represents an environment variable present in a Container or Python Module. */ export declare interface EnvVar { /** Required. Name of the environment variable. Must be a valid C identifier. */ @@ -527,7 +467,7 @@ export declare interface MemoryBankCustomizationConfigGenerateMemoriesExampleCon events?: MemoryBankCustomizationConfigGenerateMemoriesExampleConversationSourceEvent[]; } -/** The topic ID for a memory. */ +/** A memory topic identifier. This will be used to label a Memory and to restrict which topics are eligible for generation or retrieval. */ export declare interface MemoryTopicId { /** Optional. Represents the custom memory topic label. */ customMemoryTopicLabel?: string; @@ -607,7 +547,7 @@ export declare interface MemoryGenerationTriggerConfigGenerationTriggerRule { overlapEventCount?: number; } -/** The configuration for triggering memory generation for ingested events. */ +/** Represents configuration for triggering generation. */ export declare interface MemoryGenerationTriggerConfig { /** Optional. Represents the active rule that determines when to flush the buffer. If not set, then the stream will be force flushed immediately. */ generationRule?: MemoryGenerationTriggerConfigGenerationTriggerRule; @@ -1153,833 +1093,6 @@ export declare interface UpdateAgentEngineRequestParameters { config?: UpdateAgentEngineConfig; } -/** The metadata values for memories. */ -export declare interface MemoryMetadataValue { - /** Represents a boolean value. */ - boolValue?: boolean; - /** Represents a double value. */ - doubleValue?: number; - /** Represents a string value. */ - stringValue?: string; - /** Represents a timestamp value. When filtering on timestamp values, only the seconds field will be compared. */ - timestampValue?: string; -} - -/** Config for creating a Memory. */ -export declare interface AgentEngineMemoryConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - /** The display name of the memory. */ - displayName?: string; - /** The description of the memory. */ - description?: string; - /** Waits for the operation to complete before returning. */ - waitForCompletion?: boolean; - /** Optional. Input only. The TTL for this resource. - - The expiration time is computed: now + TTL. */ - ttl?: string; - /** Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input. */ - expireTime?: string; - /** Optional. Input only. Timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted. */ - revisionExpireTime?: string; - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - revisionTtl?: string; - /** Optional. Input only. If true, no revision will be created for this request. */ - disableMemoryRevisions?: boolean; - /** Optional. The topics of the memory. */ - topics?: MemoryTopicId[]; - /** Optional. User-provided metadata for the Memory. This information was provided when creating, updating, or generating the Memory. It was not generated by Memory Bank. */ - metadata?: Record; - /** Optional. The user defined ID to use for memory, which will become the final component of the memory resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number. */ - memoryId?: string; -} - -/** Parameters for creating Agent Engine Memories. */ -export declare interface CreateAgentEngineMemoryRequestParameters { - /** Name of the agent engine to create the memory under. */ - name: string; - /** The fact of the memory. - - This is the semantic knowledge extracted from the source content). */ - fact: string; - /** The scope of the memory. - - Memories are isolated within their scope. The scope is defined when - creating or generating memories. Up to 5 key-value pairs are accepted, - and scope values cannot contain the wildcard character '*'. */ - scope: Record; - config?: AgentEngineMemoryConfig; -} - -/** Represents the structured value of the memory. */ -export declare interface MemoryStructuredContent { - /** Required. Represents the structured value of the memory. */ - data?: Record; - /** Required. Represents the schema ID for which this structured memory belongs to. */ - schemaId?: string; -} - -/** A memory. */ -export declare interface Memory { - /** Output only. Represents the timestamp when this Memory was created. */ - createTime?: string; - /** Optional. Represents the description of the Memory. */ - description?: string; - /** Optional. Input only. Indicates whether no revision will be created for this request. */ - disableMemoryRevisions?: boolean; - /** Optional. Represents the display name of the Memory. */ - displayName?: string; - /** Optional. Represents the timestamp of when this resource is considered expired. This is *always* provided on output when `expiration` is set on input, regardless of whether `expire_time` or `ttl` was provided. */ - expireTime?: string; - /** Optional. Represents semantic knowledge extracted from the source content. */ - fact?: string; - /** Optional. Represents user-provided metadata for the Memory. This information was provided when creating, updating, or generating the Memory. It was not generated by Memory Bank. */ - metadata?: Record; - /** Identifier. Represents the resource name of the Memory. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}` */ - name?: string; - /** Optional. Input only. Represents the timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted. */ - revisionExpireTime?: string; - /** Optional. Input only. Represents the labels to apply to the Memory Revision created as a result of this request. */ - revisionLabels?: Record; - /** Optional. Input only. Represents the TTL for the revision. The expiration time is computed: now + TTL. */ - revisionTtl?: string; - /** Required. Immutable. Represents the scope of the Memory. Memories are isolated within their scope. The scope is defined when creating or generating memories. Scope values cannot contain the wildcard character '*'. */ - scope?: Record; - /** Optional. Represents the Topics of the Memory. */ - topics?: MemoryTopicId[]; - /** Optional. Input only. Represents the TTL for this resource. The expiration time is computed: now + TTL. */ - ttl?: string; - /** Output only. Represents the timestamp when this Memory was most recently updated. */ - updateTime?: string; - /** Optional. Represents the type of the memory. If not set, the `NATURAL_LANGUAGE_COLLECTION` type is used. If `STRUCTURED_COLLECTION` or `STRUCTURED_PROFILE` is used, then `structured_data` must be provided. */ - memoryType?: MemoryType; - /** Optional. Represents the structured content of the memory. */ - structuredContent?: MemoryStructuredContent; -} - -/** Operation that has an agent engine memory as a response. */ -export declare interface AgentEngineMemoryOperation { - /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */ - name?: string; - /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ - metadata?: Record; - /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ - done?: boolean; - /** The error result of the operation in case of failure or cancellation. */ - error?: Record; - /** The Agent Engine Memory. */ - response?: Memory; -} - -/** Config for deleting an Agent Engine Memory. */ -export declare interface DeleteAgentEngineMemoryConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; -} - -/** Parameters for deleting agent engines. */ -export declare interface DeleteAgentEngineMemoryRequestParameters { - /** Name of the agent engine memory to delete. */ - name: string; - config?: DeleteAgentEngineMemoryConfig; -} - -/** Operation for deleting agent engines. */ -export declare interface DeleteAgentEngineMemoryOperation { - /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */ - name?: string; - /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ - metadata?: Record; - /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ - done?: boolean; - /** The error result of the operation in case of failure or cancellation. */ - error?: Record; -} - -/** The vertex session source for generating memories. */ -export declare interface GenerateMemoriesRequestVertexSessionSource { - /** Optional. End time (exclusive) of the time range. If not set, the end time is unbounded. */ - endTime?: string; - /** Required. The resource name of the Session to generate memories for. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/sessions/{session}` */ - session?: string; - /** Optional. Time range to define which session events should be used to generate memories. Start time (inclusive) of the time range. If not set, the start time is unbounded. */ - startTime?: string; -} - -export declare interface GenerateMemoriesRequestDirectContentsSourceEvent { - /** Required. A single piece of content from which to generate memories. */ - content?: genaiTypes.Content; -} - -/** The direct contents source for generating memories. */ -export declare interface GenerateMemoriesRequestDirectContentsSource { - /** Required. The source content (i.e. chat history) to generate memories from. */ - events?: GenerateMemoriesRequestDirectContentsSourceEvent[]; -} - -/** A direct memory to upload to Memory Bank. */ -export declare interface GenerateMemoriesRequestDirectMemoriesSourceDirectMemory { - /** Required. The fact to consolidate with existing memories. */ - fact?: string; - /** Optional. The topics that the consolidated memories should be associated with. */ - topics?: MemoryTopicId[]; -} - -/** The direct memories source for generating memories. */ -export declare interface GenerateMemoriesRequestDirectMemoriesSource { - /** Required. The direct memories to upload to Memory Bank. At most 5 direct memories are allowed per request. */ - directMemories?: GenerateMemoriesRequestDirectMemoriesSourceDirectMemory[]; -} - -/** Config for generating memories. */ -export declare interface GenerateAgentEngineMemoriesConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - /** Whether to disable consolidation of memories. - - If true, generated memories will not be consolidated with existing - memories; all generated memories will be added as new memories regardless - of whether they are duplicates of or contradictory to existing memories. - By default, memory consolidation is enabled. */ - disableConsolidation?: boolean; - /** Waits for the operation to complete before returning. */ - waitForCompletion?: boolean; - /** Labels to apply to the memory revision. For example, you can use this to label a revision with its data source. */ - revisionLabels?: Record; - /** Optional. Input only. Timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted. */ - revisionExpireTime?: string; - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - revisionTtl?: string; - /** Optional. Input only. If true, no revisions will be created for this request. */ - disableMemoryRevisions?: boolean; - /** Optional. User-provided metadata for the generated memories. This is not generated by Memory Bank. */ - metadata?: Record; - /** Optional. The strategy to use when applying metadata to existing memories. */ - metadataMergeStrategy?: MemoryMetadataMergeStrategy; - /** Optional. Restricts memory generation to a subset of memory topics. */ - allowedTopics?: MemoryTopicId[]; -} - -/** Parameters for generating agent engine memories. */ -export declare interface GenerateAgentEngineMemoriesRequestParameters { - /** Name of the agent engine to generate memories for. */ - name: string; - /** The vertex session source of the memories that should be generated. */ - vertexSessionSource?: GenerateMemoriesRequestVertexSessionSource; - /** The direct contents source of the memories that should be generated. */ - directContentsSource?: GenerateMemoriesRequestDirectContentsSource; - /** The direct memories source of the memories that should be generated. */ - directMemoriesSource?: GenerateMemoriesRequestDirectMemoriesSource; - /** The scope of the memories that should be generated. - - Memories will be consolidated across memories with the same scope. Must be - provided unless the scope is defined in the source content. If `scope` is - provided, it will override the scope defined in the source content. Scope - values cannot contain the wildcard character '*'. */ - scope?: Record; - config?: GenerateAgentEngineMemoriesConfig; -} - -/** A memory that was generated. */ -export class GenerateMemoriesResponseGeneratedMemory { - /** The generated memory. */ - memory?: Memory; - /** The action to take. */ - action?: GenerateMemoriesResponseGeneratedMemoryAction; - /** The previous revision of the Memory before the action was performed. This - field is only set if the action is `UPDATED` or `DELETED`. You can use - this to rollback the Memory to the previous revision, undoing the action. - Format: - `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{revision}` */ - previousRevision?: string; -} - -/** The response for generating memories. */ -export class GenerateMemoriesResponse { - /** The generated memories. */ - generatedMemories?: GenerateMemoriesResponseGeneratedMemory[]; -} - -/** Operation that generates memories for an agent engine. */ -export declare interface AgentEngineGenerateMemoriesOperation { - /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */ - name?: string; - /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ - metadata?: Record; - /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ - done?: boolean; - /** The error result of the operation in case of failure or cancellation. */ - error?: Record; - /** The response for generating memories. */ - response?: GenerateMemoriesResponse; -} - -/** Config for getting an Agent Engine Memory. */ -export declare interface GetAgentEngineMemoryConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; -} - -/** Parameters for getting an agent engine. */ -export declare interface GetAgentEngineMemoryRequestParameters { - /** Name of the agent engine. */ - name: string; - config?: GetAgentEngineMemoryConfig; -} - -/** The direct contents source event for ingesting events. */ -export declare interface IngestionDirectContentsSourceEvent { - /** Required. The content of the event. */ - content?: genaiTypes.Content; - /** Optional. A unique identifier for the event. If an event with the same event_id is ingested multiple times, it will be de-duplicated. */ - eventId?: string; - /** Optional. The time at which the event occurred. If provided, this timestamp will be used for ordering events within a stream. If not provided, the server-side ingestion time will be used. */ - eventTime?: string; -} - -/** The direct contents source for ingesting events. */ -export declare interface IngestionDirectContentsSource { - /** Required. The events to ingest. */ - events?: IngestionDirectContentsSourceEvent[]; -} - -/** Config for ingesting events. */ -export declare interface IngestEventsConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - /** Waits for the underlying memory generation operation to complete - before returning. Defaults to false. */ - waitForCompletion?: boolean; - /** Optional. Forces a flush of all pending events in the stream and triggers memory generation immediately bypassing any conditions configured in the `generation_trigger_config`. */ - forceFlush?: boolean; - /** Labels to apply to the memory revision. For example, you can use this to label a revision with its data source. */ - revisionLabels?: Record; - /** Optional. Input only. Timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted. */ - revisionExpireTime?: string; - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - revisionTtl?: string; - /** Optional. Input only. If true, no revisions will be created for this request. */ - disableMemoryRevisions?: boolean; - /** Optional. User-provided metadata for the generated memories. This is not generated by Memory Bank. */ - metadata?: Record; - /** Optional. The strategy to use when applying metadata to existing memories. */ - metadataMergeStrategy?: MemoryMetadataMergeStrategy; -} - -/** Parameters for purging agent engine memories. */ -export declare interface IngestEventsRequestParameters { - /** Name of the Agent Engine to ingest events into. */ - name: string; - /** The ID of the stream to ingest events into. */ - streamId?: string; - /** The direct memories source of the events that should be ingested. */ - directContentsSource?: IngestionDirectContentsSource; - /** The scope of the memories that should be generated from the stream. - - Memories will be consolidated across memories with the same scope. Scope - values cannot contain the wildcard character '*'. */ - scope?: Record; - /** The configuration for the memory generation trigger. */ - generationTriggerConfig?: MemoryGenerationTriggerConfig; - config?: IngestEventsConfig; -} - -/** Operation that ingests events into a memory bank. */ -export declare interface MemoryBankIngestEventsOperation { - /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */ - name?: string; - /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ - metadata?: Record; - /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ - done?: boolean; - /** The error result of the operation in case of failure or cancellation. */ - error?: Record; -} - -/** Config for listing agent engine memories. */ -export declare interface ListAgentEngineMemoryConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - pageSize?: number; - pageToken?: string; - /** An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported. */ - filter?: string; - /** The standard list order by string. If not specified, the default - order is `create_time desc`. If specified, the default sorting order of - provided fields is ascending. More detail in - [AIP-132](https://google.aip.dev/132). - - Supported fields: - * `create_time` - * `update_time` */ - orderBy?: string; -} - -/** Parameters for listing agent engines. */ -export declare interface ListAgentEngineMemoryRequestParameters { - /** Name of the agent engine. */ - name: string; - config?: ListAgentEngineMemoryConfig; -} - -/** Response for listing agent engine memories. */ -export class ListReasoningEnginesMemoriesResponse { - /** Used to retain the full HTTP response. */ - sdkHttpResponse?: genaiTypes.HttpResponse; - nextPageToken?: string; - /** List of agent engine memories. */ - memories?: Memory[]; -} - -/** Parameters for getting an operation with a memory as a response. */ -export declare interface GetAgentEngineMemoryOperationParameters { - /** The server-assigned name for the operation. */ - operationName: string; - /** Used to override the default configuration. */ - config?: GetAgentEngineOperationConfig; -} - -/** Parameters for getting an operation with generated memories as a response. */ -export declare interface GetAgentEngineGenerateMemoriesOperationParameters { - /** The server-assigned name for the operation. */ - operationName: string; - /** Used to override the default configuration. */ - config?: GetAgentEngineOperationConfig; -} - -/** The parameters for semantic similarity search based retrieval. */ -export declare interface RetrieveMemoriesRequestSimilaritySearchParams { - /** Required. Query to use for similarity search retrieval. If provided, then the parent ReasoningEngine must have ReasoningEngineContextSpec.MemoryBankConfig.SimilaritySearchConfig set. */ - searchQuery?: string; - /** Optional. The maximum number of memories to return. The service may return fewer than this value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values above 100 will be coerced to 100. */ - topK?: number; -} - -/** The parameters for simple (non-similarity search) retrieval. */ -export declare interface RetrieveMemoriesRequestSimpleRetrievalParams { - /** Optional. The maximum number of memories to return. The service may return fewer than this value. If unspecified, at most 3 memories will be returned. The maximum value is 100; values above 100 will be coerced to 100. */ - pageSize?: number; - /** Optional. A page token, received from a previous `RetrieveMemories` call. Provide this to retrieve the subsequent page. */ - pageToken?: string; -} - -/** Filter to apply when retrieving memories. */ -export declare interface MemoryFilter { - /** Represents the key of the filter. For example, "author" would apply to `metadata` entries with the key "author". */ - key?: string; - /** Indicates whether the filter will be negated. */ - negate?: boolean; - /** Represents the operator to apply to the filter. If not set, then EQUAL will be used. */ - op?: Operator; - /** Represents the value to compare to. */ - value?: MemoryMetadataValue; -} - -/** The conjunction filter for memories. */ -export declare interface MemoryConjunctionFilter { - /** Represents filters that will be combined using AND logic. */ - filters?: MemoryFilter[]; -} - -/** Config for retrieving memories. */ -export declare interface RetrieveAgentEngineMemoriesConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - /** The standard list filter that will be applied to the retrieved - memories. More detail in [AIP-160](https://google.aip.dev/160). - - Supported fields: - * `fact` - * `create_time` - * `update_time` - */ - filter?: string; - /** Metadata filters that will be applied to the retrieved memories' - `metadata` using OR logic. Filters are defined using disjunctive normal - form (OR of ANDs). - - For example: - `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: - "travel"}, op: EQUAL}, {key: "author", value: {string_value: "agent 321"}, - op: EQUAL}]}]` - - would be equivalent to the logical expression: - `(metadata.author = "agent 123" OR (metadata.label = "travel" AND - metadata.author = "agent 321"))`. - */ - filterGroups?: MemoryConjunctionFilter[]; - /** Specifies the types of memories to retrieve. If this field is empty - or not provided, the request will default to retrieving only memories of - type `NATURAL_LANGUAGE_COLLECTION`. If populated, the request will - retrieve memories matching any of the specified `MemoryType` values. */ - memoryTypes?: MemoryType[]; -} - -/** Parameters for retrieving agent engine memories. */ -export declare interface RetrieveAgentEngineMemoriesRequestParameters { - /** Name of the agent engine to retrieve memories from. */ - name: string; - /** The scope of the memories to retrieve. - - A memory must have exactly the same scope as the scope provided here to be - retrieved (i.e. same keys and values). Order does not matter, but it is - case-sensitive. */ - scope: Record; - /** Parameters for semantic similarity search based retrieval. */ - similaritySearchParams?: RetrieveMemoriesRequestSimilaritySearchParams; - /** Parameters for simple (non-similarity search) retrieval. */ - simpleRetrievalParams?: RetrieveMemoriesRequestSimpleRetrievalParams; - config?: RetrieveAgentEngineMemoriesConfig; -} - -/** A retrieved memory. */ -export class RetrieveMemoriesResponseRetrievedMemory { - /** The distance between the query and the retrieved Memory. Smaller values indicate more similar memories. This is only set if similarity search was used for retrieval. */ - distance?: number; - /** The retrieved Memory. */ - memory?: Memory; -} - -/** The response for retrieving memories. */ -export class RetrieveMemoriesResponse { - /** A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages. This token is not set if similarity search was used for retrieval. */ - nextPageToken?: string; - /** The retrieved memories. */ - retrievedMemories?: RetrieveMemoriesResponseRetrievedMemory[]; -} - -/** Config for retrieving memory profiles. */ -export declare interface RetrieveMemoryProfilesConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; -} - -/** Parameters for retrieving agent engine memory profiles. */ -export declare interface RetrieveMemoryProfilesRequestParameters { - /** Name of the agent engine to retrieve memory profiles from. */ - name: string; - /** The scope of the memories to retrieve. - - A memory must have exactly the same scope as the scope provided here to be - retrieved (i.e. same keys and values). Order does not matter, but it is - case-sensitive. */ - scope: Record; - config?: RetrieveMemoryProfilesConfig; -} - -/** A memory profile. */ -export declare interface MemoryProfile { - /** Represents the ID of the schema. This ID corresponds to the `schema_id` defined inside the SchemaConfig, under StructuredMemoryCustomizationConfig. */ - schemaId?: string; - /** Represents the profile data. */ - profile?: Record; -} - -/** The response for retrieving memory profiles. */ -export class RetrieveProfilesResponse { - /** The retrieved structured profiles, which match the schemas under the - requested scope. The key is the ID of the schema that the profile is - linked with, which corresponds to the `schema_id` defined inside the - `SchemaConfig`, under `StructuredMemoryCustomizationConfig`. */ - profiles?: Record; -} - -/** Config for rolling back a memory. */ -export declare interface RollbackAgentEngineMemoryConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - /** Waits for the operation to complete before returning. */ - waitForCompletion?: boolean; -} - -/** Parameters for generating agent engine memories. */ -export declare interface RollbackAgentEngineMemoryRequestParameters { - /** Name of the agent engine memory to rollback. */ - name: string; - /** The ID of the revision to rollback to. */ - targetRevisionId: string; - config?: RollbackAgentEngineMemoryConfig; -} - -/** Operation that rolls back a memory. */ -export declare interface AgentEngineRollbackMemoryOperation { - /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */ - name?: string; - /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ - metadata?: Record; - /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ - done?: boolean; - /** The error result of the operation in case of failure or cancellation. */ - error?: Record; -} - -/** Config for updating agent engine memory. */ -export declare interface UpdateAgentEngineMemoryConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - /** The display name of the memory. */ - displayName?: string; - /** The description of the memory. */ - description?: string; - /** Waits for the operation to complete before returning. */ - waitForCompletion?: boolean; - /** Optional. Input only. The TTL for this resource. - - The expiration time is computed: now + TTL. */ - ttl?: string; - /** Optional. Timestamp of when this resource is considered expired. This is *always* provided on output, regardless of what `expiration` was sent on input. */ - expireTime?: string; - /** Optional. Input only. Timestamp of when the revision is considered expired. If not set, the memory revision will be kept until manually deleted. */ - revisionExpireTime?: string; - /** Optional. Input only. The TTL for the revision. The expiration time is computed: now + TTL. */ - revisionTtl?: string; - /** Optional. Input only. If true, no revision will be created for this request. */ - disableMemoryRevisions?: boolean; - /** Optional. The topics of the memory. */ - topics?: MemoryTopicId[]; - /** Optional. User-provided metadata for the Memory. This information was provided when creating, updating, or generating the Memory. It was not generated by Memory Bank. */ - metadata?: Record; - /** Optional. The user defined ID to use for memory, which will become the final component of the memory resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number. */ - memoryId?: string; - /** The update mask to apply. For the `FieldMask` definition, see - https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask. */ - updateMask?: string; -} - -/** Parameters for updating agent engine memories. */ -export declare interface UpdateAgentEngineMemoryRequestParameters { - /** Name of the agent engine memory to update. */ - name: string; - /** The updated fact of the memory. - - This is the semantic knowledge extracted from the source content. */ - fact?: string; - /** The updated scope of the memory. - - Memories are isolated within their scope. The scope is defined when - creating or generating memories. Up to 5 key-value pairs are accepted, - and scope values cannot contain the wildcard character '*'. */ - scope?: Record; - config?: UpdateAgentEngineMemoryConfig; -} - -/** Config for purging memories. */ -export declare interface PurgeAgentEngineMemoriesConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - /** Waits for the operation to complete before returning. */ - waitForCompletion?: boolean; -} - -/** Parameters for purging agent engine memories. */ -export declare interface PurgeAgentEngineMemoriesRequestParameters { - /** Name of the Agent Engine to purge memories from. */ - name: string; - /** The standard list filter to determine which memories to purge. - More detail in [AIP-160](https://google.aip.dev/160). */ - filter?: string; - /** Metadata filters that will be applied to the memories' - `metadata` using OR logic. Filters are defined using disjunctive normal - form (OR of ANDs). - - For example: - `filter_groups: [{filters: [{key: "author", value: {string_value: "agent - `123"}, op: EQUAL}]}, {filters: [{key: "label", value: {string_value: - "travel"}, op: EQUAL}, {key: "author", value: {string_value: "agent 321"}, - op: EQUAL}]}]` - - would be equivalent to the logical expression: - `(metadata.author = "agent 123" OR (metadata.label = "travel" AND - metadata.author = "agent 321"))`. - */ - filterGroups?: MemoryConjunctionFilter[]; - /** If true, the memories will actually be purged. If false, the purge request will be validated but not executed. */ - force?: boolean; - config?: PurgeAgentEngineMemoriesConfig; -} - -/** The response for purging memories. */ -export class PurgeMemoriesResponse { - /** The number of memories that were purged. */ - purgeCount?: number; -} - -/** Operation that purges memories from an agent engine. */ -export declare interface AgentEnginePurgeMemoriesOperation { - /** The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`. */ - name?: string; - /** Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any. */ - metadata?: Record; - /** If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available. */ - done?: boolean; - /** The error result of the operation in case of failure or cancellation. */ - error?: Record; - /** The response for purging memories. */ - response?: PurgeMemoriesResponse; -} - -/** Config for getting an Agent Engine Memory Revision. */ -export declare interface GetAgentEngineMemoryRevisionConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; -} - -/** Parameters for getting an Agent Engine memory revision. */ -export declare interface GetAgentEngineMemoryRevisionRequestParameters { - /** Name of the agent engine. */ - name: string; - config?: GetAgentEngineMemoryRevisionConfig; -} - -/** An extracted memory that is the intermediate result before consolidation. */ -export declare interface IntermediateExtractedMemory { - /** Output only. Represents the fact of the extracted memory. */ - fact?: string; - /** Output only. Represents the explanation of why the information was extracted from the source content. */ - context?: string; - /** Output only. Represents the structured value of the extracted memory. */ - structuredData?: Record; -} - -/** A memory revision. */ -export declare interface MemoryRevision { - /** Output only. Represents the timestamp when this Memory Revision was created. */ - createTime?: string; - /** Output only. Represents the timestamp of when this resource is considered expired. */ - expireTime?: string; - /** Output only. Represents the extracted memories from the source content before consolidation when the memory was updated via GenerateMemories. This information was used to modify an existing Memory via Consolidation. */ - extractedMemories?: IntermediateExtractedMemory[]; - /** Output only. Represents the fact of the Memory Revision. This corresponds to the `fact` field of the parent Memory at the time of revision creation. */ - fact?: string; - /** Output only. Represents the labels of the Memory Revision. These labels are applied to the MemoryRevision when it is created based on `GenerateMemoriesRequest.revision_labels`. */ - labels?: Record; - /** Identifier. Represents the resource name of the Memory Revision. Format: `projects/{project}/locations/{location}/reasoningEngines/{reasoning_engine}/memories/{memory}/revisions/{memory_revision}` */ - name?: string; - /** Output only. Represents the structured value of the memory at the time of revision creation. */ - structuredData?: Record; -} - -/** Config for listing Agent Engine memory revisions. */ -export declare interface ListAgentEngineMemoryRevisionsConfig { - /** Used to override HTTP request options. */ - httpOptions?: genaiTypes.HttpOptions; - /** Abort signal which can be used to cancel the request. - - NOTE: AbortSignal is a client-only operation. Using it to cancel an - operation will not cancel the request in the service. You will still - be charged usage for any applicable operations. - */ - abortSignal?: AbortSignal; - pageSize?: number; - pageToken?: string; - /** An expression for filtering the results of the request. - For field names both snake_case and camelCase are supported. */ - filter?: string; -} - -/** Parameters for listing Agent Engine memory revisions. */ -export declare interface ListAgentEngineMemoryRevisionsRequestParameters { - /** Name of the Agent Engine memory */ - name: string; - config?: ListAgentEngineMemoryRevisionsConfig; -} - -/** Response for listing agent engine memory revisions. */ -export class ListAgentEngineMemoryRevisionsResponse { - /** Used to retain the full HTTP response. */ - sdkHttpResponse?: genaiTypes.HttpResponse; - nextPageToken?: string; - /** List of memory revisions. */ - memoryRevisions?: MemoryRevision[]; -} - /** The code execution environment with customized settings. */ export declare interface SandboxEnvironmentSpecCodeExecutionEnvironment { /** The coding language supported in this environment. */