diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index 60c3e685f..03cbc6262 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -473,6 +473,8 @@ export const blobToFile = (blob, fileName) => { }; export const promptTemplate = (template: string, prompt: string) => { + prompt = prompt.replace(/{{prompt}}|{{prompt:start:\d+}}|{{prompt:end:\d+}}/g, ''); + template = template.replace(/{{prompt}}/g, prompt); // Replace all instances of {{prompt:start:}} with the first characters of the prompt