Evaluation API
API to evaluate a conversation transcript based on user defined attributes (e.g. clarity of responses, courtesy, listening skills, and more).
This API is available only on the Professional Plan and above.
Convai's Evaluation API endpoint
POST https://api.convai.com/character/evaluate_conversation
This API allows you to evaluate a conversation transcript based on user defined attributes e.g. clarity of responses, courtesy, listening skills, and more. The evaluation will be returned in a structured JSON format.
Headers
CONVAI-API-KEY*
String
The unique api-key provided for every account.
Request Body
session_id
String (required)
The ID of the session you want to evaluate.
character_id
String (required)
The ID of the character performing the evaluation.
prompt
String (required)
A predefined or custom prompt containing the transcript and specific instructions for evaluation.
variables
JSON Object (optional)
A set of key-value pairs providing additional data required for evaluation (e.g., customer name, item details). This depends on the prompt being passed.
Example Payload
{
"session_id": "<SESSION ID>",
"character_id": "<CHARACTER ID>",
"prompt": "<EVALUATION PROMPT>",
"variables": {
"customer_name": "Suzie Denver",
"customer_age": "54 years",
"item_details": [
{
"item": "Burger",
"price": "$4",
"quantity": 3
},
{
"item": "Fries",
"price": "$2",
"quantity": 2
}
]
}
}Example prompt
Not passing the conversation_history variable in the prompt will lead to 500 error response from the server.
Response
On success, the API returns a structured evaluation of the conversation, covering multiple attributes.
Code Snippet
Last updated
Was this helpful?