File tree 1 file changed +8
-2
lines changed
packages/components/nodes/memory/MongoDBMemory
1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,10 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods {
155
155
156
156
if ( input ) {
157
157
const newInputMessage = new HumanMessage ( input . text )
158
- const messageToAdd = [ newInputMessage ] . map ( ( msg ) => msg . toDict ( ) )
158
+ const messageToAdd = [ newInputMessage ] . map ( ( msg ) => ( {
159
+ ...msg . toDict ( ) ,
160
+ timestamp : new Date ( ) // Add timestamp to the message
161
+ } ) )
159
162
await collection . updateOne (
160
163
{ sessionId : id } ,
161
164
{
@@ -167,7 +170,10 @@ class BufferMemoryExtended extends FlowiseMemory implements MemoryMethods {
167
170
168
171
if ( output ) {
169
172
const newOutputMessage = new AIMessage ( output . text )
170
- const messageToAdd = [ newOutputMessage ] . map ( ( msg ) => msg . toDict ( ) )
173
+ const messageToAdd = [ newOutputMessage ] . map ( ( msg ) => ( {
174
+ ...msg . toDict ( ) ,
175
+ timestamp : new Date ( ) // Add timestamp to the message
176
+ } ) )
171
177
await collection . updateOne (
172
178
{ sessionId : id } ,
173
179
{
You can’t perform that action at this time.
0 commit comments