Skip to content

Variables ​

A prompt body carries {{name}} placeholders. The SDK fills them from vars in your process — with the same rules the server uses — and returns the finished text. The values are never sent.

ts
// "Reply to {{customerName}} about {{topic}}."
await client.prompts.resolve(SUPPORT_REPLY_ID, {
  vars: { customerName: "Ada", topic: "billing" },
});

Rules ​

RuleWhy
A missing variable fails with EvalwrightClientError — one given as undefined tooSubstituting an empty string ships a prompt with a hole in it, and you find out from the model's output instead of from the error
Unknown keys are ignoredLets you hand one context object to several prompts, and lets a prompt drop a variable without breaking callers
Values are substituted literallyNot parsed, not re-scanned, not trimmed — a value containing {{x}} stays that text
Everything is a string — anything else fails with EvalwrightClientErrorFormat numbers and dates yourself, where the decision belongs. null used to become an empty string, an object [object Object]

BRAID graphs ​

A version can carry a BRAID graph instead of, or alongside, classic text. Node labels use the same syntax and the same rules — one grammar definition is shared by the app, the server and the SDK, so what the editor accepts is what the server resolves.

The values are not written into a graph's labels: a value carrying ] would close the label it landed in and change the graph. They are listed beside it in <value> blocks, the way the benchmark gave them to its model. In a value containing <value> or </value>, that < is written as &lt;, so it cannot end its block. A benchmark refuses such a value before it starts.

Released under the MIT licence.