Looking for Python runtime support in this evaluator? Reach out to us at support@adaline.ai for a private preview.
Set up the JavaScript evaluator
Write your evaluation code
Give the evaluator a name, link a dataset, and write your custom JavaScript code in the code editor. Write your logic between the 
// start and // end comments.
The data object
Adaline provides a data object that contains the model’s response and the variables used. Your code runs against this object for each test case.
| Property | Type | Description |
|---|---|---|
data.completion | string | The model’s full output as a stringified value. |
data.variables | Record<string, string> | The variable values used for this test case. |
data.response | Array | The structured response with role and typed content blocks (text, image, tool-call, tool-response, reasoning). |
Return format
Your code must return an object with these three fields:Code template
When you create a new JavaScript evaluator, Adaline provides this template:// start and // end comments.
Examples
Check if the response contains specific text
Validate variable values
Check response modality
Validate JSON structure
When to use
The JavaScript evaluator is ideal for:- Format validation — Checking JSON structure, date formats, number ranges.
- Business logic — Enforcing rules specific to your domain (e.g., price ranges, allowed categories).
- Structured output parsing — Validating that the model returns data in the expected schema.
- Complex conditional checks — Multi-step validation that combines several criteria.
- Tool call validation — Verifying that the model makes correct tool calls with valid arguments.
Next steps
Text Matcher
Match patterns and keywords without writing code.
LLM-as-a-Judge
Use an LLM for qualitative assessment.

