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")