Langfuse JS/TS SDKs
    Preparing search index...

    Interface CreateScoreRequest

    {
    * name: "novelty",
    * value: 0.9,
    * traceId: "cdef-1234-5678-90ab"
    * }
    {
    * name: "consistency",
    * value: 1.2,
    * dataType: LangfuseAPI.ScoreDataType.Numeric,
    * traceId: "cdef-1234-5678-90ab"
    * }
    {
    * name: "accuracy",
    * value: 0.9,
    * dataType: LangfuseAPI.ScoreDataType.Numeric,
    * configId: "9203-4567-89ab-cdef",
    * traceId: "cdef-1234-5678-90ab",
    * environment: "test"
    * }
    {
    * name: "toxicity",
    * value: "not toxic",
    * traceId: "cdef-1234-5678-90ab",
    * environment: "production"
    * }
    {
    * name: "correctness",
    * value: "partially correct",
    * dataType: LangfuseAPI.ScoreDataType.Categorical,
    * configId: "1234-5678-90ab-cdef",
    * traceId: "cdef-1234-5678-90ab"
    * }
    {
    * name: "hallucination",
    * value: 0,
    * dataType: LangfuseAPI.ScoreDataType.Boolean,
    * traceId: "cdef-1234-5678-90ab"
    * }
    {
    * name: "helpfulness",
    * value: 1,
    * dataType: LangfuseAPI.ScoreDataType.Boolean,
    * configId: "1234-5678-90ab-cdef",
    * traceId: "cdef-1234-5678-90ab"
    * }
    interface CreateScoreRequest {
        comment?: string;
        configId?: string;
        datasetRunId?: string;
        dataType?: ScoreDataType;
        environment?: string;
        id?: string;
        metadata?: unknown;
        name: string;
        observationId?: string;
        sessionId?: string;
        traceId?: string;
        value: CreateScoreValue;
    }
    Index

    Properties

    comment?: string
    configId?: string

    Reference a score config on a score. The unique langfuse identifier of a score config. When passing this field, the dataType and stringValue fields are automatically populated.

    datasetRunId?: string
    dataType?: ScoreDataType

    The data type of the score. When passing a configId this field is inferred. Otherwise, this field must be passed or will default to numeric.

    environment?: string

    The environment of the score. Can be any lowercase alphanumeric string with hyphens and underscores that does not start with 'langfuse'.

    id?: string
    metadata?: unknown
    name: string
    observationId?: string
    sessionId?: string
    traceId?: string

    The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. Boolean score values must equal either 1 or 0 (true or false)