Examples
Runnable examples demonstrating each feature of the SDK. All examples are in the examples/ directory.
Running Examples
bash
npx tsx examples/basic/basic.tsRequires macOS 26+ with Apple Intelligence enabled.
Available Examples
| Example | Description |
|---|---|
| Basic | Simple prompt and response |
| Streaming | Token-by-token streaming |
| Structured Output | Typed schemas with GenerationSchema |
| JSON Schema | JSON Schema-based structured output |
| Tools | Tool calling with a calculator |
| Generation Options | Temperature, sampling, token limits |
| Transcripts | Session history persistence |
| Content Tagging | Content tagging use case |