mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-15 22:05:19 +00:00
fix: disable template variables in prompt
This commit is contained in:
parent
3a2f1d56c8
commit
af1d8470cd
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue