Managing the context window
Budget conversations, render current app state, and choose a context strategy.
Writing a routing policy
Select providers, configure fallback, and observe routing decisions.
Streaming on React Native
Configure streaming fetch, consume model events, and cancel generation.
Structured output
Generate JSON objects with supported schemas and validate constraints.
Tool calling
Define tools, handle deadlines, and observe native tool calls.
Writing a custom provider
Implement the provider contract and normalized errors with a working example.