donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
40 lines • 1.6 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.SummarizeLearningsTool = exports.SummarizeLearningsGptSchema = exports.SummarizeLearningsCoreSchema = 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.SummarizeLearningsCoreSchema = v4_1.z.object({
summary: v4_1.z.string().describe('The summary to make.'),
});
exports.SummarizeLearningsGptSchema = v4_1.z.object({
...ToolSchema_1.BaseGptArgsSchema.shape,
...exports.SummarizeLearningsCoreSchema.shape,
});
/**
* Tool for summarizing learnings made over the course of the flow.
*/
class SummarizeLearningsTool extends Tool_1.Tool {
constructor() {
super(SummarizeLearningsTool.NAME, 'Summarize the learnings made over the course of the Donobu flow.', exports.SummarizeLearningsCoreSchema, exports.SummarizeLearningsGptSchema);
}
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: '',
metadata: null,
};
}
async callFromGpt(_context, parameters) {
return {
isSuccessful: true,
forLlm: parameters.summary,
metadata: null,
};
}
}
exports.SummarizeLearningsTool = SummarizeLearningsTool;
SummarizeLearningsTool.NAME = 'summarizeLearnings';
//# sourceMappingURL=SummarizeLearningsTool.js.map