1. Register a backend, then initialize
InitializeOptions is { apiKey?, baseUrl?, environment? }. Omit apiKey for keyless local
mode.
2. Generate text
3. Stream it instead
4. Hold a conversation
generate takes a string or a message array.
5. Add speech
AudioInputs, and that tts.speak is synchronous here.
A complete screen
cancelled ref is what stops the loop writing state after the screen unmounts.
Next
Managing models
Download, load, and storage
Tool calling
Let the model call your functions
Voice agent
A full spoken conversation
Error handling
What throws and when