mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
fix: memory
This commit is contained in:
parent
0d07d10bd8
commit
8ec3934599
@ -264,12 +264,14 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
if (res.documents[0].length > 0) {
|
||||||
userContext = res.documents.reduce((acc, doc, index) => {
|
userContext = res.documents.reduce((acc, doc, index) => {
|
||||||
const createdAtTimestamp = res.metadatas[index][0].created_at;
|
const createdAtTimestamp = res.metadatas[index][0].created_at;
|
||||||
const createdAtDate = new Date(createdAtTimestamp * 1000).toISOString().split('T')[0];
|
const createdAtDate = new Date(createdAtTimestamp * 1000).toISOString().split('T')[0];
|
||||||
acc.push(`${index + 1}. [${createdAtDate}]. ${doc[0]}`);
|
acc.push(`${index + 1}. [${createdAtDate}]. ${doc[0]}`);
|
||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(userContext);
|
console.log(userContext);
|
||||||
}
|
}
|
||||||
|
@ -270,12 +270,14 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (res) {
|
if (res) {
|
||||||
|
if (res.documents[0].length > 0) {
|
||||||
userContext = res.documents.reduce((acc, doc, index) => {
|
userContext = res.documents.reduce((acc, doc, index) => {
|
||||||
const createdAtTimestamp = res.metadatas[index][0].created_at;
|
const createdAtTimestamp = res.metadatas[index][0].created_at;
|
||||||
const createdAtDate = new Date(createdAtTimestamp * 1000).toISOString().split('T')[0];
|
const createdAtDate = new Date(createdAtTimestamp * 1000).toISOString().split('T')[0];
|
||||||
acc.push(`${index + 1}. [${createdAtDate}]. ${doc[0]}`);
|
acc.push(`${index + 1}. [${createdAtDate}]. ${doc[0]}`);
|
||||||
return acc;
|
return acc;
|
||||||
}, []);
|
}, []);
|
||||||
|
}
|
||||||
|
|
||||||
console.log(userContext);
|
console.log(userContext);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user