from upsonic import Agent, Task
from upsonic.tools import tool
@tool
def add(a: int, b: int) -> int:
"""Add two numbers."""
return a + b
@tool
def multiply(a: int, b: int) -> int:
"""Multiply two numbers."""
return a * b
agent = Agent("anthropic/claude-sonnet-4-5", tools=[add, multiply])
# Use both tools
task1 = Task(description="What is 5 + 3?")
result = agent.print_do(task1)
print("Result:", result)
# Remove add, keep multiply
agent.remove_tools("add")
# Now only multiply is available
task2 = Task(description="What is 6 * 7?")
result = agent.print_do(task2)
print("Result:", result)