donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
26 lines • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.TriggerDonobuFlowTool = void 0;
const Tool_1 = require("./Tool");
class TriggerDonobuFlowTool extends Tool_1.Tool {
constructor() {
super(TriggerDonobuFlowTool.NAME, `Trigger a new Donobu flow. Note that the new flow will only have the specific context given via the
"donobuFlowParameters" field and runs in its own distinct browser environment, so be detailed when
specifying this data! Critical fields are "targetWebsite", "overallObjective", and "resultJsonSchema".
The other fields may be ignored if they are not relevant to the flow.`, 'TriggerDonobuFlowToolCoreParameters', 'TriggerDonobuFlowToolGptParameters');
}
async call(context, parameters) {
const flowHandle = await context.flowsManager.createFlow(parameters.donobuFlowParameters);
return {
isSuccessful: true,
forLlm: `Successfully triggered a new Donobu flow with ID: ${flowHandle.donobuFlow.metadata.id}`,
metadata: flowHandle.donobuFlow.metadata,
};
}
async callFromGpt(context, parameters) {
return this.call(context, parameters);
}
}
exports.TriggerDonobuFlowTool = TriggerDonobuFlowTool;
TriggerDonobuFlowTool.NAME = 'triggerDonobuFlow';
//# sourceMappingURL=TriggerDonobuFlowTool.js.map