Create a worker template
client.workers.create(WorkerCreateParams { instructions, outputSchema, prompt, 3 more } body, RequestOptionsoptions?): WorkerTemplate { id, createdAt, instructions, 8 more }
POST/api/workers
Create a new worker. The worker is a reusable agent template; tasks are runs against this template. Use POST /tasks to actually run the agent.
Create a worker template
import Handinger from '@ramensoft/handinger';
const client = new Handinger({
apiKey: process.env['HANDINGER_API_KEY'], // This is the default and can be omitted
});
const workerTemplate = await client.workers.create({
prompt: 'A worker that fact-checks short claims and returns a verdict with citations.',
});
console.log(workerTemplate.id);{
"id": "id",
"createdAt": "createdAt",
"instructions": "instructions",
"organizationId": "organizationId",
"outputSchema": {
"foo": "bar"
},
"summary": "summary",
"title": "title",
"updatedAt": "updatedAt",
"url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
"userId": "userId",
"visibility": "public"
}Returns Examples
{
"id": "id",
"createdAt": "createdAt",
"instructions": "instructions",
"organizationId": "organizationId",
"outputSchema": {
"foo": "bar"
},
"summary": "summary",
"title": "title",
"updatedAt": "updatedAt",
"url": "https://v3.handinger.com/worker/wrk_vk81XUHKHG-qr4",
"userId": "userId",
"visibility": "public"
}