commit db3b8d62cd04eae6f528a761fcfe0d9dc608fd1b Author: Кирилл Романов Date: Thu Jun 11 14:45:12 2026 +0000 Add 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