mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
Fix #194
This commit is contained in:
@@ -130,10 +130,12 @@ export class ChatRequest {
|
|||||||
// throw new Error('Image prompt:' + im[7])
|
// throw new Error('Image prompt:' + im[7])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const includedRoles = ['user', 'assistant'].concat(chatSettings.useSystemPrompt ? ['system'] : [])
|
||||||
|
|
||||||
// Submit only the role and content of the messages, provide the previous messages as well for context
|
// Submit only the role and content of the messages, provide the previous messages as well for context
|
||||||
const messageFilter = (m:Message) => !m.suppress &&
|
const messageFilter = (m:Message) => !m.suppress &&
|
||||||
['user', 'assistant', 'system'].includes(m.role) &&
|
includedRoles.includes(m.role) &&
|
||||||
m.content && !m.summarized
|
m.content && !m.summarized
|
||||||
const filtered = messages.filter(messageFilter)
|
const filtered = messages.filter(messageFilter)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user