Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sweep: Update the docstrings and comments in sdks/ts/src/managers/memory.ts to fix any issues and mismatch between the comment and associated code #236

Merged
merged 1 commit into from
Apr 18, 2024
Merged
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
15 changes: 15 additions & 0 deletions sdks/ts/src/managers/memory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<Memory[]>} A promise that resolves to an array of Memory objects.
*/
async list({
agentId,
query,
Expand All @@ -18,7 +31,9 @@ export class MemoriesManager extends BaseManager {
limit?: number;
offset?: number;
}): Promise<Memory[]> {
// 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({
Expand Down
Loading