Tin

Examples · learn/20-teams · 247 of 339

task-2.solution

examples/learn/20-teams/task-2.solution.tintin run examples/learn/20-teams/task-2.solution.tin
/// Convert Celsius to Fahrenheit, rounded.
tool fn toF(c: int): int => c * 9 / 5 + 32

/// Does unit conversions. Give it one conversion at a time.
agent Converter { model: "mock", tools: [toF] }

/// Answers travel questions.
agent Guide {
  model: "mock"
  tools: [Converter]
  on toolCall(name, input) => print("  {name} {input}")
}

fn main() {
  print(Guide("ask the Converter: toF 30"))
}