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 []) ]