Publish an evaluator version
curl --request POST \
--url https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish', 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.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish"
req, _ := http.NewRequest("POST", 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.post("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"slug": "<string>",
"is_active": true,
"latest_version": 1073741824,
"published_version": 1073741824,
"version": 1073741824,
"definition": {
"type": "python",
"python": {
"name": "<string>",
"metadata": {
"description": "<string>"
},
"sampling": {
"sampling_percentage": 50
},
"filters": {
"filterArray": [
{
"field": "<string>",
"operator": "exists",
"value": "<string>",
"type": "string"
}
]
},
"score_schema": {},
"code_execution": {
"code_snippet": "<string>"
},
"test_criteria": {
"field": "<string>",
"criteria": {
"type": "numeric",
"operator": "gt",
"value": 123
}
}
}
},
"message": "<string>",
"evaluator_created_at": "2023-11-07T05:31:56Z",
"evaluator_updated_at": "2023-11-07T05:31:56Z",
"version_created_at": "2023-11-07T05:31:56Z"
}
}Evaluators
Publish an evaluator version
Select an existing version for automatic evaluation. Repeated publication of the same version is a no-op. Archived evaluators return 409. Requires project.evaluator.publish.
POST
/
v1
/
projects
/
{project_id}
/
evaluators
/
{evaluator_id_or_slug}
/
versions
/
{version}
/
publish
Publish an evaluator version
curl --request POST \
--url https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish', 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.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish"
req, _ := http.NewRequest("POST", 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.post("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.dp1.us.honeyhive.ai/v1/projects/{project_id}/evaluators/{evaluator_id_or_slug}/versions/{version}/publish")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"id": "<string>",
"slug": "<string>",
"is_active": true,
"latest_version": 1073741824,
"published_version": 1073741824,
"version": 1073741824,
"definition": {
"type": "python",
"python": {
"name": "<string>",
"metadata": {
"description": "<string>"
},
"sampling": {
"sampling_percentage": 50
},
"filters": {
"filterArray": [
{
"field": "<string>",
"operator": "exists",
"value": "<string>",
"type": "string"
}
]
},
"score_schema": {},
"code_execution": {
"code_snippet": "<string>"
},
"test_criteria": {
"field": "<string>",
"criteria": {
"type": "numeric",
"operator": "gt",
"value": 123
}
}
}
},
"message": "<string>",
"evaluator_created_at": "2023-11-07T05:31:56Z",
"evaluator_updated_at": "2023-11-07T05:31:56Z",
"version_created_at": "2023-11-07T05:31:56Z"
}
}Authorizations
A fine-grained data plane API key (values begin with hh_fgdp_). Rooted at an organization, workspace, or project, it carries the permissions chosen when it was created, and only the operations whose paths begin with /v1/projects/{project_id}/ accept it. Create one in the HoneyHive app under the project's, workspace's, or organization's Settings → API Keys, on the Data Plane tab.
Path Parameters
Was this page helpful?