mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-03 03:17:54 +01:00
Add nsfw avoidance prompt, quiet prompt and bias to chat completion
This commit is contained in:
parent
37c7a82aba
commit
74a5167a0e
@ -423,6 +423,22 @@ async function prepareOpenAIMessages({
|
||||
}
|
||||
});
|
||||
|
||||
// Insert nsfw avoidance prompt into main, if no nsfw prompt is present
|
||||
if (false === chatCompletion.has('nsfw') && oai_settings.nsfw_avoidance_prompt) {
|
||||
const nsfwAvoidanceMessage = new Message('system', oai_settings.nsfw_avoidance_prompt, 'nsfwAvoidance');
|
||||
chatCompletion.insert(nsfwAvoidanceMessage, 'main');
|
||||
}
|
||||
|
||||
// Insert quiet prompt into main
|
||||
if (quietPrompt) {
|
||||
const quietPromptMessage = new Message('system', quietPrompt, 'quietPrompt');
|
||||
chatCompletion.insert(quietPromptMessage, 'main')
|
||||
}
|
||||
|
||||
if (bias && bias.trim().length) {
|
||||
addMessageToChatCompletion('system', bias, 'main');
|
||||
}
|
||||
|
||||
// Chat History
|
||||
chatCompletion.add(new MessageCollection('chatHistory'), prompts.index('chatHistory'));
|
||||
const mainChat = selected_group ? '[Start a new group chat. Group members: ${names}]' : '[Start a new Chat]';
|
||||
|
Loading…
x
Reference in New Issue
Block a user