Python
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
page = client.training_datasets.contents.list(
"training_dataset_id",
)
page = page.items[0]
print(page.input)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.TrainingDatasets.Contents.List(context.TODO(), "training_dataset_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contentsconst options = {method: 'GET'};
fetch('https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents', 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.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"input": "<string>",
"output": "<string>",
"schema_type": "GENERATION"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Training Datasets V3 (Beta)
Get Training Dataset Contents
GET
/
v4
/
training-datasets
/
{training_dataset_id}
/
contents
Python
import os
from scale_gp import SGPClient
client = SGPClient(
api_key=os.environ.get("SGP_API_KEY"), # This is the default and can be omitted
)
page = client.training_datasets.contents.list(
"training_dataset_id",
)
page = page.items[0]
print(page.input)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/sgp-go"
"github.com/stainless-sdks/sgp-go/option"
)
func main() {
client := sgp.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.TrainingDatasets.Contents.List(context.TODO(), "training_dataset_id")
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}
curl --request GET \
--url https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contentsconst options = {method: 'GET'};
fetch('https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents', 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.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.egp.scale.com/v4/training-datasets/{training_dataset_id}/contents")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body[
{
"input": "<string>",
"output": "<string>",
"schema_type": "GENERATION"
}
]{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}⌘I

