# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json service: auth: true base-path: /api/public endpoints: create: docs: Add a score to the database, upserts on id method: POST path: /scores request: CreateScoreRequest types: CreateScoreRequest: properties: id: optional traceId: optional sessionId: optional observationId: optional datasetRunId: optional name: type: string docs: The name of the score. Always overrides "output" for correction scores. value: type: CreateScoreValue docs: 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) comment: optional metadata: optional dataType: type: optional docs: When set, must match the score value's type. If not set, will be inferred from the score value or config configId: type: optional docs: Reference a score config on a score. When set, the score name must equal the config name and scores must comply with the config's range and data type. For categorical scores, the value must map to a config category. Numeric scores might be constrained by the score config's max and min values examples: - value: name: "novelty" value: 0.9 traceId: "cdef-1234-5678-90ab" - value: name: "consistency" value: 1.2 dataType: "NUMERIC" traceId: "cdef-1234-5678-90ab" - value: name: "accuracy" value: 0.9 dataType: "NUMERIC" configId: "9203-4567-89ab-cdef" traceId: "cdef-1234-5678-90ab" - value: name: "toxicity" value: "not toxic" traceId: "cdef-1234-5678-90ab" - value: name: "correctness" value: "partially correct" dataType: "CATEGORICAL" configId: "1234-5678-90ab-cdef" traceId: "cdef-1234-5678-90ab" - value: name: "hallucination" value: 0 dataType: "BOOLEAN" traceId: "cdef-1234-5678-90ab" - value: name: "helpfulness" value: 1 dataType: "BOOLEAN" configId: "1234-5678-90ab-cdef" traceId: "cdef-1234-5678-90ab" - value: name: "contextrelevant" value: "not relevant" sessionId: "abyt-1234-5678-80ab" - value: name: "hallucination" value: 0 datasetRunId: "7891-5678-90ab-hijk" ScoreDataType: enum: - NUMERIC - CATEGORICAL - BOOLEAN - CORRECTION CreateScoreValue: discriminated: false union: - double - string docs: The value of the score. Must be passed as string for categorical scores, and numeric for boolean and numeric scores. For corrections pass value as string and set data type to CORRECTION