Commit af1d8470 authored by Timothy J. Baek's avatar Timothy J. Baek
Browse files

fix: disable template variables in prompt

parent 3a2f1d56
...@@ -473,6 +473,8 @@ export const blobToFile = (blob, fileName) => { ...@@ -473,6 +473,8 @@ export const blobToFile = (blob, fileName) => {
}; };
export const promptTemplate = (template: string, prompt: string) => { export const promptTemplate = (template: string, prompt: string) => {
prompt = prompt.replace(/{{prompt}}|{{prompt:start:\d+}}|{{prompt:end:\d+}}/g, '');
template = template.replace(/{{prompt}}/g, prompt); template = template.replace(/{{prompt}}/g, prompt);
// Replace all instances of {{prompt:start:<length>}} with the first <length> characters of the prompt // Replace all instances of {{prompt:start:<length>}} with the first <length> characters of the prompt
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment