Defines a programmable mock model for tests. Drive each call's response with
respond, and inspect what the model was called with via lastRequest /
requests / requestCount.
For structured output, the mock defaults to native constrained generation
(supports.constrained: 'all'), so respond sees request.output.schema
and no schema blob is injected into the prompt. Override with
supports: { constrained: 'none' } to test the simulated path.
Defines a programmable mock model for tests. Drive each call's response with
respond, and inspect what the model was called with vialastRequest/requests/requestCount.Streaming and tool calls are first-class:
For structured output, the mock defaults to native constrained generation (
supports.constrained: 'all'), sorespondseesrequest.output.schemaand no schema blob is injected into the prompt. Override withsupports: { constrained: 'none' }to test the simulated path.