v4.1.1: Fix livestream AI message detection, fix OpenAI/Ollama settings persistence, add configurable wait times

This commit is contained in:
Spicy_Marinara 2026-01-13 14:24:51 +01:00
parent c9fdbc1b55
commit 3d7182395a
4 changed files with 89 additions and 8 deletions

View file

@ -3,10 +3,12 @@
> **Bring your stories and conversations to life with a dynamic, AI-powered audience.**
🆕 ***ver4.1.0*** (Credit: [SpicyMarinara](https://github.com/SpicyMarinara))
- Added Livestream mode. Instead of displaying the entire chat feed at once, simulate a "livestream" by showing messages appear in the panel over time.
- Added AO3/Wattpad style.
- Minor bug fixes.
## 🆕 What's New
### ***ver4.1.1***
- Fixed Generate Upon Receiving A New Message for Livestream triggering upon switching chats and starting new ones.
- Fixed OpenAI/Ollama URL and model settings not being saved.
- You can now edit timeframes from Livestream mode.
![Version](https://img.shields.io/badge/SillyTavern-v1.12%2B-blue)
![License](https://img.shields.io/badge/License-MIT-green)

View file

@ -42,6 +42,8 @@
livestream: false,
livestreamBatchSize: 20,
livestreamMode: 'manual',
livestreamMinWait: 5,
livestreamMaxWait: 60,
custom_styles: {},
deleted_styles: []
};
@ -306,9 +308,11 @@
setDiscordText(newContent);
// Schedule next message with random delay between 5-60 seconds
// Schedule next message with random delay between user-configured min/max seconds
const minWait = (settings.livestreamMinWait || 5) * 1000;
const maxWait = (settings.livestreamMaxWait || 60) * 1000;
const randomValue = Math.random();
const delay = randomValue * (60000 - 5000) + 5000; // 5-60 seconds in ms
const delay = randomValue * (maxWait - minWait) + minWait;
log('Next livestream message in', (delay / 1000).toFixed(1), 'seconds (random:', randomValue.toFixed(3), '). Queue:', livestreamQueue.length, 'remaining');
livestreamTimer = setTimeout(() => displayNextLivestreamMessage(), delay);
@ -838,6 +842,8 @@ STRICTLY follow the format defined in the instruction. ${isNarratorStyle ? '' :
// Livestream settings
jQuery('#discord_livestream').prop('checked', settings.livestream || false);
jQuery('#discord_livestream_batch_size').val(settings.livestreamBatchSize || 20);
jQuery('#discord_livestream_min_wait').val(settings.livestreamMinWait || 5);
jQuery('#discord_livestream_max_wait').val(settings.livestreamMaxWait || 60);
jQuery('#discord_livestream_settings').toggle(settings.livestream || false);
// Set livestream mode radio button
@ -2062,6 +2068,41 @@ username: message
log('Selected connection profile:', settings.preset);
});
// OpenAI Compatible - URL
jQuery('#discord_openai_url').on('change', function () {
settings.openai_url = jQuery(this).val();
saveSettings();
log('OpenAI URL:', settings.openai_url);
});
// OpenAI Compatible - Model
jQuery('#discord_openai_model').on('change', function () {
settings.openai_model = jQuery(this).val();
saveSettings();
log('OpenAI Model:', settings.openai_model);
});
// OpenAI Compatible - Preset
jQuery('#discord_openai_preset').on('change', function () {
settings.openai_preset = jQuery(this).val();
saveSettings();
log('OpenAI Preset:', settings.openai_preset);
});
// Ollama - URL
jQuery('#discord_url').on('change', function () {
settings.url = jQuery(this).val();
saveSettings();
log('Ollama URL:', settings.url);
});
// Ollama - Model selection
jQuery('#discord_model_select').on('change', function () {
settings.model = jQuery(this).val();
saveSettings();
log('Ollama Model:', settings.model);
});
// Include User Input toggle
jQuery('#discord_include_user').on('change', function () {
settings.includeUserInput = jQuery(this).prop('checked');
@ -2117,6 +2158,20 @@ username: message
log('Livestream batch size:', settings.livestreamBatchSize);
});
// Livestream minimum wait time
jQuery('#discord_livestream_min_wait').on('change', function () {
settings.livestreamMinWait = parseInt(jQuery(this).val()) || 5;
saveSettings();
log('Livestream min wait:', settings.livestreamMinWait);
});
// Livestream maximum wait time
jQuery('#discord_livestream_max_wait').on('change', function () {
settings.livestreamMaxWait = parseInt(jQuery(this).val()) || 60;
saveSettings();
log('Livestream max wait:', settings.livestreamMaxWait);
});
// Livestream mode radio buttons
jQuery('input[name=\"discord_livestream_mode\"]').on('change', function () {
settings.livestreamMode = jQuery(this).val();
@ -2196,6 +2251,13 @@ username: message
// Don't auto-generate if we're currently loading/switching chats
if (isLoadingChat) return;
// Only trigger on AI character messages, not user messages
const lastMessage = ctx.chat[ctx.chat.length - 1];
if (!lastMessage || lastMessage.is_user) {
// This is a user message or no message - don't auto-generate
return;
}
// Determine if we should auto-generate
let shouldAutoGenerate = false;

View file

@ -6,7 +6,7 @@
"js": "index.js",
"css": "style.css",
"author": "Antigravity",
"version": "4.1.0",
"version": "4.1.1",
"homePage": "https://github.com/mattjaybe/SillyTavern-EchoChamber",
"auto_update": true
}

View file

@ -219,6 +219,23 @@
style="width: 80px; font-size: 0.85em;" title="Number of messages to generate per batch">
</div>
<!-- Wait Time Range -->
<div style="margin-bottom: 10px;">
<label for="discord_livestream_min_wait" style="font-size: 0.8em; opacity: 0.8; display: block; margin-bottom: 4px;">
<i class="fa-solid fa-clock" style="width: 14px;"></i> Minimum Wait Time (seconds):
</label>
<input id="discord_livestream_min_wait" type="number" class="text_pole" min="1" max="120" value="5"
style="width: 80px; font-size: 0.85em;" title="Minimum seconds to wait between messages">
</div>
<div style="margin-bottom: 10px;">
<label for="discord_livestream_max_wait" style="font-size: 0.8em; opacity: 0.8; display: block; margin-bottom: 4px;">
<i class="fa-solid fa-clock" style="width: 14px;"></i> Maximum Wait Time (seconds):
</label>
<input id="discord_livestream_max_wait" type="number" class="text_pole" min="1" max="300" value="60"
style="width: 80px; font-size: 0.85em;" title="Maximum seconds to wait between messages">
</div>
<!-- Generation Mode -->
<div style="margin-bottom: 8px;">
<label style="font-size: 0.8em; opacity: 0.8; display: block; margin-bottom: 6px;">
@ -259,7 +276,7 @@
</button>
</div>
<div style="text-align: center; margin-top: 8px; font-size: 0.75em; opacity: 0.5; font-family: monospace;">
v4.1.0
v4.1.1
</div>
<input type="file" id="discord_import_file" accept=".md" style="display:none;">
</div>