Node.js & shell¶
The same operations as the Python SDK, for Node.js projects and for the command line.
Node.js (18+)¶
Install it from the beta package:
Save as create_job.mjs and run with node create_job.mjs:
import { PhysicalAI } from "@centific/qc";
const client = new PhysicalAI({
apiKey: process.env.CENTIFIC_API_KEY,
baseUrl: "https://humanoidiq-dev.centific.com",
});
const job = await client.qc.create({
dataset: "./episode_0000.zip",
dataType: "egocentric",
task: "Folding laundry and placing it on a bed",
});
console.log("job id:", job.id);
const report = await job.wait();
console.log(report.verdict, report.score);
await job.savePdf(`${job.id}.pdf`);
import { PhysicalAI } from "@centific/qc";
const client = new PhysicalAI({
apiKey: process.env.CENTIFIC_API_KEY,
baseUrl: "https://humanoidiq-dev.centific.com",
});
const up = await client.qc.upload({
dataset: "./batch_0001.zip",
dataType: "egocentric",
task: "Folding laundry and placing it on a bed",
});
console.log(up.id, up.status); // 'uploaded'
const job = await client.qc.grade(up.id); // within 24 hours
console.log(job.id, job.status); // 'queued'
The other operations work the same way as in Python, with camelCase names:
| Python | Node.js |
|---|---|
client.qc.get(id) |
await client.qc.get(id) |
client.qc.list(limit=10) |
await client.qc.list({ limit: 10 }) |
job.refresh() |
await job.refresh() |
job.report() |
await job.report() |
job.save_pdf(path) |
await job.savePdf(path) |
job.report_pdf() |
await job.reportPdf() |
job.token() |
await job.token() |
job.cancel() |
await job.cancel() |
Shell (bash + curl + jq)¶
qc.sh needs nothing installed beyond bash, curl and jq.
chmod +x qc.sh
export CENTIFIC_API_URL=https://humanoidiq-dev.centific.com
# load your key first: see "Get an API key"
On Windows
Run qc.sh from Git Bash or WSL.