fix: correct variable replacement in prompt parsing
This commit is contained in:
@@ -505,7 +505,7 @@ async function translateLLM(text:string, arg:{to:string, from:string, regenerate
|
|||||||
|
|
||||||
let formated:OpenAIChat[] = []
|
let formated:OpenAIChat[] = []
|
||||||
let prompt = db.translatorPrompt || `You are a translator. translate the following html or text into {{slot}}. do not output anything other than the translation.`
|
let prompt = db.translatorPrompt || `You are a translator. translate the following html or text into {{slot}}. do not output anything other than the translation.`
|
||||||
let parsedPrompt = parseChatML(prompt.replaceAll('{{slot::from}}', arg.from).replaceAll('{{slot}}', arg.to).replaceAll('{{solt::content}}', text).replaceAll('{{slot::tnote}}', translatorNote))
|
let parsedPrompt = parseChatML(prompt.replaceAll('{{slot::from}}', arg.from).replaceAll('{{slot}}', arg.to).replaceAll('{{solt::content}}', text).replaceAll('{{solt::content}}', text).replaceAll('{{slot::tnote}}', translatorNote))
|
||||||
if(parsedPrompt){
|
if(parsedPrompt){
|
||||||
formated = parsedPrompt
|
formated = parsedPrompt
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user