"""agent_types_demo.py — two questions through one create_agent"""

from dotenv import load_dotenv
from langchain.agents import create_agent
from langchain.tools import tool

load_dotenv()


@tool
def multiply(a: int, b: int) -> int:
    """Multiply two integers."""
    return a * b


agent = create_agent(model="openai:gpt-4o-mini", tools=[multiply])

questions = [
    "What does the HTML <title> tag do? One sentence.",
    "Use the multiply tool: what is 24 times 17?",
]

for question in questions:
    print(f"\n=== Question ===\n{question}")
    result = agent.invoke({"messages": [{"role": "user", "content": question}]})
    answer = result["messages"][-1].content
    print(f"\n=== Answer ===\n{answer}")