mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Deduplicate code for substitution in the story and the first message
This commit is contained in:
@ -148,10 +148,6 @@ function setOpenAIMessages(chat) {
|
||||
// clean openai msgs
|
||||
openai_msgs = [];
|
||||
for (let i = chat.length - 1; i >= 0; i--) {
|
||||
// first greeting message
|
||||
if (j == 0) {
|
||||
chat[j]['mes'] = substituteParams(chat[j]['mes']);
|
||||
}
|
||||
let role = chat[j]['is_user'] ? 'user' : 'assistant';
|
||||
let content = chat[j]['mes'];
|
||||
|
||||
|
Reference in New Issue
Block a user