Tin

Examples · learn/23-replay · 263 of 339

changed.panics

run: --replay tests/tapes/agents-05-claude.json

examples/learn/23-replay/changed.panics.tintin run examples/learn/23-replay/changed.panics.tin
// run: --replay tests/tapes/agents-05-claude.json
/// Add two integers and return the sum.
tool fn add(a: int, b: int): int => a + b

/// Multiply two integers and return the product.
tool fn multiply(a: int, b: int): int => a * b

agent Calculator {
  system: "You are a calculator. Use the tools for all arithmetic. Reply with just the number."
  tools: [add, multiply]
  on toolCall(name, input) => print("  call {name} {input}")
}

fn main() {
  let answer: int = Calculator("What is (17 + 25) * 4?")
  print("(17 + 25) * 4 = {answer}")
}