OptionalinfoModel metadata (e.g. supports, versions).
supports.constrained defaults to 'all' (native constrained generation),
so a generate with an output.schema reaches respond with that schema
on request.output.schema. Pass supports: { constrained: 'none' } to
instead exercise the framework's simulated path, where the schema is
injected into the prompt (and thus visible in lastRequestText) and
stripped from what respond sees.
OptionalnameRegistered model name. Defaults to 'mockModel'.
OptionalrespondWhat to respond with on each generate call. Defaults to empty text.
(request, { sendChunk }) => response is invoked once per
call, so you can branch on request history (for tool loops) and stream via
sendChunk.Error is thrown when reached, to inject a failure on a given turn.
(Queued items are static, so streaming needs the callback form.)mockModel(ai, { respond: 'always this' });
mockModel(ai, { respond: ['first', 'second'] });
mockModel(ai, { respond: ['ok', new Error('rate limited')] });
Options for mockModel.