import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const trainingDataset = await client.trainingDatasets.create({
account_id: 'account_id',
file: fs.createReadStream('path/to/file'),
name: 'name',
schema_type: 'GENERATION',
});
console.log(trainingDataset.id);
{
"name": "<string>",
"schema_type": "GENERATION",
"data_source": "S3",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>"
}
import SGPClient from 'sgp';
const client = new SGPClient({
apiKey: process.env['SGP_API_KEY'], // This is the default and can be omitted
});
const trainingDataset = await client.trainingDatasets.create({
account_id: 'account_id',
file: fs.createReadStream('path/to/file'),
name: 'name',
schema_type: 'GENERATION',
});
console.log(trainingDataset.id);
{
"name": "<string>",
"schema_type": "GENERATION",
"data_source": "S3",
"id": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"account_id": "<string>",
"created_by_user_id": "<string>"
}
Successful Response
The response is of type object
.