Launch Week 02 wrapped — explore all five launches

Create Collection

POSThttps://api.confident-ai.com/v1/metric-collections

Creates a metric collection with the name and the metricSettings you specified.

POST/v1/metric-collections
curl -X POST "https://api.confident-ai.com/v1/metric-collections" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Collection Name",
  "multiTurn": false,
  "metricSettings": [
    {
      "metric": {
        "name": "Answer Relevancy"
      },
      "threshold": 0.8
    }
  ]
}'
200
{
  "success": true,
  "data": {
    "id": "COLLECTION-ID"
  },
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • namestringRequired

    This is the unique name of the metric collection you wish to create.

  • multiTurnboolean

    This is true if your metric collection is multi-turn, which contains only multi-turn metrics. Defaulted to false.

  • metricSettingslist of objects

    This is the list of metric settings for the collection.

    Show 6 propertiesHide 6 properties
    • metricobject

      This is a metric object, which contains the metric name.

      Show 1 propertyHide 1 property
      • namestringRequired

        This is the name of the metric.

    • activatedboolean

      This determines if the metric is activated. Only activated metrics are used for evaluations. Non-activated metrics are skipped.

    • thresholdnumber

      This determines the threshold for the metric which determines if the metric passes or fails depending on if the metric score is equal or greater than the threshold.

    • includeReasonboolean

      This determines if the reason for the metric score should be generated during evaluations.

    • strictModeboolean

      This determines if the metric is in strict mode. Metrics in strict mode output a binary score of 0 or 1, indicating pass or fail, as opposed to a continuous score from 0 to 1.

    • sampleRatenumber

      This determines the probability of the metric being ran for evaluation.

Response

  • successboolean

    This is true if the metric collection was created successfully.

  • dataobject

    This maps to the id of the metric collection.

    Show 1 propertyHide 1 property
    • idstring

      This is the id of the metric collection.

  • deprecatedboolean

    This is true if this metric collection endpoint is deprecated.

Built byConfident AI