Timothy J. Baek 11 月之前
父節點
當前提交
d361404a60
共有 2 個文件被更改,包括 3 次插入1 次删除
  1. 2 1
      backend/apps/webui/routers/memories.py
  2. 1 0
      backend/data/config.json

+ 2 - 1
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

+ 1 - 0
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."
 			},
 			{