Tin

Examples · learn/31-telemetry · 310 of 339

task-1.solution

examples/learn/31-telemetry/task-1.solution.tintin run examples/learn/31-telemetry/task-1.solution.tin
/// Look up a price.
tool fn price(item: string): int => if item == "tea" { 3 } else { 5 }

agent Shop {
  model: "mock"
  tools: [price]
  telemetry: { attributes: { shop: "corner" }, sample: 1 }
}

fn main() {
  span("checkout") {
    spanAttr("customer", "ada")
    print(Shop("price of 'tea'"))
  }
}