Python
import honeyhive
from honeyhive.models import components
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.runs.create_run(request=components.CreateRunRequest(
project='<value>',
name='<value>',
event_ids=[
'1b590040-fd4d-40db-a8d8-d6e550cfa9f3',
],
))
if res.create_run_response is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
import { Status } from "honeyhive/dist/models/components";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.runs.createRun({
project: "<value>",
name: "<value>",
eventIds: [
"1b590040-fd4d-40db-a8d8-d6e550cfa9f3",
],
datapointIds: [
"<value>",
],
configuration: {
"key": "<value>",
},
metadata: {
"key": "<value>",
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request POST \
--url https://api.honeyhive.ai/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project": "<string>",
"name": "<string>",
"event_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"dataset_id": "<string>",
"datapoint_ids": [
"<string>"
],
"configuration": {},
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project: '<string>',
name: '<string>',
event_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
dataset_id: '<string>',
datapoint_ids: ['<string>'],
configuration: {},
metadata: {}
})
};
fetch('https://api.honeyhive.ai/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.honeyhive.ai/runs",
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' => '<string>',
'name' => '<string>',
'event_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'dataset_id' => '<string>',
'datapoint_ids' => [
'<string>'
],
'configuration' => [
],
'metadata' => [
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeyhive.ai/runs"
payload := strings.NewReader("{\n \"project\": \"<string>\",\n \"name\": \"<string>\",\n \"event_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"dataset_id\": \"<string>\",\n \"datapoint_ids\": [\n \"<string>\"\n ],\n \"configuration\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.honeyhive.ai/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project\": \"<string>\",\n \"name\": \"<string>\",\n \"event_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"dataset_id\": \"<string>\",\n \"datapoint_ids\": [\n \"<string>\"\n ],\n \"configuration\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project\": \"<string>\",\n \"name\": \"<string>\",\n \"event_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"dataset_id\": \"<string>\",\n \"datapoint_ids\": [\n \"<string>\"\n ],\n \"configuration\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"evaluation": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"event_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"dataset_id": "<string>",
"datapoint_ids": [
"<string>"
],
"results": {},
"configuration": {},
"metadata": {},
"status": "pending",
"name": "<string>"
},
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Experiments
Create a new evaluation run
POST
/
runs
Python
import honeyhive
from honeyhive.models import components
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.runs.create_run(request=components.CreateRunRequest(
project='<value>',
name='<value>',
event_ids=[
'1b590040-fd4d-40db-a8d8-d6e550cfa9f3',
],
))
if res.create_run_response is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
import { Status } from "honeyhive/dist/models/components";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.runs.createRun({
project: "<value>",
name: "<value>",
eventIds: [
"1b590040-fd4d-40db-a8d8-d6e550cfa9f3",
],
datapointIds: [
"<value>",
],
configuration: {
"key": "<value>",
},
metadata: {
"key": "<value>",
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request POST \
--url https://api.honeyhive.ai/runs \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"project": "<string>",
"name": "<string>",
"event_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"dataset_id": "<string>",
"datapoint_ids": [
"<string>"
],
"configuration": {},
"metadata": {}
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project: '<string>',
name: '<string>',
event_ids: ['3c90c3cc-0d44-4b50-8888-8dd25736052a'],
dataset_id: '<string>',
datapoint_ids: ['<string>'],
configuration: {},
metadata: {}
})
};
fetch('https://api.honeyhive.ai/runs', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.honeyhive.ai/runs",
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' => '<string>',
'name' => '<string>',
'event_ids' => [
'3c90c3cc-0d44-4b50-8888-8dd25736052a'
],
'dataset_id' => '<string>',
'datapoint_ids' => [
'<string>'
],
'configuration' => [
],
'metadata' => [
]
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.honeyhive.ai/runs"
payload := strings.NewReader("{\n \"project\": \"<string>\",\n \"name\": \"<string>\",\n \"event_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"dataset_id\": \"<string>\",\n \"datapoint_ids\": [\n \"<string>\"\n ],\n \"configuration\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.honeyhive.ai/runs")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project\": \"<string>\",\n \"name\": \"<string>\",\n \"event_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"dataset_id\": \"<string>\",\n \"datapoint_ids\": [\n \"<string>\"\n ],\n \"configuration\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/runs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"project\": \"<string>\",\n \"name\": \"<string>\",\n \"event_ids\": [\n \"3c90c3cc-0d44-4b50-8888-8dd25736052a\"\n ],\n \"dataset_id\": \"<string>\",\n \"datapoint_ids\": [\n \"<string>\"\n ],\n \"configuration\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"evaluation": {
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"project": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"event_ids": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"dataset_id": "<string>",
"datapoint_ids": [
"<string>"
],
"results": {},
"configuration": {},
"metadata": {},
"status": "pending",
"name": "<string>"
},
"run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Authorizations
Body
application/json
Was this page helpful?