From 6bbcf8c04c72080c9c6d3b6bd05c6aad09928dde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B8=D1=80=D0=B8=D0=BB=D0=BB=20=D0=A0=D0=BE=D0=BC?= =?UTF-8?q?=D0=B0=D0=BD=D0=BE=D0=B2?= Date: Fri, 5 Jun 2026 10:24:39 +0000 Subject: [PATCH] Update rag_tools.py --- rag_tools.py | 36 +----------------------------------- 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/rag_tools.py b/rag_tools.py index d5df0f1..805ed65 100644 --- a/rag_tools.py +++ b/rag_tools.py @@ -1,35 +1 @@ -"""Tools for the RAG agent. - -Two tools are exposed via the ``@tool`` decorator: -* ``search_knowledge_base`` – semantic search in the Qdrant vector store. -* ``add_to_knowledge_base`` – add a document to the vector store. -""" - -from typing import List, Dict - -from langchain.tools import tool - -from .vector_store import add_document, search_text - -# --------------------------------------------------------------------------- -# Tool definitions -# --------------------------------------------------------------------------- - -@tool("search_knowledge_base") -async def search_knowledge_base(query: str, max_results: int = 5) -> List[str]: - """Return the top *max_results* relevant chunks for *query*. - - The function is asynchronous because LangChain expects async tools when - the agent runs in an async context. The underlying vector store calls - are synchronous, so we simply wrap the result. - """ - return search_text(query, k=max_results) - -@tool("add_to_knowledge_base") -async def add_to_knowledge_base(content: str, title: str) -> str: - """Add *content* under *title* to the knowledge base. - - Returns a confirmation string. - """ - add_document(title, content) - return f"Document '{title}' added to knowledge base." \ No newline at end of file +# Deprecated module – kept for backward compatibility \ No newline at end of file