From d361404a60d1ecc0823c14d26f988ccc1d556a35 Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Mon, 24 Jun 2024 13:33:03 -0700 Subject: [PATCH] refac --- backend/apps/webui/routers/memories.py | 3 ++- backend/data/config.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/apps/webui/routers/memories.py b/backend/apps/webui/routers/memories.py index 3832fe9a1..e9ae96173 100644 --- a/backend/apps/webui/routers/memories.py +++ b/backend/apps/webui/routers/memories.py @@ -101,6 +101,7 @@ async def update_memory_by_id( class QueryMemoryForm(BaseModel): content: str + k: Optional[int] = 1 @router.post("/query") @@ -112,7 +113,7 @@ async def query_memory( results = collection.query( query_embeddings=[query_embedding], - n_results=1, # how many results to return + n_results=form_data.k, # how many results to return ) return results diff --git a/backend/data/config.json b/backend/data/config.json index 6c0ad2b9f..f02eb8348 100644 --- a/backend/data/config.json +++ b/backend/data/config.json @@ -17,6 +17,7 @@ }, { "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." }, {