Python
import honeyhive
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datapoints.get_datapoint(id='<value>')
if res.object is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
import { GetDatapointRequest } from "honeyhive/dist/models/operations";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const id: string = "<value>";
const res = await sdk.datapoints.getDatapoint(id);
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request GET \
--url https://api.honeyhive.ai/datapoints/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.honeyhive.ai/datapoints/{id}', 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/datapoints/{id}",
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/datapoints/{id}"
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/datapoints/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/datapoints/{id}")
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{
"datapoint": [
{
"_id": "65c13dbbd65fb876b7886cdb",
"tenant": "org_XiCNIMTZzUKiY2As",
"project_id": "653454f3138a956964341c07",
"created_at": "2024-02-05T19:57:47.050Z",
"updated_at": "2024-02-05T19:57:47.050Z",
"inputs": {
"query": "what's the temperature in Iceland?"
},
"history": [
{
"role": "system",
"content": "You are a helpful web assistant that helps users answer questions about the world based on the information provided to you by Google's search API. Answer the questions as truthfully as you can. In case you are unsure about the correct answer, please respond with \"I apologize but I'm not sure.\""
},
{
"role": "user",
"content": "what's the temperature in Iceland?\\n\\n\\n--Google search API results below:---\\n\\n\"snippet\":\"2 Week Extended Forecast in Reykjavik, Iceland ; Feb 4, 29 / 20 °F · Snow showers early. Broken clouds. ; Feb 5, 27 / 16 °F · Light snow. Decreasing cloudiness.\",\"snippet_highlighted_words\":[\"Feb 4, 29 / 20 °F\"]"
}
],
"ground_truth": {
"role": "assistant",
"content": "The temperature in Reykjavik, Iceland is currently around 5F or -15C. Please note that weather conditions can change rapidly, so it's best to check a reliable source for the most up-to-date information."
},
"linked_event": "6bba5182-d4b1-4b29-a64a-f0a8bd964f76",
"linked_evals": [],
"linked_datasets": [],
"saved": false,
"type": "event",
"metadata": {
"question_type": "weather",
"completion_tokens": 47,
"prompt_tokens": 696,
"total_tokens": 743
}
}
]
}Datapoints
Retrieve a specific datapoint
GET
/
datapoints
/
{id}
Python
import honeyhive
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datapoints.get_datapoint(id='<value>')
if res.object is not None:
# handle response
passimport { HoneyHive } from "honeyhive";
import { GetDatapointRequest } from "honeyhive/dist/models/operations";
async function run() {
const sdk = new HoneyHive({
bearerAuth: "<YOUR_BEARER_TOKEN_HERE>",
});
const id: string = "<value>";
const res = await sdk.datapoints.getDatapoint(id);
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request GET \
--url https://api.honeyhive.ai/datapoints/{id} \
--header 'Authorization: Bearer <token>'const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.honeyhive.ai/datapoints/{id}', 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/datapoints/{id}",
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/datapoints/{id}"
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/datapoints/{id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/datapoints/{id}")
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{
"datapoint": [
{
"_id": "65c13dbbd65fb876b7886cdb",
"tenant": "org_XiCNIMTZzUKiY2As",
"project_id": "653454f3138a956964341c07",
"created_at": "2024-02-05T19:57:47.050Z",
"updated_at": "2024-02-05T19:57:47.050Z",
"inputs": {
"query": "what's the temperature in Iceland?"
},
"history": [
{
"role": "system",
"content": "You are a helpful web assistant that helps users answer questions about the world based on the information provided to you by Google's search API. Answer the questions as truthfully as you can. In case you are unsure about the correct answer, please respond with \"I apologize but I'm not sure.\""
},
{
"role": "user",
"content": "what's the temperature in Iceland?\\n\\n\\n--Google search API results below:---\\n\\n\"snippet\":\"2 Week Extended Forecast in Reykjavik, Iceland ; Feb 4, 29 / 20 °F · Snow showers early. Broken clouds. ; Feb 5, 27 / 16 °F · Light snow. Decreasing cloudiness.\",\"snippet_highlighted_words\":[\"Feb 4, 29 / 20 °F\"]"
}
],
"ground_truth": {
"role": "assistant",
"content": "The temperature in Reykjavik, Iceland is currently around 5F or -15C. Please note that weather conditions can change rapidly, so it's best to check a reliable source for the most up-to-date information."
},
"linked_event": "6bba5182-d4b1-4b29-a64a-f0a8bd964f76",
"linked_evals": [],
"linked_datasets": [],
"saved": false,
"type": "event",
"metadata": {
"question_type": "weather",
"completion_tokens": 47,
"prompt_tokens": 696,
"total_tokens": 743
}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Datapoint ID like 65c13dbbd65fb876b7886cdb
Response
200 - application/json
Successful response
Show child attributes
Show child attributes
Was this page helpful?
⌘I

