From 4bb2f3bd2627ea1709553f6395bf10703718f2f6 Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 08:14:56 +0530 Subject: [PATCH 1/2] feat: Updated sdks/ts/src/env.ts (#235) Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com> --- sdks/ts/src/env.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/sdks/ts/src/env.ts b/sdks/ts/src/env.ts index 1c7a64d1a..a54bde637 100644 --- a/sdks/ts/src/env.ts +++ b/sdks/ts/src/env.ts @@ -1,5 +1,6 @@ // env.ts +// Initialize JULEP_API_KEY and JULEP_API_URL with empty strings. These will be updated based on environment variables if available. let JULEP_API_KEY = ""; let JULEP_API_URL = ""; From a77353935228f0c563c85c23552a7b2c4fb3f02a Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 18 Apr 2024 08:16:54 +0530 Subject: [PATCH 2/2] feat: Updated sdks/ts/src/managers/memory.ts (#236) Co-authored-by: sweep-ai[bot] <128439645+sweep-ai[bot]@users.noreply.github.com> --- sdks/ts/src/managers/memory.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sdks/ts/src/managers/memory.ts b/sdks/ts/src/managers/memory.ts index 42287bb74..acd473f61 100644 --- a/sdks/ts/src/managers/memory.ts +++ b/sdks/ts/src/managers/memory.ts @@ -5,6 +5,19 @@ import { invariant } from "../utils/invariant"; import { isValidUuid4 } from "../utils/isValidUuid4"; export class MemoriesManager extends BaseManager { + /** + * Manages memory-related operations for agents. Inherits from BaseManager. + * Provides functionality to list memories associated with a given agent. + */ + /** + * Lists memories based on the provided parameters. + * @param {string} agentId - The UUID of the agent whose memories are to be listed. Must be a valid UUID v4. + * @param {string} query - A query string to filter memories. + * @param {string} [userId] - The UUID of the user associated with the memories. Optional. + * @param {number} [limit=100] - The maximum number of memories to return. Optional. + * @param {number} [offset=0] - The offset for pagination. Optional. + * @returns {Promise} A promise that resolves to an array of Memory objects. + */ async list({ agentId, query, @@ -18,7 +31,9 @@ export class MemoriesManager extends BaseManager { limit?: number; offset?: number; }): Promise { + // Validates that the agentId is a valid UUID v4 format. invariant(isValidUuid4(agentId), "agentId must be a valid UUID v4"); + // Validates that the userId, if provided, is a valid UUID v4 format. userId && invariant(isValidUuid4(userId), "userId must be a valid UUID v4"); const response = await this.apiClient.default.getAgentMemories({