import langwatch
df = langwatch.datasets.get_dataset("dataset-id").to_pandas()
experiment = langwatch.experiment.init("my-experiment")
for index, row in experiment.loop(df.iterrows()):
# your execution code here
experiment.evaluate(
"ragas/response_context_recall",
index=index,
data={
"input": row["input"],
"output": output,
"contexts": row["contexts"],
"expected_output": row["expected_output"],
},
settings={}
)[
{
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
}
}
]RAG Quality
Ragas Response Context Recall
Uses an LLM to measure how many of relevant documents attributable the claims in the output were successfully retrieved in order to generate an expected output.
POST
/
ragas
/
response_context_recall
/
evaluate
import langwatch
df = langwatch.datasets.get_dataset("dataset-id").to_pandas()
experiment = langwatch.experiment.init("my-experiment")
for index, row in experiment.loop(df.iterrows()):
# your execution code here
experiment.evaluate(
"ragas/response_context_recall",
index=index,
data={
"input": row["input"],
"output": output,
"contexts": row["contexts"],
"expected_output": row["expected_output"],
},
settings={}
)[
{
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
}
}
]Authorizations
API key for authentication
Body
application/json
Response
Successful evaluation
Was this page helpful?
⌘I