Tin

Examples · agents · 44 of 339

hello-native

A hello agent for tin build --native (npm run smoke:native runs it live on Amazon Bedrock). The model side replays a recorded tape, so it runs offline.

examples/agents/hello-native.tintin run examples/agents/hello-native.tin --replay tests/tapes/agents-hello-native.json
// A hello agent for `tin build --native` (npm run smoke:native runs it live on Amazon Bedrock).
// The agent loop and the Bedrock provider (ConverseStream, its binary event stream and CRCs) are Tin
// code compiled into the executable, so it needs no Node and no runtime: AWS_BEARER_TOKEN_BEDROCK
// (a Bedrock API key) is all it reads.

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

agent Hello {
  model: "bedrock:us.anthropic.claude-haiku-4-5-20251001-v1:0"
  system: "You are a friendly assistant. Use the multiply tool for arithmetic. Answer in one short sentence."
  tools: [multiply]
}

fn main() {
  print(Hello.ask("Say hello, then tell me what 3 times 4 is."))
}
3 times 4 equals 12.