Skip to content

createMockProvider()

PromptScript API


createMockProvider(script): MockProvider

Defined in: eval/src/provider.ts:100

Create a provider for tests that answers from a table keyed by case id or from a function, with scripted usage and latency, and records every call. It has no network code. Usage defaults to zero tokens, latency to 0 and status to 200.

Parameters

script

MockScript

Answers by case id, or a function of the request and context

Returns

MockProvider

The provider, with its received calls in calls