import requests
url = "https://app.langwatch.ai/api/dataset/evaluate"
payload = {
"evaluation": "<string>",
"datasetSlug": "<string>"
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({evaluation: '<string>', datasetSlug: '<string>'})
};
fetch('https://app.langwatch.ai/api/dataset/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/dataset/evaluate \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"evaluation": "<string>",
"datasetSlug": "<string>"
}
'{
"status": "<string>",
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
},
"raw_response": "<unknown>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}Evaluate a dataset
Run one evaluator across a saved dataset and record the result against an experiment. Name the dataset by slug and the evaluator the same way the evaluate endpoints do; results are grouped under experimentSlug, or under a generated batch id when you omit it.
import requests
url = "https://app.langwatch.ai/api/dataset/evaluate"
payload = {
"evaluation": "<string>",
"datasetSlug": "<string>"
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Auth-Token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({evaluation: '<string>', datasetSlug: '<string>'})
};
fetch('https://app.langwatch.ai/api/dataset/evaluate', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/dataset/evaluate \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"evaluation": "<string>",
"datasetSlug": "<string>"
}
'{
"status": "<string>",
"score": 123,
"passed": true,
"label": "<string>",
"details": "<string>",
"cost": {
"currency": "<string>",
"amount": 123
},
"raw_response": "<unknown>"
}{
"message": "<string>",
"error": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}Authorizations
Project API key for sending traces and accessing project-scoped resources. Format: sk-lw-... (no underscore). Obtain one by creating a project via the Admin API or the LangWatch UI.
Body
Which evaluator to run, addressed the same way the evaluate endpoints address it
The saved dataset to evaluate
Groups the results under an experiment. Omit it and a batch id is generated instead.
Older name for experimentSlug, used when that is absent
Extra fields merged into every row before evaluating
Show child attributes
Show child attributes
Per-call overrides of the evaluator's settings
Show child attributes
Show child attributes
Was this page helpful?