From 393fd6b9f2f756a22ed1ad1557ea6452f6da57b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=B8=D0=BD=D0=B0=D1=80=20=D0=9C=D0=B8=D1=80=D0=B7?= =?UTF-8?q?=D0=B0=D0=B3=D0=B8=D1=82=D0=BE=D0=B2?= Date: Thu, 11 Jun 2026 13:44:25 +0000 Subject: [PATCH] Solution ready for publish: update tools.py --- tools.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools.py b/tools.py index b4ff16c..cd9bab5 100644 --- a/tools.py +++ b/tools.py @@ -19,7 +19,7 @@ def search_local_kb(query: str, top_k: int = 3) -> List[Dict]: # Assume the collection is already created and persisted store = create_vectorstore() - results = store.query(query, top_k=top_k) + results = store.query(query_texts=[query], n_results=top_k) return [ {"text": doc.page_content, "source": doc.metadata.get("source", "unknown")} for doc in results @@ -36,6 +36,5 @@ def web_search(query: str) -> List[Dict]: results = tav.search(query, max_results=5) return [ {"text": r["title"] + ": " + r["snippet"] if isinstance(r, dict) else str(r)} - for r in - (results if isinstance(results, list) else []) + for r in (results if isinstance(results, list) else []) ]