import { Agentset } from "agentset";
const agentset = new Agentset({
apiKey: process.env.AGENTSET_API_KEY,
});
const ns = agentset.namespace("YOUR_NAMESPACE_ID");
let job = await ns.ingestion.get("YOUR_JOB_ID");
while (job.status !== "COMPLETED" && job.status !== "FAILED") {
await new Promise((resolve) => setTimeout(resolve, 10000));
job = await ns.ingestion.get("YOUR_JOB_ID");
console.log(`Job status: ${job.status}`);
}
if (job.status === "COMPLETED") {
console.log("Job completed successfully!");
} else {
console.log("Job failed");
}