Launch Week 02 wrapped — explore all five launches

Update Metrics

PUThttps://api.confident-ai.com/v1/metrics/{id}

Updates a custom metric on your Confident AI project.

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

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Path parameters

  • idstringRequired

    The id of the metric you wish to update.

Request body

  • namestring

    The name of the metric you're updating.

  • criteriastring

    The new criteria for this particular metric, that you want to update to.

  • evaluationStepsstring

    The new evaluation steps that you want to update for this metric.

  • evaluationParamslist of enums | list of enums

    It is an array of the params that will be used to evaluate your test cases.

    Show 2 variantsHide 2 variants
    • llmTestCaseParamslist of enums

      Show 7 enum valuesHide 7 enum values
      • input
      • actualOutput
      • expectedOutput
      • context
      • toolsCalled
      • expectedTools
      • retrievalContext
    • OR
    • conversationalTestCaseParamslist of enums

      Show 6 enum valuesHide 6 enum values
      • turns
      • scenario
      • expectedOutcome
      • userDescription
      • context
      • chatbotRole
  • 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 metric was updated successfully.

  • deprecatedboolean

    This is true if this metrics endpoint is deprecated.

Built byConfident AI