Tin

Examples · learn/24-models · 270 of 339

swap

examples/learn/24-models/swap.tintin run examples/learn/24-models/swap.tin
/// Add two integers.
tool fn add(a: int, b: int): int => a + b

agent Calculator {
  model: "mock"            // swap for "claude-opus-5-5" when you have a key; nothing else changes
  system: "Use the tools for all arithmetic. Reply with just the number."
  tools: [add]
}

fn main() {
  let n: int = Calculator("add 2 and 40")
  print(n)
}