Skip to main content

Signature

One method takes either a prompt or a conversation:
This differs from Swift and Kotlin, which have two overloads. On Web there is one method and a union input.

With options

Generation auto-loads what it needs, and downloads when options.model names a model that is absent.

LlmOptions

Structured output

'constrained' throws unsupportedCapability. It needs engine-level constrained decoding, which is not wired in yet.

Errors

Throws SDKException when no model can be loaded or generation fails. See Error handling.