- Issue created by @mandclu
- 🇨🇦Canada mandclu
I got this working in a way I'm happy with, but I doubt it's the intended route, since I had to modify the Javascript.
I used this as the message:
Suggest three SEO friendly titles for this page based off of the following content in 10 words or less, in the same language as the input: {input}
Then, I had to change the Javascript to parse the values from a single string. This is my updated code for updateSelectField:
// Handle select fields updates. function updateSelectField(targetField, action, value, button) { if (typeof value === 'object') { value = Object.values(value); } var $formWrapper = button.closest('.form-wrapper'); $formWrapper.find('.augmentor-select').remove(); $formWrapper.append('<select class="form-element form-element--type-select augmentor-select"></select>'); var $augmentorSelect = $formWrapper.find('.augmentor-select'); const regexNumbered = /\d\. "(.*?)"/gim; for (const match of value[0].matchAll(regexNumbered)) { var option = stripHtml(match[1]); generateOption($augmentorSelect, option); } $augmentorSelect.on('change', function () { updateCkeditorField(targetField, action, this.value); updateSimpleField(targetField, action, this.value); }); $augmentorSelect.trigger('change'); $augmentorSelect.focus(); }
Notice the use of regex to find all the matches.
- 🇨🇦Canada mandclu
I believe I have gotten closer to understanding how this is meant to work, by setting the N value in the Augmentor to the number of options you want created. The problem I'm having with this approach is that all the options are identical:
I've tried (alternately) changing the values for temperature and top_p, but neither seems to fix it. Also, the value gets populated enclosed in quotes, even when I specify in my prompt that I don't want the result returned enclosed in quotes.
I'm thinking about making a new Select Regex widget type, that would allow a site builder to provide a regex string that would be used to parse out multiple options from a single result.
- Status changed to Closed: works as designed
11 months ago 6:10am 29 April 2024 - 🇯🇵Japan eleonel Itoshima 🇯🇵
The "Select Regex widget type" was implemented and merged into the stable releases by @mandclu so we can close this.