Skip to main content
All signatures on this page are verified against the current @exulu/backend source. For constructor options, see Configuration.

Constructor

See Configuration for the full options object.

run()

Executes the eval against a completed agent run and returns the validated score.
agent
ExuluAgent
required
The database agent record that ran the generation — resolved by app.agent(id). Forwarded to execute as-is.
provider
ExuluProvider
required
The runtime ExuluProvider instance that ran the generation. Forwarded to execute so LLM-as-judge evals can call provider.generateSync() to score the response.
testCase
TestCase
required
The test case record from the platform’s test-case table, carrying inputs, expected output, and expected tool/knowledge-source metadata.
messages
UIMessage[]
required
The full conversation, including all user messages, assistant turns, and tool invocations. Typically the output of the agent’s generateSync or generateStream call.
config
Record<string, any>
Optional runtime configuration values, passed through to execute. Sourced from the platform UI’s eval-run configuration or passed directly by the caller.
return
Promise<number>
A validated score in [0, 100]. run() throws if the score is outside that range or if execute throws.

Score-range enforcement

run() calls execute, then validates the returned number:
Any error thrown by execute is also caught and re-thrown as:
So callers see the wrapped message with the eval’s name prepended. This means every score that reaches the caller is guaranteed to be a valid number in [0, 100].
Errors from execute are always wrapped and re-thrown — they are not silently swallowed. Handle them in the calling code when you need to distinguish between a score of 0 and a scoring failure.

Properties

execute is declared private in the current source. You cannot call it directly on an ExuluEval instance — always use run(), which adds the score-range check and consistent error wrapping.

Complete workflow