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
bec00e7e
Commit
bec00e7e
authored
Jun 14, 2024
by
Peter De-Ath
Browse files
fix: change update_memory to correct naming convention
fix: update update_memory to POST
parent
493e3068
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
5 deletions
+5
-5
backend/apps/webui/models/memories.py
backend/apps/webui/models/memories.py
+1
-1
backend/apps/webui/routers/memories.py
backend/apps/webui/routers/memories.py
+3
-3
src/lib/apis/memories/index.ts
src/lib/apis/memories/index.ts
+1
-1
No files found.
backend/apps/webui/models/memories.py
View file @
bec00e7e
...
@@ -65,7 +65,7 @@ class MemoriesTable:
...
@@ -65,7 +65,7 @@ class MemoriesTable:
else
:
else
:
return
None
return
None
def
update_memory
(
def
update_memory
_by_id
(
self
,
self
,
id
:
str
,
id
:
str
,
content
:
str
,
content
:
str
,
...
...
backend/apps/webui/routers/memories.py
View file @
bec00e7e
...
@@ -64,11 +64,11 @@ async def add_memory(
...
@@ -64,11 +64,11 @@ async def add_memory(
return
memory
return
memory
@
router
.
p
atch
(
"/{memory_id}"
,
response_model
=
Optional
[
MemoryModel
])
@
router
.
p
ost
(
"/{memory_id}"
,
response_model
=
Optional
[
MemoryModel
])
async
def
update_memory
(
async
def
update_memory
_by_id
(
memory_id
:
str
,
request
:
Request
,
form_data
:
MemoryUpdateModel
,
user
=
Depends
(
get_verified_user
)
memory_id
:
str
,
request
:
Request
,
form_data
:
MemoryUpdateModel
,
user
=
Depends
(
get_verified_user
)
):
):
memory
=
Memories
.
update_memory
(
memory_id
,
form_data
.
content
)
memory
=
Memories
.
update_memory
_by_id
(
memory_id
,
form_data
.
content
)
if
memory
is
None
:
if
memory
is
None
:
raise
HTTPException
(
status_code
=
404
,
detail
=
"Memory not found"
)
raise
HTTPException
(
status_code
=
404
,
detail
=
"Memory not found"
)
...
...
src/lib/apis/memories/index.ts
View file @
bec00e7e
...
@@ -63,7 +63,7 @@ export const updateMemoryById = async (token: string, id: string, content: strin
...
@@ -63,7 +63,7 @@ export const updateMemoryById = async (token: string, id: string, content: strin
let
error
=
null
;
let
error
=
null
;
const
res
=
await
fetch
(
`
${
WEBUI_API_BASE_URL
}
/memories/
${
id
}
`
,
{
const
res
=
await
fetch
(
`
${
WEBUI_API_BASE_URL
}
/memories/
${
id
}
`
,
{
method
:
'
P
ATCH
'
,
method
:
'
P
OST
'
,
headers
:
{
headers
:
{
Accept
:
'
application/json
'
,
Accept
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
'
Content-Type
'
:
'
application/json
'
,
...
...
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