Skip to content
1 min read · 119 words

@nhtio/adk/batteries/embeddings/webllm/exceptions

Battery-scoped exception constructors for WebLLM Embeddings adapter failures.

Remarks

Battery-scoped exception classes for the WebLLM Embeddings adapter, minted via createException from @nhtio/adk/factories. The categories mirror the OpenAI Embeddings battery one-to-one — only the engine-specific failure exception differs (engine error vs HTTP error).

Variables

VariableDescription
E_INVALID_WEBLLM_EMBEDDINGS_OPTIONSThrown when the resolved adapter options fail validation against webLLMEmbeddingsOptionsSchema — e.g. a missing/empty model, an unknown option key, or no WebGPU support in the current runtime. Fatal: config bugs fail loud, not at embed time.
E_WEBLLM_EMBEDDINGS_ENGINE_ERRORThrown when the WebLLM engine fails to load or engine.embeddings.create() throws/returns a malformed result. Non-fatal. Printf arg: [detail].