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(model="openai/gpt-4o")
task = Task(description="Calculate 5 + 3", tools=[add])
task.add_tools(multiply)
result = agent.do(task)
print(result)
# Remove tools (requires agent reference)
# task.remove_tools("add", agent) # By name
# task.remove_tools(multiply, agent) # By object
# task.remove_tools([add, "multiply"], agent) # Mixed