@nhtio/adk/batteries/llm/webllm_chat_completions/exceptions
Battery-scoped exception constructors for WebLLM Chat Completions adapter failures.
Remarks
Battery-scoped exception classes for the WebLLM Chat Completions 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
| Variable | Description |
|---|---|
| E_INVALID_WEBLLM_CHAT_COMPLETIONS_OPTIONS | Thrown when the resolved adapter options (constructor, executor overrides, or per-dispatch stash.webLLMChatCompletions) fail validation against webLLMChatCompletionsOptionsSchema. |
| E_UNSUPPORTED_MEDIA_MODALITY | Raised when a @nhtio/adk!Media instance whose modality cannot be natively represented in the WebLLM Chat Completions wire format reaches the adapter under unsupportedMediaPolicy: 'throw'. |
| E_WEBLLM_CHAT_COMPLETIONS_CONTEXT_OVERFLOW | Thrown 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_WEBLLM_CHAT_COMPLETIONS_INVALID_TOOL_CALL_ARGS | Raised when a tool-call's arguments string emitted by the model is not a JSON object — either non-parseable JSON, or parseable JSON whose root is not an object (e.g. a bare string, number, array, or null). |
| E_WEBLLM_CHAT_COMPLETIONS_STREAM_ERROR | Thrown when the WebLLM engine call or async stream fails. Non-fatal — surfaced via ctx.nack(...). |