Fix user prompt prefix injection
This commit is contained in:
parent
af08f5c99e
commit
833633991a
|
@ -301,7 +301,7 @@ export class ChatRequest {
|
|||
if (m.length) {
|
||||
if (m.match(/\[\[USER_PROMPT\]\]/)) {
|
||||
injectedPrompt = true
|
||||
m.replace(/\[\[USER_PROMPT\]\]/g, lastMessage.content)
|
||||
m = m.replace(/\[\[USER_PROMPT\]\]/g, lastMessage.content)
|
||||
}
|
||||
a.push({ role: a.length % 2 === 0 ? 'user' : 'assistant', content: m } as Message)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue