{"version":3,"file":"exceptions.mjs","names":[],"sources":["../../../../src/batteries/embeddings/transformers_js/exceptions.ts"],"sourcesContent":["/**\n * Battery-scoped exception constructors for the transformers.js Embeddings adapter.\n *\n * @module @nhtio/adk/batteries/embeddings/transformers_js/exceptions\n *\n * @remarks\n * Battery-scoped exception classes for the transformers.js (`@huggingface/transformers`) Embeddings\n * adapter, minted via `createException` from `@nhtio/adk/factories`. Categories mirror the OpenAI and\n * WebLLM embeddings batteries one-to-one — only the engine-specific failure differs.\n */\n\nimport { createException } from '@nhtio/adk/factories'\n\n/**\n * Thrown when the resolved adapter options fail validation against\n * `transformersJsEmbeddingsOptionsSchema` — e.g. a missing/empty `model` or an unknown option key.\n * Fatal: config bugs fail loud, not at embed time.\n */\nexport const E_INVALID_TRANSFORMERS_JS_EMBEDDINGS_OPTIONS = createException<[string]>(\n  'E_INVALID_TRANSFORMERS_JS_EMBEDDINGS_OPTIONS',\n  'Invalid transformers.js Embeddings adapter options: %s',\n  'E_INVALID_TRANSFORMERS_JS_EMBEDDINGS_OPTIONS',\n  529,\n  true\n)\n\n/**\n * Thrown when the transformers.js pipeline fails to load (e.g. the `@huggingface/transformers` peer\n * is not installed) or the `feature-extraction` call throws/returns a malformed result. Non-fatal.\n * Printf arg: `[detail]`.\n */\nexport const E_TRANSFORMERS_JS_EMBEDDINGS_ENGINE_ERROR = createException<[string]>(\n  'E_TRANSFORMERS_JS_EMBEDDINGS_ENGINE_ERROR',\n  'transformers.js Embeddings engine error: %s',\n  'E_TRANSFORMERS_JS_EMBEDDINGS_ENGINE_ERROR',\n  502,\n  false\n)\n"],"mappings":";;;;;;;;;;;;;;;;;;AAkBA,IAAa,+CAA+C,gBAC1D,gDACA,0DACA,gDACA,KACA,IACF;;;;;;AAOA,IAAa,4CAA4C,gBACvD,6CACA,+CACA,6CACA,KACA,KACF"}