Tin

Examples · learn/22-code-as-action · 259 of 339

task-2.solution

examples/learn/22-code-as-action/task-2.solution.tintin run examples/learn/22-code-as-action/task-2.solution.tin
/// A counter.
tool fn one(): int => 1

agent Busy {
  model: "mock"
  tools: [one]
  code: true
  on toolResult(name, output, ok) => print("  {name} ok={ok}: {output}")
}

fn main() {
  print(Busy("run_code 'fn f(): int => 1  fn main() \{ print(await spawn f()) \}'"))
}