@azowl/agentops-sdk
Version:
AgentOps REST client and local task execution SDK for Node.js
22 lines (18 loc) • 600 B
JavaScript
import { LocalAgent } from '@azowl/agentops-sdk/local';
const document = { title: 'Release checklist' };
const agent = new LocalAgent({
profileId: 'read-only',
allowedTools: ['document.read'],
tools: {
'document.read': () => document.title,
'document.update': ({ title }) => {
document.title = title;
return document.title;
},
},
});
const read = await agent.run('document.read', {});
const update = await agent.run('document.update', { title: 'Revised checklist' });
for (const task of [read, update]) {
console.log(JSON.stringify(agent.getReceipt(task.id)));
}