Skip to content

Class: EvalwrightClient

The SDK's entry point.

Resolving never runs a model: it returns the production version of a prompt with its variables substituted, and you run that text with your own provider.

Example

ts
const client = new EvalwrightClient({
  apiKey: process.env.EVALWRIGHT_API_KEY!,
  baseUrl: process.env.EVALWRIGHT_BASE_URL!,
});

const { prompt } = await client.prompts.resolve("support-reply", {
  vars: { customerName: "Ada" },
});

Throws

If apiKey or baseUrl is missing.

Constructors

Constructor

ts
new EvalwrightClient(options): EvalwrightClient;

Parameters

options

EvalwrightClientOptions

Returns

EvalwrightClient

Properties

prompts

ts
readonly prompts: PromptsResource;

Prompt operations.

Released under the MIT licence.