from upsonic import Agent, Task
from upsonic.tools import tool
@tool
def sum_tool(a: float, b: float) -> float:
"""
Add two numbers together.
Args:
a: First number
b: Second number
Returns:
The sum of a and b
"""
return a + b
# Create task with the tool
task = Task(
description="Calculate 15 + 27",
tools=[sum_tool]
)
# Create agent
agent = Agent(model="anthropic/claude-sonnet-4-5", name="Calculator Agent")
# Execute
result = agent.print_do(task)
print("Result:", result)