OKAY LISTEN UP YOU ABSOLUTELY PRECIOUS ANGELS WHO'VE NEVER TOUCHED A TERMINAL IN YOUR LIVES:

  1. Go to your SillyTavern's data/default-user/extensions/third-party/noass folder (it's in your SillyTavern folders! You can do it! I believe in you! 🌟)
  2. Find the file called index.js
  3. Right-click it and open it in Notepad or any text editor
  4. Look for this chunk of text:
    ⎗
    ✓
    1
    2
    3
    4
    5
    6
    let chatHistory = messages.slice(1).reduce((history, message, idx) => {
        const timestampDict = { timestamp: getSendDate(idx) };
        let prefix = substituteParamsExtended(message.role === MessageRole.USER ? activeSet.user_prefix : activeSet.char_prefix, timestampDict);
        let suffix = substituteParamsExtended(message.role === MessageRole.USER ? activeSet.user_suffix: activeSet.char_suffix, timestampDict);
        return `${history}${separator}${prefix}${message.content}${suffix}`;
    }, messages[0].content);
    
  5. Delete everything from that chunk until you get to the line if (extension_settings.NoAss.human_prompt_active) (you know how to highlight and press delete, right? Of course you do! You're doing amazing!)
  6. In the empty space you've just created, paste this new chunk:
    ⎗
    ✓
    let lastMessage = null;
    
    // Only separate last assistant message if we're not squashing as assistant
    if (messages[messages.length - 1].role === MessageRole.ASSISTANT &&
        extension_settings.NoAss.squash_role !== MessageRole.ASSISTANT) {
        lastMessage = messages.pop();
    }
    
    // Build chat history from remaining messages
    let chatHistory = messages.slice(1).reduce((history, message, idx) => {
        const timestampDict = { timestamp: getSendDate(idx) };
        let prefix = substituteParamsExtended(message.role === MessageRole.USER ? activeSet.user_prefix : activeSet.char_prefix, timestampDict);
        let suffix = substituteParamsExtended(message.role === MessageRole.USER ? activeSet.user_suffix : activeSet.char_suffix, timestampDict);
        return `${history}${separator}${prefix}${message.content}${suffix}`;
    }, messages[0].content);
    
    if (extension_settings.NoAss.enable_zero_prefill) {
        const pseudoPrefill = separator + substituteParamsExtended(activeSet.char_prefix, {timestamp: getSendDate()});
        chatHistory += (messages[messages.length - 1].role === MessageRole.ASSISTANT ? '' : pseudoPrefill);
    
        if (chatHistory.endsWith("\n") || chatHistory.endsWith(" ")) {
            if (zero_prefill === '') {
                chatHistory = chatHistory.trim();
            } else {
                chatHistory += zero_prefill;
            }
        };
    }
    
    // Replace messages with squashed history
    data.chat.splice(-n, n, {
        role: extension_settings.NoAss.squash_role,
        content: chatHistory
    });
    
    // If we had a last assistant message, add it back
    if (lastMessage) {
        data.chat.push(lastMessage);
    }
    
  7. Save the file
  8. Refresh the page (like turning your phone off and on! See? You're basically a hacker now!)

No scary commands needed! Just copy, paste, and save! 😊

Edit

Pub: 23 Jan 2025 10:30 UTC

Views: 314