Update Metric Collection
(v2)PUT
Updates a metric collection and returns it. Only the fields you send are changed, and supplying metricsSettings replaces the whole list. multiTurn cannot be changed.
curl -X PUT "https://api.confident-ai.com/v2/metric-collections/{metricCollectionId}" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"name": "RAG Quality v2",
"metricsSettings": [
{
"metric": {
"name": "Answer Relevancy"
},
"activated": true,
"threshold": 0.8,
"includeReason": true,
"strictMode": false,
"sampleRate": 1,
"evaluationModelProvider": "OPEN_AI",
"evaluationModelName": "gpt-4o",
"evaluationModelCredentialId": "<MODEL-CREDENTIAL-ID>",
"decisionModelProvider": "OPEN_AI",
"decisionModelName": "jev-latest",
"evalMode": "LLM"
}
],
"sampleRate": 1,
"inputTransformerId": "<TRANSFORMER-ID>",
"outputTransformerId": null
}'{
"success": true,
"data": {
"id": "<METRIC-COLLECTION-ID>",
"name": "RAG Quality",
"multiTurn": false,
"sampleRate": 1,
"inputTransformerId": "<TRANSFORMER-ID>",
"outputTransformerId": null,
"metricsSettings": [
{
"metric": {
"id": 1,
"name": "Answer Relevancy"
},
"activated": true,
"threshold": 0.8,
"includeReason": true,
"strictMode": false,
"sampleRate": 1,
"evaluationModelProvider": "OPEN_AI",
"evaluationModelName": "gpt-4o",
"evaluationModelCredentialId": null,
"decisionModelProvider": "OPEN_AI",
"decisionModelName": "jev-latest",
"evalMode": "LLM"
}
]
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Path parameters
metricCollectionIdstringRequiredThe unique id of the metric collection.
Request body
namestringThe new name of the metric collection, which must be unique within your project.
metricsSettingslist of objectsThe settings for every metric in the collection. Supplying this field replaces the entire list, so fetch the collection first and resend each metric it should keep.
Show 12 propertiesHide 12 properties
metricobjectRequiredA metric referenced by its name.
Show 1 propertyHide 1 property
namestringRequiredThe name of the metric, which must match a metric in your project or one of Confident AI's built-in metrics.
activatedbooleanWhether this metric is activated. Only activated metrics are run during an evaluation.
thresholdnumberThe threshold this metric is scored against. A metric passes when its score is equal to or greater than the threshold.
includeReasonbooleanWhether a written reason explaining the metric's score is generated during evaluation.
strictModebooleanWhether this metric runs in strict mode, which outputs a binary score of 0 or 1 instead of a continuous score.
sampleRatenumberThe probability that this metric is run for any given evaluation, between 0 and 1. Applied on top of the collection's own
sampleRate.evaluationModelProviderenum | nullThis is the provider of the model.
Show 21 enum valuesHide 21 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACETYPE_SAFEFALZ_AI
evaluationModelNamestring | nullThe name of the model this metric is evaluated with. Required whenever
evaluationModelProvideris set to anything other thanCONFIDENT_AI, and has no effect without a provider.evaluationModelCredentialIdstring | nullFor
BEDROCKandAZURE, the id of the stored credential this metric is evaluated with. Omit it or send null to use the provider's default credential.decisionModelProviderenum | nullThis is the provider of the model.
Show 21 enum valuesHide 21 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACETYPE_SAFEFALZ_AI
decisionModelNamestring | nullThe name of the decision model this metric decides with, used in the
HYBRIDandDECISIONeval modes. Required wheneverdecisionModelProvideris set, and has no effect without a provider.evalModeenum | nullWho decides in an LLM-as-a-judge metric.
LLM: the evaluation model runs the whole metric.HYBRID: the evaluation model extracts and explains, and the decision model answers each decision, falling back to the evaluation model if a decision fails.DECISION: the decision model runs the whole metric in one request, with no evaluation model.Show 3 enum valuesHide 3 enum values
LLMHYBRIDDECISION
sampleRatenumberThe share of eligible entities the whole collection is run against, between 0 and 1. Applied on top of each metric's own
sampleRate. Defaults to 1 on create; omit it on an update to leave it unchanged.inputTransformerIdstring | nullThe id of a transformer that reshapes the payload before evaluation. Send
nullto unset it.outputTransformerIdstring | nullThe id of a transformer that reshapes the result after evaluation. Send
nullto unset it.
Response
Update Metric Collection succeeded.
successbooleanIndicates if the request was successful.
dataobjectA metric collection: its name, sampling and transformer configuration, and the settings for every metric inside it.
Show 7 propertiesHide 7 properties
idstringThis is the id of the metric collection.
namestringThis is the name of the metric collection, which you supply to the evals API to run evaluations remotely.
multiTurnbooleanWhether this is a multi-turn collection. Multi-turn collections contain only multi-turn metrics and evaluate conversations rather than single test cases.
sampleRatenumberThe share of eligible entities this collection is run against, between 0 and 1. Applied on top of each metric's own
sampleRate.inputTransformerIdstring | nullThe id of the transformer that reshapes the payload before evaluation, or
nullwhen the collection does not use one.outputTransformerIdstring | nullThe id of the transformer that reshapes the result after evaluation, or
nullwhen the collection does not use one.metricsSettingslist of objectsThe metrics in the collection with their settings.
Show 12 propertiesHide 12 properties
metricobjectA metric as it appears inside a collection, by id and name.
Show 2 propertiesHide 2 properties
idintegerThis is the id of the metric.
namestringThis is the name of the metric.
activatedbooleanWhether this metric is activated. Only activated metrics are run during an evaluation.
thresholdnumberThe threshold this metric is scored against. A metric passes when its score is equal to or greater than the threshold.
includeReasonbooleanWhether a written reason explaining the metric's score is generated during evaluation.
strictModebooleanWhether this metric runs in strict mode, which outputs a binary score of 0 or 1 instead of a continuous score.
sampleRatenumberThe probability that this metric is run for any given evaluation, between 0 and 1. Applied on top of the collection's own
sampleRate.evaluationModelProviderenum | nullThis is the provider of the model.
Show 21 enum valuesHide 21 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACETYPE_SAFEFALZ_AI
evaluationModelNamestring | nullThe name of the model this metric is evaluated with, or
nullwhen the project's default evaluation model is used.evaluationModelCredentialIdstring | nullFor
BEDROCKandAZURE, the id of the stored credential this metric is evaluated with, or null when it uses the provider's default credential.decisionModelProviderenum | nullThis is the provider of the model.
Show 21 enum valuesHide 21 enum values
OPEN_AICUSTOMCONFIDENT_AIBEDROCKANTHROPICGEMINIX_AIDEEPSEEKMOONSHOT_AIVERTEX_AIAZUREMISTRALPERPLEXITYOPEN_ROUTERPORTKEYLITE_LLMTRUE_FOUNDRYHUGGING_FACETYPE_SAFEFALZ_AI
decisionModelNamestring | nullThe name of the decision model this metric decides with, or
nullwhen the project's default decision model is used.evalModeenum | nullWho decides in an LLM-as-a-judge metric.
LLM: the evaluation model runs the whole metric.HYBRID: the evaluation model extracts and explains, and the decision model answers each decision, falling back to the evaluation model if a decision fails.DECISION: the decision model runs the whole metric in one request, with no evaluation model.Show 3 enum valuesHide 3 enum values
LLMHYBRIDDECISION
deprecatedbooleanIndicates if this endpoint is deprecated.