<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.braintrust.dev/v1/experiment",
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' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'name' => '<string>',
'description' => '<string>',
'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>'
],
'base_exp_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dataset_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'dataset_version' => '<string>',
'internal_metadata' => [
'dataset_filter' => [
]
],
'parameters_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'parameters_version' => '<string>',
'public' => true,
'metadata' => [
],
'tags' => [
'<string>'
],
'ensure_new' => true
]),
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;
}