Skip to content
Merged
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
50 changes: 50 additions & 0 deletions src/converters/_memories_converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,56 @@ export function ingestEventsConfigToVertex(
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;
}

Expand Down
14 changes: 14 additions & 0 deletions src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,8 @@ export declare interface MemoryGenerationTriggerConfigGenerationTriggerRule {
fixedInterval?: string;
/** Optional. Specifies to trigger generation if the stream is inactive for the specified duration after the most recent event. The duration must have a minute-level granularity. */
idleDuration?: string;
/** Optional. Re-include the last N already-processed events in the next window. */
overlapEventCount?: number;
}

/** The configuration for triggering memory generation for ingested events. */
Expand Down Expand Up @@ -1486,6 +1488,18 @@ export declare interface IngestEventsConfig {
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<string, 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 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<string, MemoryMetadataValue>;
/** Optional. The strategy to use when applying metadata to existing memories. */
metadataMergeStrategy?: MemoryMetadataMergeStrategy;
}

/** Parameters for purging agent engine memories. */
Expand Down
Loading