Add a single pair to a dataset (creates new dataset if the system_prompt_template that's provided doesn't correspond to an existing dataset)
curl --request POST \
--url https://beta.getplum.ai/v1/data/seed/pair \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"output": "<string>",
"system_prompt_template": "<string>",
"id": "<string>",
"labels": [
"<string>"
],
"input_media": "aSDinaTvuI8gbWludGxpZnk="
}
'import requests
url = "https://beta.getplum.ai/v1/data/seed/pair"
payload = {
"input": "<string>",
"output": "<string>",
"system_prompt_template": "<string>",
"id": "<string>",
"labels": ["<string>"],
"input_media": "aSDinaTvuI8gbWludGxpZnk="
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '<string>',
output: '<string>',
system_prompt_template: '<string>',
id: '<string>',
labels: ['<string>'],
input_media: 'aSDinaTvuI8gbWludGxpZnk='
})
};
fetch('https://beta.getplum.ai/v1/data/seed/pair', 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://beta.getplum.ai/v1/data/seed/pair",
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([
'input' => '<string>',
'output' => '<string>',
'system_prompt_template' => '<string>',
'id' => '<string>',
'labels' => [
'<string>'
],
'input_media' => 'aSDinaTvuI8gbWludGxpZnk='
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://beta.getplum.ai/v1/data/seed/pair"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"output\": \"<string>\",\n \"system_prompt_template\": \"<string>\",\n \"id\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"input_media\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://beta.getplum.ai/v1/data/seed/pair")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"output\": \"<string>\",\n \"system_prompt_template\": \"<string>\",\n \"id\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"input_media\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://beta.getplum.ai/v1/data/seed/pair")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"output\": \"<string>\",\n \"system_prompt_template\": \"<string>\",\n \"id\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"input_media\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}"
response = http.request(request)
puts response.read_body{
"dataset_id": "<string>",
"pair_id": "<string>"
}{
"error": "<string>"
}API Reference
Add a single pair to a dataset (creates new dataset if the system_prompt_template that's provided doesn't correspond to an existing dataset)
POST
/
data
/
seed
/
pair
Add a single pair to a dataset (creates new dataset if the system_prompt_template that's provided doesn't correspond to an existing dataset)
curl --request POST \
--url https://beta.getplum.ai/v1/data/seed/pair \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"input": "<string>",
"output": "<string>",
"system_prompt_template": "<string>",
"id": "<string>",
"labels": [
"<string>"
],
"input_media": "aSDinaTvuI8gbWludGxpZnk="
}
'import requests
url = "https://beta.getplum.ai/v1/data/seed/pair"
payload = {
"input": "<string>",
"output": "<string>",
"system_prompt_template": "<string>",
"id": "<string>",
"labels": ["<string>"],
"input_media": "aSDinaTvuI8gbWludGxpZnk="
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '<string>',
output: '<string>',
system_prompt_template: '<string>',
id: '<string>',
labels: ['<string>'],
input_media: 'aSDinaTvuI8gbWludGxpZnk='
})
};
fetch('https://beta.getplum.ai/v1/data/seed/pair', 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://beta.getplum.ai/v1/data/seed/pair",
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([
'input' => '<string>',
'output' => '<string>',
'system_prompt_template' => '<string>',
'id' => '<string>',
'labels' => [
'<string>'
],
'input_media' => 'aSDinaTvuI8gbWludGxpZnk='
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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://beta.getplum.ai/v1/data/seed/pair"
payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"output\": \"<string>\",\n \"system_prompt_template\": \"<string>\",\n \"id\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"input_media\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<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://beta.getplum.ai/v1/data/seed/pair")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"input\": \"<string>\",\n \"output\": \"<string>\",\n \"system_prompt_template\": \"<string>\",\n \"id\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"input_media\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://beta.getplum.ai/v1/data/seed/pair")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"input\": \"<string>\",\n \"output\": \"<string>\",\n \"system_prompt_template\": \"<string>\",\n \"id\": \"<string>\",\n \"labels\": [\n \"<string>\"\n ],\n \"input_media\": \"aSDinaTvuI8gbWludGxpZnk=\"\n}"
response = http.request(request)
puts response.read_body{
"dataset_id": "<string>",
"pair_id": "<string>"
}{
"error": "<string>"
}Authorizations
Body
application/json
If this prompt already exists, the pair will be added to the existing dataset. If not, a new dataset will be created.
Optional ID for the pair, will be generated if not provided
Optional base64 encoded media data
⌘I