Langfuse JS/TS SDKs
    Preparing search index...

    Interface EvaluationRule

    Live evaluation rule for incoming data.

    An evaluation rule answers:

    • which evaluator should be used
    • which target objects should trigger scoring
    • how often scoring should run
    • which target fields should populate each evaluator variable
    • whether the deployment is active, inactive, or paused

    Important status semantics:

    • enabled is the desired on/off setting from the client
    • status is the effective runtime state after Langfuse applies validation and blocking rules
    • enabled=true with status=paused means the rule should run, but Langfuse has paused it until the underlying problem is fixed
    {
    * id: "erule_123",
    * name: "answer-correctness-live",
    * evaluator: {
    * id: "evaltmpl_123",
    * name: "answer-correctness",
    * scope: LangfuseAPI.unstable.EvaluatorScope.Project,
    * type: LangfuseAPI.unstable.EvaluatorType.LlmAsJudge
    * },
    * target: LangfuseAPI.unstable.EvaluationRuleTarget.Observation,
    * enabled: true,
    * status: LangfuseAPI.unstable.EvaluationRuleStatus.Active,
    * pausedReason: null,
    * pausedMessage: null,
    * sampling: 1,
    * filter: [{
    * type: "stringOptions",
    * column: "type",
    * operator: LangfuseAPI.unstable.EvaluationRuleOptionsFilterOperator.AnyOf,
    * value: ["GENERATION"]
    * }],
    * mapping: [{
    * variable: "input",
    * source: LangfuseAPI.unstable.EvaluationRuleMappingSource.Input
    * }, {
    * variable: "output",
    * source: LangfuseAPI.unstable.EvaluationRuleMappingSource.Output
    * }],
    * createdAt: "2026-03-30T09:20:00.000Z",
    * updatedAt: "2026-03-30T09:20:00.000Z"
    * }
    interface EvaluationRule {
        createdAt: string;
        enabled: boolean;
        evaluator: unstable.EvaluationRuleEvaluator;
        filter: unstable.EvaluationRuleFilter[];
        id: string;
        mapping: unstable.EvaluationRuleMapping[];
        name: string;
        pausedMessage: null | string;
        pausedReason: null | string;
        sampling: number;
        status: unstable.EvaluationRuleStatus;
        target: unstable.EvaluationRuleTarget;
        updatedAt: string;
    }
    Index

    Properties

    createdAt: string

    Timestamp when the evaluation rule was created.

    enabled: boolean

    Desired enabled state configured by the client.

    Evaluator currently used by this rule.

    name and scope identify the evaluator family conceptually. id is the currently active evaluator version in that family. If you create a newer project version with the same evaluator name later, existing evaluation rules are moved to it automatically.

    List of filter conditions used to decide whether a target should be evaluated.

    id: string

    Stable evaluation rule identifier.

    Variable mappings used to populate evaluator runtime variables from the live target object.

    name: string

    Human-readable deployment name. This is independent from the evaluator name.

    pausedMessage: null | string

    Human-readable explanation when status=paused, otherwise null.

    pausedReason: null | string

    Machine-readable reason when status=paused, otherwise null.

    sampling: number

    Fraction of matching target objects that should be evaluated.

    Must be greater than 0 and less than or equal to 1.

    • 1 means evaluate every matching target.
    • 0.25 means evaluate approximately 25% of matching targets.

    Effective runtime status after Langfuse applies validation and blocking rules.

    Target object type that should trigger scoring.

    updatedAt: string

    Timestamp when the evaluation rule was last updated.