Browse Source

fix: query memory

Timothy J. Baek 1 year ago
parent
commit
68b3cce0fd
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/lib/components/chat/Chat.svelte

+ 2 - 2
src/lib/components/chat/Chat.svelte

@@ -529,8 +529,8 @@
 							});
 							});
 							if (res) {
 							if (res) {
 								if (res.documents[0].length > 0) {
 								if (res.documents[0].length > 0) {
-									userContext = res.documents.reduce((acc, doc, index) => {
-										const createdAtTimestamp = res.metadatas[index][0].created_at;
+									userContext = res.documents[0].reduce((acc, doc, index) => {
+										const createdAtTimestamp = res.metadatas[0][index].created_at;
 										const createdAtDate = new Date(createdAtTimestamp * 1000)
 										const createdAtDate = new Date(createdAtTimestamp * 1000)
 											.toISOString()
 											.toISOString()
 											.split('T')[0];
 											.split('T')[0];