mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-13 16:04:05 +09:00
Fix user prompt prefix injection
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user