feat: Add metadata param to TS-SDK in client.update (#3415)

This commit is contained in:
Saket Aryan
2025-09-04 03:22:12 +05:30
committed by GitHub
parent 5e8d5e4664
commit f0e8c3f760
3 changed files with 16 additions and 3 deletions
+10 -2
View File
@@ -251,11 +251,19 @@ export default class MemoryClient {
return response;
}
async update(memoryId: string, message: string): Promise<Array<Memory>> {
async update(
memoryId: string,
{ text, metadata }: { text?: string; metadata?: Record<string, any> },
): Promise<Array<Memory>> {
if (text === undefined && metadata === undefined) {
throw new Error("Either text or metadata must be provided for update.");
}
if (this.telemetryId === "") await this.ping();
this._validateOrgProject();
const payload = {
text: message,
text: text,
metadata: metadata,
};
const payloadKeys = Object.keys(payload);