Examples · learn/16-tools · 221 of 339
task-1.solution
tin run examples/learn/16-tools/task-1.solution.tin/// Add two integers.
tool fn add(a: int, b: int): int => a + b
/// Subtract b from a.
tool fn subtract(a: int, b: int): int => a - b
agent Calculator {
model: "mock"
tools: [add, subtract]
on toolCall(name, input) => print(" call {name} {input}")
}
fn main() {
print(Calculator("subtract 10 and 3"))
}