mirror of
https://github.com/open-webui/open-webui
synced 2025-02-06 13:10:16 +00:00
refac
This commit is contained in:
parent
465c3a9987
commit
d361404a60
@ -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(
|
|||||||
|
|
||||||
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
|
||||||
|
@ -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."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user