donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
39 lines • 1.73 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AcknowledgeUserInstructionTool = exports.AcknowledgeUserInstructionGptSchema = exports.AcknowledgeUserInstructionCoreSchema = void 0;
const v4_1 = require("zod/v4");
const ToolSchema_1 = require("../models/ToolSchema");
const Tool_1 = require("./Tool");
exports.AcknowledgeUserInstructionCoreSchema = v4_1.z.object({
userInstruction: v4_1.z
.string()
.describe('The instruction from the user to acknowledge.'),
});
exports.AcknowledgeUserInstructionGptSchema = v4_1.z.object({
...ToolSchema_1.BaseGptArgsSchema.shape,
...exports.AcknowledgeUserInstructionCoreSchema.shape,
});
/**
* A special placeholder tool for acknowledging an instruction from a user.
* This tool is actually never called by anyone (including an LLM). It is just
* used as a stub for remembering when a user interrupted a flow to add more
* context for the LLM to act on.
*/
class AcknowledgeUserInstructionTool extends Tool_1.Tool {
constructor() {
super(AcknowledgeUserInstructionTool.NAME, 'Acknowledge an instruction from a user that Donobu must heed.', exports.AcknowledgeUserInstructionCoreSchema, exports.AcknowledgeUserInstructionGptSchema);
}
async call(_context, parameters) {
return {
isSuccessful: true,
forLlm: parameters.userInstruction,
metadata: null,
};
}
async callFromGpt(context, parameters) {
return this.call(context, parameters);
}
}
exports.AcknowledgeUserInstructionTool = AcknowledgeUserInstructionTool;
AcknowledgeUserInstructionTool.NAME = 'acknowledgeUserInstruction';
//# sourceMappingURL=AcknowledgeUserInstruction.js.map