v1
latestOpenAPI 3.0.02026-07-1346146138.4 KBevaluators
Execute context-relevance evaluator
Evaluate whether retrieved context contains sufficient information to answer the query
Request Body:
- input.query (string, required): The query/question to evaluate context relevance for
- input.completion (string, required): The completion to evaluate for context relevance
- input.context (string, required): The context to evaluate for relevance to the query
- config.model (string, optional): Model to use for evaluation (default: gpt-4o)
post/v2/evaluators/context-relevance/execute
Request body
Example request
{
"config": {
"model": "gpt-4o"
},
"input": {
"completion": "Our store is open Monday to Friday from 9am to 6pm, and Saturday from 10am to 4pm. We are closed on Sundays.",
"context": "Our store is open Monday to Friday from 9am to 6pm, and Saturday from 10am to 4pm. We are closed on Sundays.",
"query": "What are the business hours?"
}
}Response
OK
Example response
{
"relevance_score": 0.88
}