We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 97a74dd + 87a68a1 commit 608e9caCopy full SHA for 608e9ca
1 file changed
sdk-js/src/index.ts
@@ -241,13 +241,22 @@ export class OpenMemory {
241
}
242
243
private async _remoteAdd(content: string, options: any): Promise<any> {
244
+ const { userId, decayLambda, ...rest } = options ?? {};
245
+
246
+ const payload = {
247
+ content,
248
+ ...rest,
249
+ user_id: userId,
250
+ decay_lambda: decayLambda,
251
+ };
252
253
const res = await fetch(`${this.url}/memory/add`, {
254
method: 'POST',
255
headers: {
256
'Content-Type': 'application/json',
257
...(this.apiKey && { 'Authorization': `Bearer ${this.apiKey}` })
258
},
- body: JSON.stringify({ content, ...options })
259
+ body: JSON.stringify(payload)
260
});
261
262
if (!res.ok) throw new Error(`Remote add failed: ${res.status}`);
0 commit comments