Python
import honeyhive
from honeyhive.models import components
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datapoints.create_datapoint(request=components.CreateDatapointRequest(
project='New Project',
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_datasets=[
'<value>',
],
metadata={
'question_type': 'weather',
'completion_tokens': 47,
'prompt_tokens': 696,
'total_tokens': 743,
},
))
if res.object 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.datapoints.createDatapoint({
project: "New Project",
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\"]",
},
],
groundTruth: {
"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.",
},
linkedEvent: "6bba5182-d4b1-4b29-a64a-f0a8bd964f76",
linkedDatasets: [
"<value>",
],
metadata: {
"question_type": "weather",
"completion_tokens": 47,
"prompt_tokens": 696,
"total_tokens": 743,
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request POST \
--url https://api.honeyhive.ai/datapoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"project": "New Project",
"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_datasets": [],
"metadata": {
"question_type": "weather",
"completion_tokens": 47,
"prompt_tokens": 696,
"total_tokens": 743
}
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project: 'New Project',
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_datasets: [],
metadata: {
question_type: 'weather',
completion_tokens: 47,
prompt_tokens: 696,
total_tokens: 743
}
})
};
fetch('https://api.honeyhive.ai/datapoints', 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",
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' => 'New Project',
'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_datasets' => [
],
'metadata' => [
'question_type' => 'weather',
'completion_tokens' => 47,
'prompt_tokens' => 696,
'total_tokens' => 743
]
]),
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/datapoints"
payload := strings.NewReader("{\n \"project\": \"New Project\",\n \"inputs\": {\n \"query\": \"what's the temperature in Iceland?\"\n },\n \"history\": [\n {\n \"role\": \"system\",\n \"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.\\\"\"\n },\n {\n \"role\": \"user\",\n \"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\\\"]\"\n }\n ],\n \"ground_truth\": {\n \"role\": \"assistant\",\n \"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.\"\n },\n \"linked_event\": \"6bba5182-d4b1-4b29-a64a-f0a8bd964f76\",\n \"linked_datasets\": [],\n \"metadata\": {\n \"question_type\": \"weather\",\n \"completion_tokens\": 47,\n \"prompt_tokens\": 696,\n \"total_tokens\": 743\n }\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/datapoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project\": \"New Project\",\n \"inputs\": {\n \"query\": \"what's the temperature in Iceland?\"\n },\n \"history\": [\n {\n \"role\": \"system\",\n \"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.\\\"\"\n },\n {\n \"role\": \"user\",\n \"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\\\"]\"\n }\n ],\n \"ground_truth\": {\n \"role\": \"assistant\",\n \"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.\"\n },\n \"linked_event\": \"6bba5182-d4b1-4b29-a64a-f0a8bd964f76\",\n \"linked_datasets\": [],\n \"metadata\": {\n \"question_type\": \"weather\",\n \"completion_tokens\": 47,\n \"prompt_tokens\": 696,\n \"total_tokens\": 743\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/datapoints")
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\": \"New Project\",\n \"inputs\": {\n \"query\": \"what's the temperature in Iceland?\"\n },\n \"history\": [\n {\n \"role\": \"system\",\n \"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.\\\"\"\n },\n {\n \"role\": \"user\",\n \"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\\\"]\"\n }\n ],\n \"ground_truth\": {\n \"role\": \"assistant\",\n \"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.\"\n },\n \"linked_event\": \"6bba5182-d4b1-4b29-a64a-f0a8bd964f76\",\n \"linked_datasets\": [],\n \"metadata\": {\n \"question_type\": \"weather\",\n \"completion_tokens\": 47,\n \"prompt_tokens\": 696,\n \"total_tokens\": 743\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"insertedId": "<string>"
}
}Datapoints
Create a new datapoint
POST
/
datapoints
Python
import honeyhive
from honeyhive.models import components
s = honeyhive.HoneyHive(
bearer_auth="<YOUR_BEARER_TOKEN_HERE>",
)
res = s.datapoints.create_datapoint(request=components.CreateDatapointRequest(
project='New Project',
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_datasets=[
'<value>',
],
metadata={
'question_type': 'weather',
'completion_tokens': 47,
'prompt_tokens': 696,
'total_tokens': 743,
},
))
if res.object 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.datapoints.createDatapoint({
project: "New Project",
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\"]",
},
],
groundTruth: {
"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.",
},
linkedEvent: "6bba5182-d4b1-4b29-a64a-f0a8bd964f76",
linkedDatasets: [
"<value>",
],
metadata: {
"question_type": "weather",
"completion_tokens": 47,
"prompt_tokens": 696,
"total_tokens": 743,
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();curl --request POST \
--url https://api.honeyhive.ai/datapoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"project": "New Project",
"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_datasets": [],
"metadata": {
"question_type": "weather",
"completion_tokens": 47,
"prompt_tokens": 696,
"total_tokens": 743
}
}
EOFconst options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
project: 'New Project',
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_datasets: [],
metadata: {
question_type: 'weather',
completion_tokens: 47,
prompt_tokens: 696,
total_tokens: 743
}
})
};
fetch('https://api.honeyhive.ai/datapoints', 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",
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' => 'New Project',
'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_datasets' => [
],
'metadata' => [
'question_type' => 'weather',
'completion_tokens' => 47,
'prompt_tokens' => 696,
'total_tokens' => 743
]
]),
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/datapoints"
payload := strings.NewReader("{\n \"project\": \"New Project\",\n \"inputs\": {\n \"query\": \"what's the temperature in Iceland?\"\n },\n \"history\": [\n {\n \"role\": \"system\",\n \"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.\\\"\"\n },\n {\n \"role\": \"user\",\n \"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\\\"]\"\n }\n ],\n \"ground_truth\": {\n \"role\": \"assistant\",\n \"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.\"\n },\n \"linked_event\": \"6bba5182-d4b1-4b29-a64a-f0a8bd964f76\",\n \"linked_datasets\": [],\n \"metadata\": {\n \"question_type\": \"weather\",\n \"completion_tokens\": 47,\n \"prompt_tokens\": 696,\n \"total_tokens\": 743\n }\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/datapoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"project\": \"New Project\",\n \"inputs\": {\n \"query\": \"what's the temperature in Iceland?\"\n },\n \"history\": [\n {\n \"role\": \"system\",\n \"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.\\\"\"\n },\n {\n \"role\": \"user\",\n \"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\\\"]\"\n }\n ],\n \"ground_truth\": {\n \"role\": \"assistant\",\n \"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.\"\n },\n \"linked_event\": \"6bba5182-d4b1-4b29-a64a-f0a8bd964f76\",\n \"linked_datasets\": [],\n \"metadata\": {\n \"question_type\": \"weather\",\n \"completion_tokens\": 47,\n \"prompt_tokens\": 696,\n \"total_tokens\": 743\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.honeyhive.ai/datapoints")
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\": \"New Project\",\n \"inputs\": {\n \"query\": \"what's the temperature in Iceland?\"\n },\n \"history\": [\n {\n \"role\": \"system\",\n \"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.\\\"\"\n },\n {\n \"role\": \"user\",\n \"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\\\"]\"\n }\n ],\n \"ground_truth\": {\n \"role\": \"assistant\",\n \"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.\"\n },\n \"linked_event\": \"6bba5182-d4b1-4b29-a64a-f0a8bd964f76\",\n \"linked_datasets\": [],\n \"metadata\": {\n \"question_type\": \"weather\",\n \"completion_tokens\": 47,\n \"prompt_tokens\": 696,\n \"total_tokens\": 743\n }\n}"
response = http.request(request)
puts response.read_body{
"result": {
"insertedId": "<string>"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Name for the project to which the datapoint belongs
Arbitrary JSON object containing the inputs for the datapoint
Conversation history associated with the datapoint
Expected output JSON object for the datapoint
Event id for the event from which the datapoint was created
Ids of all datasets that include the datapoint
Any additional metadata for the datapoint
Response
200 - application/json
Datapoint successfully created
Show child attributes
Show child attributes
Was this page helpful?
⌘I

