from langchain_ollama import OllamaLLM
from langchain.agents import initialize_agent
from langchain.agents.agent_types import AgentType

def main():
    llm = OllamaLLM(model="llama3", temperature=0.7)

    # No tools passed - empty list
    tools = []

    # Initialize a simple chat zero-shot agent (if available)
    # If your version doesn't have CHAT_ZERO_SHOT, fallback to using LLM directly
    try:
        agent = initialize_agent(
            tools=tools,
            llm=llm,
            agent=AgentType.CHAT_ZERO_SHOT,
            verbose=True,
        )
        prompt = "Tell me a about python."
        response = agent.run(prompt)
    except AttributeError:
        # Fallback if CHAT_ZERO_SHOT is not present
        print("AgentType.CHAT_ZERO_SHOT not found, running LLM directly...")
        response = llm.invoke("Tell me a about python.")

    print("Response:", response)

if __name__ == "__main__":
    main()
