From db3b8d62cd04eae6f528a761fcfe0d9dc608fd1b 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: Thu, 11 Jun 2026 14:45:12 +0000 Subject: [PATCH] Add main.py --- main.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 main.py diff --git a/main.py b/main.py new file mode 100644 index 0000000..78bcdc3 --- /dev/null +++ b/main.py @@ -0,0 +1,15 @@ +from langchain_ollama import ChatOllama +from langchain.agents import create_agent + +# Initialize the LLM (using a local Ollama model) +llm = ChatOllama(model="llama3") + +# No external tools needed for this simple greeting agent +tools = [] + +# Create the agent using the modern API +agent = create_agent(model=llm, tools=tools) + +# Invoke the agent with a user message asking for a greeting +response = agent.invoke({"messages": [{"role": "user", "content": "Hello"}]}) +print(response["output_text"] if isinstance(response, dict) else response) \ No newline at end of file