Improve a metric from feedback
curl --request POST \
--url https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/ \
--header 'Content-Type: application/json' \
--header 'X-CEKURA-API-KEY: <api-key>' \
--data '
{
"metric_id": 123,
"test_set_ids": [
123
],
"simplified_prompt": "<string>",
"skip_evaluation": false
}
'import requests
url = "https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/"
payload = {
"metric_id": 123,
"test_set_ids": [123],
"simplified_prompt": "<string>",
"skip_evaluation": False
}
headers = {
"X-CEKURA-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CEKURA-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric_id: 123,
test_set_ids: [123],
simplified_prompt: '<string>',
skip_evaluation: false
})
};
fetch('https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/', 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.cekura.ai/test_framework/metric-reviews/process_feedbacks/",
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([
'metric_id' => 123,
'test_set_ids' => [
123
],
'simplified_prompt' => '<string>',
'skip_evaluation' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CEKURA-API-KEY: <api-key>"
],
]);
$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.cekura.ai/test_framework/metric-reviews/process_feedbacks/"
payload := strings.NewReader("{\n \"metric_id\": 123,\n \"test_set_ids\": [\n 123\n ],\n \"simplified_prompt\": \"<string>\",\n \"skip_evaluation\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CEKURA-API-KEY", "<api-key>")
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.cekura.ai/test_framework/metric-reviews/process_feedbacks/")
.header("X-CEKURA-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metric_id\": 123,\n \"test_set_ids\": [\n 123\n ],\n \"simplified_prompt\": \"<string>\",\n \"skip_evaluation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CEKURA-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metric_id\": 123,\n \"test_set_ids\": [\n 123\n ],\n \"simplified_prompt\": \"<string>\",\n \"skip_evaluation\": false\n}"
response = http.request(request)
puts response.read_bodyLabs
Auto-Improve Metric
Improve a metric using feedback from test sets. Returns improved metric configuration. Use the Update Metric endpoint to save changes.
POST
/
test_framework
/
metric-reviews
/
process_feedbacks
/
Improve a metric from feedback
curl --request POST \
--url https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/ \
--header 'Content-Type: application/json' \
--header 'X-CEKURA-API-KEY: <api-key>' \
--data '
{
"metric_id": 123,
"test_set_ids": [
123
],
"simplified_prompt": "<string>",
"skip_evaluation": false
}
'import requests
url = "https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/"
payload = {
"metric_id": 123,
"test_set_ids": [123],
"simplified_prompt": "<string>",
"skip_evaluation": False
}
headers = {
"X-CEKURA-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-CEKURA-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
metric_id: 123,
test_set_ids: [123],
simplified_prompt: '<string>',
skip_evaluation: false
})
};
fetch('https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/', 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.cekura.ai/test_framework/metric-reviews/process_feedbacks/",
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([
'metric_id' => 123,
'test_set_ids' => [
123
],
'simplified_prompt' => '<string>',
'skip_evaluation' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-CEKURA-API-KEY: <api-key>"
],
]);
$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.cekura.ai/test_framework/metric-reviews/process_feedbacks/"
payload := strings.NewReader("{\n \"metric_id\": 123,\n \"test_set_ids\": [\n 123\n ],\n \"simplified_prompt\": \"<string>\",\n \"skip_evaluation\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-CEKURA-API-KEY", "<api-key>")
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.cekura.ai/test_framework/metric-reviews/process_feedbacks/")
.header("X-CEKURA-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"metric_id\": 123,\n \"test_set_ids\": [\n 123\n ],\n \"simplified_prompt\": \"<string>\",\n \"skip_evaluation\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cekura.ai/test_framework/metric-reviews/process_feedbacks/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-CEKURA-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"metric_id\": 123,\n \"test_set_ids\": [\n 123\n ],\n \"simplified_prompt\": \"<string>\",\n \"skip_evaluation\": false\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
api_keyoauth2supabase_session
API Key Authentication. It should be included in the header of each request.
Body
application/jsonapplication/x-www-form-urlencodedmultipart/form-data
ID of the metric to process feedbacks for
Optional metric type
basic- Basic (Deprecated in favor of LLM Judge)custom_prompt- Custom Prompt ( Deprecated in favor of LLM Judge)custom_code- Custom Codellm_judge- LLM Judge
Available options:
basic, custom_prompt, custom_code, llm_judge Test set IDs whose feedback drives the optimization. If omitted, defaults to every test set already added to this metric's Lab.
Simplified prompt to use as initial prompt for optimization. If provided, the optimizer will start from this prompt instead of the metric's original description.
If true, skip running LLM evaluations on test sets after optimization. This speeds up the process but won't show evaluation results.
Response
200
Returns progress_id for tracking progress