Skip to main content
The ExuluEval constructor takes a single options object. This page documents every option, verified against the current @exulu/backend source.

Identity

id
string
required
Unique identifier for this eval function, used for registration and deduplication.
name
string
required
Human-readable name shown in the evals workbench.
description
string
required
What this eval measures, shown to administrators when selecting evals for an agent.

LLM flag

llm
boolean
required
Whether this eval calls a language model internally (LLM-as-judge). The platform UI uses this flag to warn administrators about the cost and latency of eval runs that use an LLM. Set true when execute calls provider.generateSync() or any other model-calling API; set false for deterministic, code-only evals.

Execute function

execute
function
required
The scoring function. Receives a single params object and must return a Promise<number> where the number is in [0, 100]. Scores outside that range cause run() to throw.
execute.params.agent
ExuluAgent
required
The database agent record being evaluated — the row resolved by app.agent(id). Contains the agent’s id, name, description, instructions, model, and tool configuration.
execute.params.provider
ExuluProvider
required
The ExuluProvider instance that ran the generation. Useful when the eval itself needs to call provider.generateSync() for LLM-as-judge scoring.
execute.params.messages
UIMessage[]
required
The full conversation as Vercel AI-SDK UIMessage objects, including user messages, assistant turns, and tool invocations. The last message is typically the assistant’s final response.
execute.params.testCase
TestCase
required
The structured test case with inputs and expected outputs.
execute.params.config
Record<string, any>
Runtime configuration values passed to run() by the caller (or sourced from admin-set config params in the platform UI).
The TestCase type carries these fields:

Common scoring patterns

Exact match:
Keyword presence:
Tool usage:
LLM-as-judge:
execute must return a number strictly in [0, 100]. If it returns a value outside that range, run() throws "Eval function <name> must return a score between 0 and 100, got <value>". Clamp your score before returning when you cannot guarantee the range.

Config params

config
object[]
Optional array of runtime parameters. Administrators set values for these params in the platform UI when configuring an eval run. Values are passed to execute in the config argument as a Record<string, any>.
config[].name
string
required
Parameter name, used as the key in the config record passed to execute.
config[].description
string
required
Description shown to the administrator in the platform UI.
Unlike ExuluTool config params, eval config params have no type or default field in the current source — they are declared as { name: string; description: string } only. The value type and default must be handled inside execute itself (for example, using optional chaining and a fallback).

Queue

queue
Promise<ExuluQueueConfig>
required
Queue configuration for running evals as background jobs. In the current source, queue is a required field in the ExuluEvalParams interface — though if you pass undefined at runtime (in JavaScript), the constructor still assigns it and the class treats it as optional (public queue?: Promise<ExuluQueueConfig>). For robustness, always pass a queue config when registering production evals.
ExuluQueues registration requires an Enterprise Edition license. Without a valid EXULU_ENTERPRISE_LICENSE, app.create() throws when it detects registered queues.

Complete example

Next steps

API reference

The run() method, score-range enforcement, and public properties.

Evals (UI side)

Test cases, runs, and the evals workbench.