donobu
Version:
Create browser automations with an LLM agent and replay them as Playwright scripts.
18 lines • 968 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ChooseSelectOptionTool = void 0;
const ReplayableInteraction_1 = require("./ReplayableInteraction");
class ChooseSelectOptionTool extends ReplayableInteraction_1.ReplayableInteraction {
constructor() {
super(ChooseSelectOptionTool.NAME, 'Choose <option> values for a particular <select> HTML element.', 'SelectorBasedChooseSelectOptionToolParameters', 'AnnotationBasedChooseSelectOptionToolParameters');
}
async invoke(_context, parameters, element) {
const selectedValues = await element.selectOption(parameters.optionValues, {
timeout: 3000,
});
return `Selected the ${selectedValues} value${selectedValues.length > 1 ? 's' : ''} for the <select> element.`;
}
}
exports.ChooseSelectOptionTool = ChooseSelectOptionTool;
ChooseSelectOptionTool.NAME = 'chooseSelectOption';
//# sourceMappingURL=ChooseSelectOptionTool.js.map