Skip to content

Examples

Runnable examples demonstrating each feature of the SDK. All examples are in the examples/ directory.

Running Examples

bash
npx tsx examples/basic/basic.ts

Requires macOS 26+ with Apple Intelligence enabled.

Available Examples

ExampleDescription
BasicSimple prompt and response
StreamingToken-by-token streaming
Structured OutputTyped schemas with GenerationSchema
JSON SchemaJSON Schema-based structured output
ToolsTool calling with a calculator
Generation OptionsTemperature, sampling, token limits
TranscriptsSession history persistence
Content TaggingContent tagging use case

Released under the Apache 2.0 License.