Skip to content
1 min read · 168 words

@nhtio/adk/batteries/llm/litert_lm/exceptions

Battery-scoped exception constructors for LiteRT-LM adapter failures.

Remarks

Battery-scoped exception classes for the LiteRT-LM adapter. These exceptions are owned by the battery (not the ADK core) and are minted via createException from @nhtio/adk/factories. Re-exported from the battery's barrel.

Variables

VariableDescription
E_INVALID_LITERT_LM_OPTIONSThrown when the resolved adapter options (constructor, executor overrides, or per-dispatch stash.liteRtLm) fail validation against liteRtLmOptionsSchema.
E_LITERT_LM_CONTEXT_OVERFLOWThrown when the total token weight of the resolved request exceeds contextWindow. Only raised when tokenEncoding is non-null. Carries { total, contextWindow, tokenEncoding, perBucket } in the message so middleware can target shedding.
E_LITERT_LM_INVALID_TOOL_CALL_ARGSRaised when a tool-call emitted by the model carries malformed arguments.
E_LITERT_LM_STREAM_ERRORThrown when the LiteRT-LM engine call or response stream fails. Non-fatal — surfaced via ctx.nack(...).
E_UNSUPPORTED_MEDIA_MODALITYRaised when a @nhtio/adk!Media instance whose modality cannot be represented for the LiteRT-LM model reaches the adapter under unsupportedMediaPolicy: 'throw'.