Skip to main content
POST
/
ragas
/
faithfulness
/
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/faithfulness",
index=index,
data={
"output": output,
"contexts": row["contexts"],
"input": row["input"],
},
settings={}
)
[
  {
    "status": "processed",
    "score": 123,
    "passed": true,
    "label": "<string>",
    "details": "<string>",
    "cost": {
      "currency": "<string>",
      "amount": 123
    }
  }
]

Authorizations

X-Auth-Token
string
header
required

API key for authentication

Body

application/json
output
string
required

The output/response text to evaluate

contexts
string[]
required

Array of context strings used for RAG evaluation

input
string

The input text to evaluate

settings
object

Response

Successful evaluation

status
enum<string>
Available options:
processed,
skipped,
error
score
number

Numeric score from the evaluation

passed
boolean

Whether the evaluation passed

label
string

Label assigned by the evaluation

details
string

Additional details about the evaluation

cost
object