Create Collection
(v1)POST
Creates a metric collection from the name and metricSettings you specify, and returns its id. A metric that does not exist in the project, or does not match multiTurn, rejects the whole request.
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
}
]
}'{
"success": true,
"data": {
"id": "COLLECTION-ID"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
namestringRequiredThe name of the metric collection, which must be unique within your project.
multiTurnbooleanThis is true if your metric collection is multi-turn, which contains only multi-turn metrics. It cannot be changed once the collection exists.
metricSettingslist of objectsThis is the list of metric settings for the collection.
Show 8 propertiesHide 8 properties
metricobjectRequiredThis is a metric object, which contains the metric name.
Show 1 propertyHide 1 property
namestringRequiredThis is the name of the metric.
activatedbooleanThis determines if the metric is activated. Only activated metrics are used for evaluations. Non-activated metrics are skipped.
thresholdnumberThis 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.
includeReasonbooleanThis determines if the reason for the metric score should be generated during evaluations.
strictModebooleanThis 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.
sampleRatenumberThis determines the probability of the metric being ran for evaluation.
evaluationModelProviderenumEvaluates this metric with your own model instead of the project default.
Show 18 enum valuesHide 18 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACE
evaluationModelNamestringThe model to use, required whenever
evaluationModelProvideris set to anything other thanCONFIDENT_AI.
sampleRatenumberThe share of eligible entities the whole collection is run against, between 0 and 1. Applied on top of each metric's own
sampleRate.inputTransformerIdstringA transformer that reshapes the payload before evaluation. Ids come from the transformers endpoint. Send
nullto unset it.outputTransformerIdstringA transformer that reshapes the result after evaluation. Send
nullto unset it.
Response
The id of the created metric collection.
successbooleanIndicates if the request was successful.
dataobjectThe id of the affected metric collection.
Show 1 propertyHide 1 property
idstringThis is the id of the metric collection.
deprecatedbooleanIndicates if this endpoint is deprecated.