Function accuracy

Apply Baseline Corrections to Regression Transformations

Applies corrected JSON from baseline transformations to regression transformations

This endpoint copies user-corrected data from baseline function version transformations to their corresponding regression test transformations. This is useful for:

  • Propagating ground truth corrections to regression test data
  • Ensuring consistent evaluation data across function versions
  • Preparing corrected datasets for evaluation after regression testing

How It Works

  1. Finds Regression Transformations: Locates transformations created during regression testing
  2. Matches Baseline Corrections: Finds corresponding baseline transformations with corrected JSON
  3. Applies Corrections: Copies the corrected JSON to regression transformations
  4. Returns Summary: Reports applied, skipped, and error counts with transformation IDs
POST
/v2/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/v2/functions/regression/corrections" \  -H "Content-Type: application/json" \  -d '{    "functionName": "invoice-transformer",    "baselineVersionNum": 2,    "comparisonVersionNum": 3  }'

Some corrections applied, others had errors

{
  "applied": 18,
  "appliedIds": [
    "tr-abc-123",
    "tr-def-456"
  ],
  "skipped": 2,
  "errors": {
    "tr-xyz-789": "baseline transformation not found for reference ID: invoice-789"
  }
}

{
  "message": "baselineVersionNum and comparisonVersionNum must be different"
}

{
  "message": "No regression transformations found for comparison version 4"
}

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