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
bbdfcd18
Commit
bbdfcd18
authored
May 19, 2024
by
Timothy J. Baek
Browse files
fix
parent
febab588
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
backend/apps/web/routers/memories.py
backend/apps/web/routers/memories.py
+9
-1
No files found.
backend/apps/web/routers/memories.py
View file @
bbdfcd18
...
...
@@ -114,4 +114,12 @@ async def reset_memory_from_vector_db(
@
router
.
delete
(
"/{memory_id}"
,
response_model
=
bool
)
async
def
delete_memory_by_id
(
memory_id
:
str
,
user
=
Depends
(
get_verified_user
)):
return
Memories
.
delete_memory_by_id_and_user_id
(
memory_id
,
user
.
id
)
result
=
Memories
.
delete_memory_by_id_and_user_id
(
memory_id
,
user
.
id
)
if
result
:
collection
=
CHROMA_CLIENT
.
get_or_create_collection
(
name
=
f
"user-memory-
{
user
.
id
}
"
)
collection
.
delete_document
(
memory_id
)
return
True
return
False
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