Langfuse JS/TS SDKs
    Preparing search index...

    Interface CreateEvaluationRuleRequest

    Request body for creating an evaluation rule.

    Checklist for agents and SDK clients:

    • reference an existing evaluator family by evaluator.name and evaluator.scope
    • choose target=observation or target=experiment
    • if target=experiment and you want a dataset filter, call GET /api/public/v2/datasets first and use dataset id values in filter[].value
    • fetch or inspect the evaluator first, then provide a complete variable mapping for every evaluator variable listed in variables
    • optionally narrow execution with filter
    • set enabled=true only when you want live execution immediately
    interface CreateEvaluationRuleRequest {
        enabled: boolean;
        evaluator: unstable.EvaluationRuleEvaluatorReference;
        filter?: unstable.EvaluationRuleFilter[];
        mapping: unstable.EvaluationRuleMapping[];
        name: string;
        sampling?: number;
        target: unstable.EvaluationRuleTarget;
    }
    Index

    Properties

    enabled: boolean

    Whether the deployment should be active immediately after creation.

    Evaluator family to use.

    Use name and scope from the evaluator endpoints. Langfuse resolves that family to its latest version before saving the rule.

    Optional filter list.

    Omit or pass an empty list to evaluate all matching targets for the selected target. Each filter object must use a column that is valid for that target. For target=experiment, column=datasetId expects dataset id values from GET /api/public/v2/datasets, not dataset names.

    Required variable mappings.

    Every evaluator variable must appear exactly once. Build this list from the evaluator variables array returned by the evaluator endpoints.

    name: string

    Human-readable deployment name.

    sampling?: number

    Optional sampling fraction. Defaults to 1.

    Target object type to evaluate.