File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -333,11 +333,23 @@ const memory = new Memory();
333
333
<CodeGroup >
334
334
``` python Code
335
335
# For a user
336
- result = m.add(" I like to drink coffee in the morning and go for a walk." , user_id = " alice" , metadata = {" category" : " preferences" })
336
+ messages = [
337
+ {
338
+ " role" : " user" ,
339
+ " content" : " I like to drink coffee in the morning and go for a walk"
340
+ }
341
+ ]
342
+ result = m.add(messages, user_id = " alice" , metadata = {" category" : " preferences" })
337
343
```
338
344
339
345
``` typescript TypeScript
340
- const result = memory .add (" I like to drink coffee in the morning and go for a walk." , { userId: " alice" , metadata: { category: " preferences" } });
346
+ const messages = [
347
+ {
348
+ role: " user" ,
349
+ content: " I like to drink coffee in the morning and go for a walk"
350
+ }
351
+ ];
352
+ const result = memory .add (messages , { userId: " alice" , metadata: { category: " preferences" } });
341
353
```
342
354
343
355
``` json Output
You can’t perform that action at this time.
0 commit comments