Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
8ec39345
Commit
8ec39345
authored
May 19, 2024
by
Timothy J. Baek
Browse files
fix: memory
parent
0d07d10b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
12 deletions
+16
-12
src/routes/(app)/+page.svelte
src/routes/(app)/+page.svelte
+8
-6
src/routes/(app)/c/[id]/+page.svelte
src/routes/(app)/c/[id]/+page.svelte
+8
-6
No files found.
src/routes/(app)/+page.svelte
View file @
8ec39345
...
@@ -264,12 +264,14 @@
...
@@ -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
);
}
}
...
...
src/routes/(app)/c/[id]/+page.svelte
View file @
8ec39345
...
@@ -270,12 +270,14 @@
...
@@ -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
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment