Skip to main content

Errors

Errors are surfaced as LeapError values. The most common cases are:
  • LeapError.modelLoadingFailure: Problems reading or validating the model bundle.
  • LeapError.generationFailure: Unexpected native inference errors.
  • LeapError.promptExceedContextLengthFailure: Prompt length exceeded the configured context size.
  • LeapError.serializationFailure: JSON encoding/decoding problems when working with chat history or function calls.
Handle thrown errors with do / catch when using async streams, or use the onErrorCallback in the lower-level API.

Putting it together

Refer to the Quick Start for end-to-end project setup, Function Calling for tool invocation, and Constrained Generation for structured outputs.