Skip to content
1 min read · 185 words

@nhtio/adk/batteries/llm/transformers_js/exceptions

Battery-scoped exception constructors for the transformers.js LLM adapter.

Remarks

Battery-scoped exception classes for the transformers.js (@huggingface/transformers) LLM adapter, minted via createException from @nhtio/adk/factories and re-exported from the battery barrel.

Variables

VariableDescription
E_INVALID_TRANSFORMERS_JS_OPTIONSThrown when the resolved adapter options (constructor, executor overrides, or per-dispatch stash.transformersJs) fail validation against transformersJsOptionsSchema.
E_TRANSFORMERS_JS_CONTEXT_OVERFLOWThrown when the total token weight of the resolved request exceeds contextWindow. Only raised when tokenEncoding is non-null.
E_TRANSFORMERS_JS_INVALID_TOOL_CALL_ARGSRaised when a tool call parsed out of model output carries malformed arguments (not a JSON object).
E_TRANSFORMERS_JS_STREAM_ERRORThrown when the transformers.js pipeline fails to load (e.g. the @huggingface/transformers peer is not installed) or the generation call errors. Non-fatal — surfaced via ctx.nack(...).
E_TRANSFORMERS_JS_TOOL_PARSE_FAILEDRaised when the model emitted text that looked like a tool call but no configured parser could extract a well-formed call from it.
E_UNSUPPORTED_MEDIA_MODALITYRaised when a @nhtio/adk!Media instance whose modality the configured model cannot consume reaches the adapter under unsupportedMediaPolicy: 'throw'.