donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
40 lines • 1.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MakeCommentTool = exports.MakeCommentGptSchema = exports.MakeCommentCoreSchema = void 0;
const v4_1 = require("zod/v4");
const ToolSchema_1 = require("../models/ToolSchema");
const Logger_1 = require("../utils/Logger");
const Tool_1 = require("./Tool");
exports.MakeCommentCoreSchema = v4_1.z.object({
comment: v4_1.z.string().describe('The comment to make.'),
});
exports.MakeCommentGptSchema = v4_1.z.object({
...ToolSchema_1.BaseGptArgsSchema.shape,
...exports.MakeCommentCoreSchema.shape,
});
/**
* Tool for making a comment during course of the flow.
*/
class MakeCommentTool extends Tool_1.Tool {
constructor() {
super(MakeCommentTool.NAME, 'Make a comment regarding the current page or Donobu flow.', exports.MakeCommentCoreSchema, exports.MakeCommentGptSchema);
}
async call(_context, parameters) {
Logger_1.appLogger.warn(`${this.name} tool is being run without a GPT even though it makes no sense to do so!`);
return {
isSuccessful: true,
forLlm: parameters.comment,
metadata: null,
};
}
async callFromGpt(_context, parameters) {
return {
isSuccessful: true,
forLlm: parameters.comment,
metadata: null,
};
}
}
exports.MakeCommentTool = MakeCommentTool;
MakeCommentTool.NAME = 'makeComment';
//# sourceMappingURL=MakeCommentTool.js.map