Apply Baseline Corrections to Regression Transformations

Hand off to an LLM

Copy baseline corrections onto regression transformations.

Looks up regression transformations created against the comparison version (isRegression: true, correctedJSON IS NULL), finds the matching baseline transformation by referenceID, and copies the baseline's correctedJSON onto the regression row via the same code path used by POST /v3/events/{eventID}/feedback. The applied corrections are immediately scored against the regression output, populating the confusion-matrix metrics used by function-review and function-version-compare.

Works for every function type that produces correctable transformations, including extract on both the vision and OCR paths. (Previously the vision path silently dropped is_regression during the original regression run, so no rows matched the predicate — that has been fixed.)

Returns counts plus the list of event KSUIDs whose underlying regression transformation received a correction. Errors (e.g. baseline transformation missing for a given referenceID) are returned per-row in the errors map, keyed by event KSUID, rather than aborting the whole call.

POST
/v3/functions/regression/corrections
x-api-key<token>

Authenticate using API Key in request header

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://api.bem.ai/v3/functions/regression/corrections" \  -H "Content-Type: application/json" \  -d '{    "functionName": "invoice-extractor",    "baselineVersionNum": 3,    "comparisonVersionNum": 4  }'

{
  "applied": 18,
  "appliedEventIDs": [
    "evt_2N6gH8...",
    "evt_2N6gH9..."
  ],
  "skipped": 2,
  "errors": {
    "evt_2N6gHB...": "baseline transformation not found for reference ID: invoice-789"
  }
}

{
  "message": "string",
  "code": 0,
  "details": {}
}
{
  "message": "string",
  "code": 0,
  "details": {}
}
{
  "message": "string",
  "code": 0,
  "details": {}
}

See also