MockProviderOptions
Interface: MockProviderOptions
Defined in: src/adapters/llm/MockProvider.ts:36
Properties
chunkDelayMs?
readonlyoptionalchunkDelayMs?:LatencyMs
Defined in: src/adapters/llm/MockProvider.ts:91
For stream(): delay between successive chunks (ms). Pass a
single number for a fixed delay or a [min, max] tuple for a
uniformly random delay per chunk (e.g. [30, 80] for typing-like
cadence). Default 30ms.
Has no effect on complete().
delayMs?
readonlyoptionaldelayMs?:LatencyMs
Defined in: src/adapters/llm/MockProvider.ts:82
Alias for thinkingMs. Kept for back-compat with prior revisions.
name?
readonlyoptionalname?:string
Defined in: src/adapters/llm/MockProvider.ts:37
replies?
readonlyoptionalreplies?: readonlyMockReply[]
Defined in: src/adapters/llm/MockProvider.ts:62
Scripted replies for multi-turn / tool-using agents. Each entry
is consumed in order — iteration 1 reads replies[0], iteration
2 reads replies[1], and so on. Use Partial to
inject toolCalls:
mock({
replies: [
{ toolCalls: [{ id: '1', name: 'lookup', args: { id: 42 } }] },
{ content: 'Found it: refunds take 3 business days.' },
],
});Exhaustion semantics: if the agent calls the LLM more times
than there are replies, complete() / stream() throw a clear
error. This makes mock-script bugs loud, not silent. Tune the
agent's maxIterations to bound the call count.
Takes precedence over reply and respond when set.
reply?
readonlyoptionalreply?:string
Defined in: src/adapters/llm/MockProvider.ts:39
Fixed response content. Overrides respond when set.
respond?
readonlyoptionalrespond?: (req) =>string|Partial<LLMResponse>
Defined in: src/adapters/llm/MockProvider.ts:71
Build the response from the request. Returns either a plain
string (renders as content with no tool calls) or a partial
LLMResponse so consumers can simulate tool calls + multi-turn
loops without needing a separate scripted() helper.
Default: echoes the last user message.
Parameters
req
Returns
string | Partial<LLMResponse>
stopReason?
readonlyoptionalstopReason?:string
Defined in: src/adapters/llm/MockProvider.ts:93
Fixed stop reason to return. Default 'stop'.
thinkingMs?
readonlyoptionalthinkingMs?:LatencyMs
Defined in: src/adapters/llm/MockProvider.ts:80
Simulated wall-clock delay per request (ms).
Pass a single number for a fixed delay or a [min, max] tuple for
a uniformly random delay (e.g. [3000, 8000] for "real LLM"
thinking time). Default 0 (instant).
Aliased via delayMs for backward compatibility.
usage?
readonlyoptionalusage?:Readonly<{cacheRead?:number;cacheWrite?:number;input?:number;output?:number; }>
Defined in: src/adapters/llm/MockProvider.ts:95
Override usage counts returned. Default: chars/4 heuristic.
