<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.braintrust.dev/v1/eval",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'project_id' => '<string>',
'data' => [
'dataset_id' => '<string>',
'dataset_version' => '<string>',
'dataset_environment' => '<string>',
'_internal_btql' => [
]
],
'task' => [
'function_id' => '<string>',
'version' => '<string>'
],
'scores' => [
[
'function_id' => '<string>',
'version' => '<string>'
]
],
'name' => '<string>',
'parameters' => [
],
'experiment_name' => '<string>',
'metadata' => [
],
'parent' => [
'object_id' => '<string>',
'row_ids' => [
'id' => '<string>',
'span_id' => '<string>',
'root_span_id' => '<string>'
],
'propagated_event' => [
]
],
'stream' => true,
'trial_count' => 123,
'is_public' => true,
'timeout' => 123,
'max_concurrency' => 10,
'base_experiment_name' => '<string>',
'base_experiment_id' => '<string>',
'git_metadata_settings' => [
'fields' => [
]
],
'repo_info' => [
'commit' => '<string>',
'branch' => '<string>',
'tag' => '<string>',
'dirty' => true,
'author_name' => '<string>',
'author_email' => '<string>',
'commit_message' => '<string>',
'commit_time' => '<string>',
'git_diff' => '<string>'
],
'strict' => true,
'stop_token' => '<string>',
'extra_messages' => '<string>',
'tags' => [
'<string>'
],
'mcp_auth' => [
],
'endpoint_name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}