import requests
url = "https://app.langwatch.ai/api/v1/evaluations/batch/log_results"
payload = {
"run_id": "<string>",
"dataset": [
{
"index": 123,
"entry": {},
"target_id": "<string>",
"predicted": {},
"cost": 123,
"duration": 123,
"error": "<string>",
"trace_id": "<string>"
}
],
"evaluations": [
{
"evaluator": "<string>",
"status": "processed",
"index": 123,
"name": "<string>",
"target_id": "<string>",
"duration": 123,
"inputs": {},
"score": 123,
"label": "<string>",
"passed": True,
"details": "<string>",
"cost": 123
}
],
"name": "<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({
run_id: '<string>',
dataset: [
{
index: 123,
entry: {},
target_id: '<string>',
predicted: {},
cost: 123,
duration: 123,
error: '<string>',
trace_id: '<string>'
}
],
evaluations: [
{
evaluator: '<string>',
status: 'processed',
index: 123,
name: '<string>',
target_id: '<string>',
duration: 123,
inputs: {},
score: 123,
label: '<string>',
passed: true,
details: '<string>',
cost: 123
}
],
name: '<string>'
})
};
fetch('https://app.langwatch.ai/api/v1/evaluations/batch/log_results', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/evaluations/batch/log_results \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"run_id": "<string>",
"dataset": [
{
"index": 123,
"entry": {},
"target_id": "<string>",
"predicted": {},
"cost": 123,
"duration": 123,
"error": "<string>",
"trace_id": "<string>"
}
],
"evaluations": [
{
"evaluator": "<string>",
"status": "processed",
"index": 123,
"name": "<string>",
"target_id": "<string>",
"duration": 123,
"inputs": {},
"score": 123,
"label": "<string>",
"passed": true,
"details": "<string>",
"cost": 123
}
],
"name": "<string>"
}
'{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}This response has no body data.Report batch evaluation results
Report the rows of a batch evaluation against an experiment, so its scores and progress show up in the app. This is the second half of an SDK batch evaluation: create the experiment with POST /api/experiment/init, then post rows here as they finish. Identify the experiment by either experiment_id or experiment_slug. Bodies up to 267 MB are accepted, sized for one dataset row with ten 20 MB images inline. A larger body is refused with evaluation_log_results_too_large.
import requests
url = "https://app.langwatch.ai/api/v1/evaluations/batch/log_results"
payload = {
"run_id": "<string>",
"dataset": [
{
"index": 123,
"entry": {},
"target_id": "<string>",
"predicted": {},
"cost": 123,
"duration": 123,
"error": "<string>",
"trace_id": "<string>"
}
],
"evaluations": [
{
"evaluator": "<string>",
"status": "processed",
"index": 123,
"name": "<string>",
"target_id": "<string>",
"duration": 123,
"inputs": {},
"score": 123,
"label": "<string>",
"passed": True,
"details": "<string>",
"cost": 123
}
],
"name": "<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({
run_id: '<string>',
dataset: [
{
index: 123,
entry: {},
target_id: '<string>',
predicted: {},
cost: 123,
duration: 123,
error: '<string>',
trace_id: '<string>'
}
],
evaluations: [
{
evaluator: '<string>',
status: 'processed',
index: 123,
name: '<string>',
target_id: '<string>',
duration: 123,
inputs: {},
score: 123,
label: '<string>',
passed: true,
details: '<string>',
cost: 123
}
],
name: '<string>'
})
};
fetch('https://app.langwatch.ai/api/v1/evaluations/batch/log_results', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://app.langwatch.ai/api/v1/evaluations/batch/log_results \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: <api-key>' \
--data '
{
"run_id": "<string>",
"dataset": [
{
"index": 123,
"entry": {},
"target_id": "<string>",
"predicted": {},
"cost": 123,
"duration": 123,
"error": "<string>",
"trace_id": "<string>"
}
],
"evaluations": [
{
"evaluator": "<string>",
"status": "processed",
"index": 123,
"name": "<string>",
"target_id": "<string>",
"duration": 123,
"inputs": {},
"score": 123,
"label": "<string>",
"passed": true,
"details": "<string>",
"cost": 123
}
],
"name": "<string>"
}
'{
"message": "<string>"
}{
"message": "<string>",
"error": "<string>"
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}{
"error": "<string>",
"kind": "<string>",
"meta": {}
}This response has no body data.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
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Response
The rows were recorded
Human-readable confirmation
Was this page helpful?