curl --request POST \
--url https://app.langwatch.ai/api/evaluations/legacy/ragas_context_relevancy/evaluate \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '{
"data": {
"output": "<string>",
"contexts": [
"<string>"
]
}
}'
[
{
"status": "processed",
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
},
"raw_response": {},
"error_type": "<string>",
"traceback": [
"<string>"
]
}
]
This metric gauges the relevancy of the retrieved context, calculated based on both the question and contexts. The values fall within the range of (0, 1), with higher values indicating better relevancy.
curl --request POST \
--url https://app.langwatch.ai/api/evaluations/legacy/ragas_context_relevancy/evaluate \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '{
"data": {
"output": "<string>",
"contexts": [
"<string>"
]
}
}'
[
{
"status": "processed",
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
},
"raw_response": {},
"error_type": "<string>",
"traceback": [
"<string>"
]
}
]
Successful evaluation
The response is of type object[]
.
Was this page helpful?