Run LLM Evals
POSThttps://api.confident-ai.com/v1/evaluate
Run online evals for your test cases using the metrics in metricCollection.
curl -X POST "https://api.confident-ai.com/v1/evaluate" \
-H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
-H "Content-Type: application/json" \
-d '{
"metricCollection": "Collection Name",
"llmTestCases": [
{
"input": "How tall is mount everest?",
"actualOutput": "No clue, pretty tall I guess?"
}
]
}'{
"success": true,
"data": {
"id": "TEST-RUN-ID"
},
"deprecated": false
}Headers
CONFIDENT_API_KEYstringRequiredThe API key of your Confident AI project.
Request body
metricCollectionstringRequiredThe name of the metric collection you wish to use for evaluation.
llmTestCaseslist of objectsThis is a list of single-turn test cases to evaluate. If you are evaluating multi-turn test cases, this should be
null.Show 8 propertiesHide 8 properties
inputstringRequiredThis is the input to your LLM application.
actualOutputstringRequiredThis is the actual output of your LLM application.
namestringThis is the name of your test case, it allows you to search and match test cases across different test runs.
expectedOutputstringThis is the expected output of your LLM application, which is the ideal actual output.
retrievalContextlist of stringsThis is the retrieval context of your LLM application.
contextlist of stringsThis is the ideal retrieval context of your LLM application.
toolsCalledlist of objectsThis is the tools called by your LLM application.
Show 5 propertiesHide 5 properties
namestringRequiredThis is the name of the tool.
descriptionstringRequiredThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
expectedToolslist of objectsThis is the expected tools to be called by the LLM application.
Show 5 propertiesHide 5 properties
namestringRequiredThis is the name of the tool.
descriptionstringRequiredThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
conversationalTestCaseslist of objectsThis is a list of multi-turn test cases to evaluate. If you are evaluating single-turn test cases, this should be
null.Show 6 propertiesHide 6 properties
turnslist of objectsRequiredThis is the list of turns in the conversation.
Show 5 propertiesHide 5 properties
roleenumRequiredThe role of the turn, either user or assistant.
Show 2 enum valuesHide 2 enum values
userassistant
contentstringRequiredThe message content of the turn.
userIdstringThe user ID associated with the turn.
retrievalContextlist of stringsThe contexts retrieved to generate the LLM response for this turn.
toolsCalledlist of objectsThe tools called to generate the LLM response for this turn.
Show 5 propertiesHide 5 properties
namestringRequiredThis is the name of the tool.
descriptionstringRequiredThis is the description of the tool.
inputParametersobjectThis is the input parameters that are passed to the tool.
outputstringThis is the output of the tool.
reasoningstringThis is the reasoning your LLM provided for the tool call.
scenariostringThis is a description of the conversation context.
namestringThis is the name of your test case, it allows you to search and match test cases across different test runs.
expectedOutcomestringThis describes the expected outcome, or ideal conversation flow, of the conversation.
userDescriptionstringThis is the description of the user in the conversation.
chatbotRolestringThis is the role of the chatbot in the conversation.
hyperparametersobjectThis is any hyperparameters like model or prompt you wish to associate with the test run.
identifierstringA unique identifier for the test run.
Response
successbooleanThis is true if the test cases were successfully evaluated.
dataobjectShow 1 propertyHide 1 property
idstringThis is the unique ID for the test run. This ID is generated by Confident AI and is not to be confused with the identifier provided by the user.
deprecatedbooleanThis is true if this endpoint is deprecated.