Launch Week 02 wrapped — explore all five launches

Batch Create

POSThttps://api.confident-ai.com/v1/metrics/batch

Creates a batch of new metrics on your Confident AI project.

POST/v1/metrics/batch
curl -X POST "https://api.confident-ai.com/v1/metrics/batch" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "metrics": [
    {
      "name": "Correctness",
      "criteria": "Determine if the `actual output` is correct based on the `expected output`.",
      "evaluationParams": [
        "actualOutput",
        "expectedOutput"
      ],
      "multiTurn": false
    }
  ]
}'
200
{
  "success": true,
  "data": {
    "ids": [
      "METRIC-ID"
    ]
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • metricslist of objectsRequired

    This is the list of metrics you want to add to your project.

    Show 7 propertiesHide 7 properties
    • idstringRequired

      This is the unique id of the metric.

    • namestringRequired

      This is the name of the metric, it's unique to all metrics.

    • criteriastring

      This is the criteria this metric uses to evaluate test cases.

    • evaluationStepslist of strings

      An alternative to criteria — a list of steps used to evaluate test cases.

    • requiredParameterslist of enums | list of enumsRequired

      The parameters required by this metric for evaluation.

      Show 2 variantsHide 2 variants
      • singleTurnRequiredParameterslist of enums

        Show 9 enum valuesHide 9 enum values
        • input
        • actualOutput
        • expectedOutput
        • context
        • expectedTools
        • toolsCalled
        • retrievalContext
        • metadata
        • tags
      • OR
      • multiTurnRequiredParameterslist of enums

        Show 8 enum valuesHide 8 enum values
        • content
        • role
        • scenario
        • expectedOutcome
        • toolsCalled
        • retrievalContext
        • metadata
        • tags
    • multiTurnbooleanRequired

      This is true if the metric is used to evaluate multi-turn test cases.

    • rubriclist of objects

      A list of score ranges (0–10 inclusive). Must be in order and non-overlapping. Click here to learn more

      Show 2 propertiesHide 2 properties
      • scoreRangelist of numbersRequired

        An array consisting of the ranges of scores to generate.

      • expectedOutcomestringRequired

        The expected outcome for your evaluation.

Response

  • successboolean

    This is true if the metrics were created successfully.

  • dataobject

    This maps to the ids of the metrics created.

    Show 1 propertyHide 1 property
    • idslist of strings

      The ids of the batch metrics created.

  • deprecatedboolean

    This is true if this batch metrics endpoint is deprecated.

Built byConfident AI