From 1ae4328896f7b84bd9865ca44c97d882a96340ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=AD=D0=BC=D0=B8=D0=BB=D1=8C=20=D0=90=D0=BC=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Wed, 27 May 2026 12:36:21 +0000 Subject: [PATCH] sync from accepted repo: main.py --- main.py | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/main.py b/main.py index 2b31069..831efee 100644 --- a/main.py +++ b/main.py @@ -1,14 +1,9 @@ """Интерактивный RAG-агент (Qdrant + Ollama + LangChain).""" from __future__ import annotations -try: - from agent_app import build_agent, build_llm - from knowledge_base import build_knowledge_base - from rag_tools import add_to_knowledge_base, get_knowledge_base, search_knowledge_base -except ModuleNotFoundError: - from .agent_app import build_agent, build_llm - from .knowledge_base import build_knowledge_base - from .rag_tools import add_to_knowledge_base, get_knowledge_base, search_knowledge_base +from agent_app import build_agent, build_llm +from knowledge_base import build_knowledge_base +from rag_tools import add_to_knowledge_base, get_knowledge_base, search_knowledge_base __all__ = [ "build_agent", @@ -50,9 +45,7 @@ def run_interactive_cli() -> None: print(add_to_knowledge_base.invoke({"content": content, "title": title})) continue - result = agent.invoke( - {"messages": [{"role": "human", "content": user_input}]} - ) + result = agent.invoke({"messages": [{"role": "human", "content": user_input}]}) answer = result["messages"][-1] print(f"\nАгент: {getattr(answer, 'content', answer)}\n")