@nhtio/adk/batteries/llm/ollama/validation
Runtime validation schema and wrapper for native Ollama adapter options.
Remarks
Schema and call-site wrapper for validating OllamaAdapterOptions. Used at construction time and at the start of every iteration against the merged options shape (stash > executor > constructor). Throws E_INVALID_OLLAMA_OPTIONS on failure — same hard-fail policy as every other ADK contract.
Note the deliberate .unknown(...) asymmetry: the TOP level is .unknown(false) so option typos fail loud, but the nested options (runtime/sampling) block is .unknown(true) so new llama.cpp parameters pass through without a library bump.
Variables
| Variable | Description |
|---|---|
| ollamaOptionsSchema | Validator schema for OllamaAdapterOptions. Used by validateOptions at construction time and again at the start of every iteration after options have been merged (stash > executor > constructor). Rejects unknown top-level keys so typos fail loud. |
Functions
| Function | Description |
|---|---|
| validateOptions | Validates an arbitrary input against ollamaOptionsSchema and returns the resolved options shape. Throws E_INVALID_OLLAMA_OPTIONS (carrying the validator's error report on cause) on failure. |