Python
import honeyhive
from honeyhive.models import components
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datasets.update_dataset(request=components.DatasetUpdate(
dataset_id='663876ec4611c47f4970f0c3',
name='new-dataset-name',
description='An updated dataset description',
datapoints=[
'66369748b5773befbdc661e',
],
linked_evals=[
'66369748b5773befbdasdk1',
],
metadata={
'updated': True,
'source': 'prod',
},
))
if res is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.datasets.updateDataset({
datasetId: "663876ec4611c47f4970f0c3",
name: "new-dataset-name",
description: "An updated dataset description",
datapoints: [
"66369748b5773befbdc661e",
],
linkedEvals: [
"66369748b5773befbdasdk1",
],
metadata: {
"updated": true,
"source": "prod",
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request PUT \
--url https://api.honeyhive.ai/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "663876ec4611c47f4970f0c3",
"name": "new-dataset-name",
"description": "An updated dataset description",
"datapoints": [
"66369748b5773befbdc661e"
],
"linked_evals": [
"66369748b5773befbdasdk1"
],
"metadata": {
"updated": true,
"source": "prod"
}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset_id: '663876ec4611c47f4970f0c3',
name: 'new-dataset-name',
description: 'An updated dataset description',
datapoints: ['66369748b5773befbdc661e'],
linked_evals: ['66369748b5773befbdasdk1'],
metadata: {updated: true, source: 'prod'}
})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dataset_id' => '663876ec4611c47f4970f0c3',
'name' => 'new-dataset-name',
'description' => 'An updated dataset description',
'datapoints' => [
'66369748b5773befbdc661e'
],
'linked_evals' => [
'66369748b5773befbdasdk1'
],
'metadata' => [
'updated' => true,
'source' => 'prod'
]
]),
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/datasets"
payload := strings.NewReader("{\n \"dataset_id\": \"663876ec4611c47f4970f0c3\",\n \"name\": \"new-dataset-name\",\n \"description\": \"An updated dataset description\",\n \"datapoints\": [\n \"66369748b5773befbdc661e\"\n ],\n \"linked_evals\": [\n \"66369748b5773befbdasdk1\"\n ],\n \"metadata\": {\n \"updated\": true,\n \"source\": \"prod\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.honeyhive.ai/datasets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_id\": \"663876ec4611c47f4970f0c3\",\n \"name\": \"new-dataset-name\",\n \"description\": \"An updated dataset description\",\n \"datapoints\": [\n \"66369748b5773befbdc661e\"\n ],\n \"linked_evals\": [\n \"66369748b5773befbdasdk1\"\n ],\n \"metadata\": {\n \"updated\": true,\n \"source\": \"prod\"\n }\n}")
.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::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_id\": \"663876ec4611c47f4970f0c3\",\n \"name\": \"new-dataset-name\",\n \"description\": \"An updated dataset description\",\n \"datapoints\": [\n \"66369748b5773befbdc661e\"\n ],\n \"linked_evals\": [\n \"66369748b5773befbdasdk1\"\n ],\n \"metadata\": {\n \"updated\": true,\n \"source\": \"prod\"\n }\n}"
response = http.request(request)
puts response.read_bodyDatasets
Update a dataset
PUT
/
datasets
Python
import honeyhive
from honeyhive.models import components
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datasets.update_dataset(request=components.DatasetUpdate(
dataset_id='663876ec4611c47f4970f0c3',
name='new-dataset-name',
description='An updated dataset description',
datapoints=[
'66369748b5773befbdc661e',
],
linked_evals=[
'66369748b5773befbdasdk1',
],
metadata={
'updated': True,
'source': 'prod',
},
))
if res is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const res = await sdk.datasets.updateDataset({
datasetId: "663876ec4611c47f4970f0c3",
name: "new-dataset-name",
description: "An updated dataset description",
datapoints: [
"66369748b5773befbdc661e",
],
linkedEvals: [
"66369748b5773befbdasdk1",
],
metadata: {
"updated": true,
"source": "prod",
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request PUT \
--url https://api.honeyhive.ai/datasets \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"dataset_id": "663876ec4611c47f4970f0c3",
"name": "new-dataset-name",
"description": "An updated dataset description",
"datapoints": [
"66369748b5773befbdc661e"
],
"linked_evals": [
"66369748b5773befbdasdk1"
],
"metadata": {
"updated": true,
"source": "prod"
}
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dataset_id: '663876ec4611c47f4970f0c3',
name: 'new-dataset-name',
description: 'An updated dataset description',
datapoints: ['66369748b5773befbdc661e'],
linked_evals: ['66369748b5773befbdasdk1'],
metadata: {updated: true, source: 'prod'}
})
};
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 => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dataset_id' => '663876ec4611c47f4970f0c3',
'name' => 'new-dataset-name',
'description' => 'An updated dataset description',
'datapoints' => [
'66369748b5773befbdc661e'
],
'linked_evals' => [
'66369748b5773befbdasdk1'
],
'metadata' => [
'updated' => true,
'source' => 'prod'
]
]),
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/datasets"
payload := strings.NewReader("{\n \"dataset_id\": \"663876ec4611c47f4970f0c3\",\n \"name\": \"new-dataset-name\",\n \"description\": \"An updated dataset description\",\n \"datapoints\": [\n \"66369748b5773befbdc661e\"\n ],\n \"linked_evals\": [\n \"66369748b5773befbdasdk1\"\n ],\n \"metadata\": {\n \"updated\": true,\n \"source\": \"prod\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.honeyhive.ai/datasets")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"dataset_id\": \"663876ec4611c47f4970f0c3\",\n \"name\": \"new-dataset-name\",\n \"description\": \"An updated dataset description\",\n \"datapoints\": [\n \"66369748b5773befbdc661e\"\n ],\n \"linked_evals\": [\n \"66369748b5773befbdasdk1\"\n ],\n \"metadata\": {\n \"updated\": true,\n \"source\": \"prod\"\n }\n}")
.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::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"dataset_id\": \"663876ec4611c47f4970f0c3\",\n \"name\": \"new-dataset-name\",\n \"description\": \"An updated dataset description\",\n \"datapoints\": [\n \"66369748b5773befbdc661e\"\n ],\n \"linked_evals\": [\n \"66369748b5773befbdasdk1\"\n ],\n \"metadata\": {\n \"updated\": true,\n \"source\": \"prod\"\n }\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
The unique identifier of the dataset being updated
Updated name for the dataset
Updated description for the dataset
Updated list of datapoint ids for the dataset - note the full list is needed
Updated list of unique evaluation run ids to be associated with this dataset
Updated metadata to track for the dataset
Response
200
Successful update
Was this page helpful?
⌘I

