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
d361404a
Commit
d361404a
authored
Jun 24, 2024
by
Timothy J. Baek
Browse files
refac
parent
465c3a99
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
1 deletion
+3
-1
backend/apps/webui/routers/memories.py
backend/apps/webui/routers/memories.py
+2
-1
backend/data/config.json
backend/data/config.json
+1
-0
No files found.
backend/apps/webui/routers/memories.py
View file @
d361404a
...
@@ -101,6 +101,7 @@ async def update_memory_by_id(
...
@@ -101,6 +101,7 @@ async def update_memory_by_id(
class
QueryMemoryForm
(
BaseModel
):
class
QueryMemoryForm
(
BaseModel
):
content
:
str
content
:
str
k
:
Optional
[
int
]
=
1
@
router
.
post
(
"/query"
)
@
router
.
post
(
"/query"
)
...
@@ -112,7 +113,7 @@ async def query_memory(
...
@@ -112,7 +113,7 @@ async def query_memory(
results
=
collection
.
query
(
results
=
collection
.
query
(
query_embeddings
=
[
query_embedding
],
query_embeddings
=
[
query_embedding
],
n_results
=
1
,
# how many results to return
n_results
=
form_data
.
k
,
# how many results to return
)
)
return
results
return
results
...
...
backend/data/config.json
View file @
d361404a
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
},
},
{
{
"title"
:
[
"Show me a code snippet"
,
"of a website's sticky header"
],
"title"
:
[
"Show me a code snippet"
,
"of a website's sticky header"
],
]
,
"content"
:
"Show me a code snippet of a website's sticky header in CSS and JavaScript."
"content"
:
"Show me a code snippet of a website's sticky header in CSS and JavaScript."
},
},
{
{
...
...
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