curl --request POST \ --url https://api.traceloop.com/v2/evaluators/execute/topic-adherence \ --header 'Authorization: <api-key>' \ --header 'Content-Type: application/json' \ --data '{ "input": { "completion": "Machine learning is a subset of AI that enables systems to learn from data.", "question": "Tell me about machine learning", "reference_topics": "artificial intelligence, data science, algorithms" }}'
Copy
Ask AI
{ "adherence_score": 0.95}
Evaluators
Execute topic-adherence evaluator
Evaluate topic adherence
Request Body:
input.question (string, required): The original question
input.completion (string, required): The completion to evaluate
input.reference_topics (string, required): Comma-separated list of expected topics
POST
/
v2
/
evaluators
/
execute
/
topic-adherence
Execute topic-adherence evaluator
Copy
Ask AI
curl --request POST \ --url https://api.traceloop.com/v2/evaluators/execute/topic-adherence \ --header 'Authorization: <api-key>' \ --header 'Content-Type: application/json' \ --data '{ "input": { "completion": "Machine learning is a subset of AI that enables systems to learn from data.", "question": "Tell me about machine learning", "reference_topics": "artificial intelligence, data science, algorithms" }}'