parent
34e8e242f6
commit
b1282c9562
1 changed files with 13 additions and 0 deletions
|
|
@ -485,6 +485,19 @@ export const placeholdersUtils = {
|
||||||
return regex.test(text);
|
return regex.test(text);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getPlaceholdersAdditionalTextArray(prompt_text){
|
||||||
|
const regex = /{%\s*additional_text(?::(.*?))?\s*%}/g;
|
||||||
|
let matches = [];
|
||||||
|
let match;
|
||||||
|
while ((match = regex.exec(prompt_text)) !== null) {
|
||||||
|
matches.push({
|
||||||
|
placeholder: match[0],
|
||||||
|
info: match[1] ? match[1].trim() : ""
|
||||||
|
});
|
||||||
|
}
|
||||||
|
return matches;
|
||||||
|
},
|
||||||
|
|
||||||
async getPlaceholdersValues(args) {
|
async getPlaceholdersValues(args) {
|
||||||
const {
|
const {
|
||||||
prompt_text = "",
|
prompt_text = "",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue