Examples
Runnable examples demonstrating each feature of the SDK. All examples are in the examples/ directory.
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 |
| Contact Card | Nested generable() schemas, GenerationGuide constraints, prewarm() |
| Journal | Tool subclasses, onCall callback, generable(), streaming, transcript persistence |
| Email Triage | JSON Schema, streaming drafts, per-call generation options, tools |
| Chat & Responses APIs | Chat-style and Responses-style API interface |