Class: OllamaAdapter
Defined in: batteries/llm/ollama/adapter.ts:231
Opinionated cross-environment LLM adapter for the native Ollama /api/chat wire shape.
Remarks
Construction validates options eagerly via validateOptions and throws @nhtio/adk/batteries/llm/ollama!E_INVALID_OLLAMA_OPTIONS on failure. The returned instance is reusable: call OllamaAdapter.executor once per DispatchRunner configuration to obtain a @nhtio/adk!DispatchExecutorFn bound to the baseline plus optional executor-scope overrides. Per-iteration overrides live on ctx.stash.ollama and take highest precedence; headers, helpers, retry, and the nested runtime options merge key-by-key across all three layers, every other field is replaced wholesale at the highest layer that sets it.
Constructors
Constructor
new OllamaAdapter(options: unknown): OllamaAdapter;Defined in: batteries/llm/ollama/adapter.ts:242
Parameters
| Parameter | Type | Description |
|---|---|---|
options | unknown | Constructor-baseline options. Re-validated on every iteration after per-dispatch and per-iteration overrides are layered in. |
Returns
OllamaAdapter
Throws
@nhtio/adk/batteries/llm/ollama!E_INVALID_OLLAMA_OPTIONS when options does not satisfy ollamaOptionsSchema.
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
STASH_KEY | readonly | "ollama" | Customary key for per-iteration overrides on ctx.stash. | batteries/llm/ollama/adapter.ts:233 |
Methods
executor()
executor(overrides?: Partial<OllamaAdapterOptions>): DispatchExecutorFn;Defined in: batteries/llm/ollama/adapter.ts:253
Returns a @nhtio/adk!DispatchExecutorFn bound to this adapter's baseline plus optional executor-scope overrides.
Parameters
| Parameter | Type | Description |
|---|---|---|
overrides? | Partial<OllamaAdapterOptions> | Optional executor-scope overrides. Higher precedence than the baseline, lower precedence than ctx.stash[STASH_KEY]. |
Returns
isOllamaAdapter()
static isOllamaAdapter(value: unknown): value is OllamaAdapter;Defined in: batteries/llm/ollama/adapter.ts:939
Returns true when value is an OllamaAdapter instance.
Parameters
| Parameter | Type |
|---|---|
value | unknown |
Returns
value is OllamaAdapter