Python
import honeyhive
from honeyhive.models import operations
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datasets.get_datasets(project='<value>', type=operations.Type.EVALUATION, dataset_id='<value>')
if res.object is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
import { GetDatasetsRequest, TypeT } from "honeyhive/dist/models/operations";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const project: string = "<value>";
const type: TypeT = TypeT.Evaluation;
const datasetId: string = "<value>";
const res = await sdk.datasets.getDatasets(project, type, datasetId);
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request GET \
--url https://api.honeyhive.ai/datasets \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.honeyhive.ai/datasets', 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/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.honeyhive.ai/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.honeyhive.ai/datasets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"testcases": [
{
"project": "New Project",
"name": "test-dataset",
"description": "A test dataset",
"type": "evaluation",
"datapoints": [
"66369748b5773befbdc661e2"
],
"num_points": 1,
"linked_evals": [],
"saved": false,
"pipeline_type": "event",
"created_at": "2024-05-04T20:15:04.124Z",
"updated_at": "2024-05-04T20:15:04.124Z"
}
]
}Datasets
Get datasets
GET
/
datasets
Python
import honeyhive
from honeyhive.models import operations
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datasets.get_datasets(project='<value>', type=operations.Type.EVALUATION, dataset_id='<value>')
if res.object is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
import { GetDatasetsRequest, TypeT } from "honeyhive/dist/models/operations";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const project: string = "<value>";
const type: TypeT = TypeT.Evaluation;
const datasetId: string = "<value>";
const res = await sdk.datasets.getDatasets(project, type, datasetId);
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request GET \
--url https://api.honeyhive.ai/datasets \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.honeyhive.ai/datasets', 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/datasets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.honeyhive.ai/datasets"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.honeyhive.ai/datasets")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/datasets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"testcases": [
{
"project": "New Project",
"name": "test-dataset",
"description": "A test dataset",
"type": "evaluation",
"datapoints": [
"66369748b5773befbdc661e2"
],
"num_points": 1,
"linked_evals": [],
"saved": false,
"pipeline_type": "event",
"created_at": "2024-05-04T20:15:04.124Z",
"updated_at": "2024-05-04T20:15:04.124Z"
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Project Name associated with the datasets like New Project
Type of the dataset - "evaluation" or "fine-tuning"
Available options:
evaluation, fine-tuning Unique dataset ID for filtering specific dataset like 663876ec4611c47f4970f0c3
Response
200 - application/json
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I

