-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy pathsettings.html
More file actions
424 lines (380 loc) · 24.2 KB
/
Copy pathsettings.html
File metadata and controls
424 lines (380 loc) · 24.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
<div class="sc-settings">
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>🧠 Summaryception</b>
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
</div>
<div class="inline-drawer-content">
<!-- ═══ Enable ═══ -->
<div class="sc-row">
<label class="checkbox_label" for="sc_enabled">
<input type="checkbox" id="sc_enabled" />
<span>Enable Summaryception</span>
</label>
</div>
<!-- ═══ Pause ═══ -->
<div class="sc-row">
<label class="checkbox_label" for="sc_pause_summarization">
<input type="checkbox" id="sc_pause_summarization" />
<span>Pause Summarization</span>
<small class="sc-hint">Stop processing new turns while keeping existing summaries injected. Preserves prompt cache hits. Unpause or use Force Summarize to catch up.</small>
</label>
</div>
<!-- ═══ Stop hiding verbatim turns ═══ -->
<label class="checkbox_label" for="sc_disable_ghosting">
<input type="checkbox" id="sc_disable_ghosting" />
<span>Disable Message Hiding</span>
<small class="sc-hint">Messages will still be summarized and excluded from LLM context, but won't be visually hidden. Useful for compatibility with other extensions (QVink, MemoryBooks, etc.).</small>
</label>
<!-- ═══ Actions ═══ -->
<div class="sc-button-row">
<button id="sc_force_summarize" class="menu_button">
<i class="fa-solid fa-bolt"></i> Force Summarize Now
</button>
<button id="sc_stop_summarize" class="menu_button menu_button_danger">
<i class="fa-solid fa-stop"></i> Stop
</button>
<button id="sc_repair" class="menu_button">
<i class="fa-solid fa-wrench"></i> Repair Orphans
</button>
</div>
<hr class="sc-divider" />
<!-- ═══ Snippet Browser ═══ -->
<h4 class="sc-section-title">🗂️ Snippet Browser</h4>
<div id="sc_snippet_browser" class="sc-snippet-browser"></div>
<hr class="sc-divider" />
<!-- ═══ Preview ═══ -->
<h4 class="sc-section-title">👁️ Injection Preview</h4>
<textarea id="sc_preview" class="text_pole sc-textarea sc-preview" rows="6" readonly></textarea>
<div class="sc-button-row">
<button id="sc_refresh_preview" class="menu_button">
<i class="fa-solid fa-rotate"></i> Refresh
</button>
</div>
<div class="sc-button-row">
<button id="sc_import" class="menu_button">
<i class="fa-solid fa-download"></i> Import Memory
</button>
<button id="sc_export" class="menu_button">
<i class="fa-solid fa-upload"></i> Export Memory
</button>
<button id="sc_clear_memory" class="menu_button menu_button_danger">
<i class="fa-solid fa-trash"></i> Clear Memory
</button>
</div>
<hr class="sc-divider" />
<!-- ═══ Layer Stats ═══ -->
<h4 class="sc-section-title">📊 Layer Stats</h4>
<div id="sc_layer_stats" class="sc-stats-box"></div>
<hr class="sc-divider" />
<!-- ═══ Advanced Settings ═══ -->
<div class="inline-drawer">
<div class="inline-drawer-toggle inline-drawer-header">
<b>⚙️ Advanced Settings</b>
<div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
</div>
<div class="inline-drawer-content">
<!-- ═══════════════════════════════════════════════════════════════════
Summarizer Connection Settings
Insert this inside the Advanced Settings inline-drawer-content
═══════════════════════════════════════════════════════════════════ -->
<div id="summaryception_connection_settings" class="summaryception-connection-section">
<hr class="sysHR">
<div class="summaryception-section-header">
<span class="fa-solid fa-bolt"></span>
<span>Summarizer Connection</span>
</div>
<small class="summaryception-help-text">
Choose which LLM connection to use for summarization. Use a cheaper/faster model
to save costs while keeping your main API for RP.
</small>
<div class="summaryception-setting-row">
<label for="sc_summarizer_response_length">
<span>Summarizer Response Length</span>
<small>Override max response tokens for summarizer calls (Default/Profile modes). 0 = use your preset's value. If you get "max_tokens > 4096 must have stream=true" errors, set to 4096. For reasoning models, ensure this is high enough for thinking + output.</small>
</label>
<input id="sc_summarizer_response_length" type="number" class="text_pole" min="0" step="100" value="0" placeholder="0 = use preset default" />
</div>
<!-- Connection Source Selector -->
<div class="summaryception-setting-row">
<label for="summaryception_connection_source">
<span>Connection Source</span>
</label>
<select id="summaryception_connection_source" class="text_pole">
<option value="default">Default (Main API)</option>
<option value="profile">Connection Profile</option>
<option value="ollama">Ollama (Local)</option>
<option value="openai">OpenAI Compatible</option>
</select>
</div>
<!-- ── Connection Profile Sub-panel ── -->
<div id="summaryception_profile_settings" class="summaryception-sub-panel" style="display: none;">
<div class="summaryception-setting-row">
<label for="summaryception_connection_profile">
<span>Connection Profile</span>
</label>
<select id="summaryception_connection_profile" class="text_pole">
<option value="">-- Select a Profile --</option>
</select>
</div>
<div class="summaryception-note">
<span class="fa-solid fa-info-circle"></span>
<small>
Uses a saved SillyTavern Connection Profile. Includes endpoint, API key, model, and presets.
Requires ST 1.12.4+. For full API key support, use staging (March 2026+).
⚠️ Connection Profiles inject preset formatting into summary requests, which may degrade summary quality.
⚠️ Consider using Default or OpenAI Compatible instead.
</small>
</div>
</div>
<!-- ── Ollama Sub-panel ── -->
<div id="summaryception_ollama_settings" class="summaryception-sub-panel" style="display: none;">
<div class="summaryception-setting-row">
<label for="summaryception_ollama_url">
<span>Ollama URL</span>
</label>
<input id="summaryception_ollama_url" type="text" class="text_pole"
placeholder="http://localhost:11434" />
</div>
<div class="summaryception-setting-row">
<label for="summaryception_ollama_model">
<span>Model</span>
</label>
<div class="summaryception-input-group">
<select id="summaryception_ollama_model" class="text_pole">
<option value="">-- Select Model --</option>
</select>
<div id="summaryception_ollama_refresh"
class="menu_button menu_button_icon"
title="Refresh model list from Ollama">
<span class="fa-solid fa-arrows-rotate"></span>
</div>
</div>
</div>
<div class="summaryception-note">
<span class="fa-solid fa-info-circle"></span>
<small>
Connects to a local Ollama instance. Requires <code>enableCorsProxy: true</code> in
your SillyTavern <code>config.yaml</code>, OR set the <code>OLLAMA_ORIGINS=*</code>
environment variable on your Ollama instance.
</small>
</div>
</div>
<!-- ── OpenAI Compatible Sub-panel ── -->
<div id="summaryception_openai_settings" class="summaryception-sub-panel" style="display: none;">
<div class="summaryception-setting-row">
<label for="summaryception_openai_url">
<span>Endpoint URL</span>
</label>
<input id="summaryception_openai_url" type="text" class="text_pole"
placeholder="http://localhost:1234/v1 or https://openrouter.ai/api/v1" />
</div>
<div class="summaryception-setting-row">
<label for="summaryception_openai_key">
<span>API Key</span>
</label>
<input id="summaryception_openai_key" type="password" class="text_pole"
placeholder="(optional, for cloud services)" autocomplete="off" />
</div>
<div class="summaryception-setting-row">
<label for="summaryception_openai_model">
<span>Model Name</span>
</label>
<input id="summaryception_openai_model" type="text" class="text_pole"
placeholder="e.g. gpt-4o-mini, llama-3.1-8b" />
</div>
<div class="summaryception-setting-row">
<label for="summaryception_openai_max_tokens">
<span>Max Tokens</span>
</label>
<input id="summaryception_openai_max_tokens" type="number" class="text_pole"
min="0" step="100" placeholder="0 = no limit (provider default)" />
</div>
<div class="summaryception-setting-row">
<div id="summaryception_openai_test"
class="menu_button menu_button_icon"
title="Test the OpenAI-compatible connection">
<span class="fa-solid fa-plug-circle-check"></span>
<span>Test Connection</span>
</div>
</div>
<div class="summaryception-note">
<span class="fa-solid fa-info-circle"></span>
<small>
Works with LM Studio, KoboldCPP, vLLM, text-generation-webui, OpenRouter, or any
OpenAI-compatible endpoint. Enter the base URL up to <code>/v1</code>
(e.g. <code>http://localhost:1234/v1</code>).
Local endpoints require <code>enableCorsProxy: true</code> in <code>config.yaml</code>.
Cloud APIs (OpenRouter, etc.) work without the proxy.
</small>
</div>
</div>
<!-- Connection Status Indicator -->
<div id="summaryception_connection_status" class="summaryception-connection-status" style="display: none;">
<span id="summaryception_connection_status_icon" class="fa-solid fa-circle"></span>
<span id="summaryception_connection_status_text"></span>
</div>
</div>
<!-- Turn Settings -->
<h4 class="sc-section-title">📖 Verbatim Turn Settings</h4>
<div class="sc-row">
<label for="sc_verbatim_turns">
<span>Verbatim Assistant Turns to Keep</span>
<small class="sc-hint">Recent assistant turns sent word-for-word. Older ones are summarized.</small>
</label>
<div class="sc-slider-row">
<input type="range" id="sc_verbatim_turns" min="1" max="50" step="1" />
<span id="sc_verbatim_turns_val" class="sc-val">10</span>
</div>
</div>
<div class="sc-row">
<label for="sc_turns_per_summary">
<span>Turns per Summary Batch</span>
<small class="sc-hint">When limit is exceeded, this many oldest turns are summarized together into one snippet.</small>
</label>
<div class="sc-slider-row">
<input type="range" id="sc_turns_per_summary" min="1" max="20" step="1" />
<span id="sc_turns_per_summary_val" class="sc-val">3</span>
</div>
</div>
<hr class="sc-divider" />
<!-- Layer Settings -->
<h4 class="sc-section-title">🔄 Layer Settings (the "ception")</h4>
<div class="sc-row">
<label for="sc_snippets_per_layer">
<span>Max Snippets per Layer</span>
<small class="sc-hint">When exceeded, oldest snippets are promoted (re-summarized) into a deeper layer.</small>
</label>
<div class="sc-slider-row">
<input type="range" id="sc_snippets_per_layer" min="3" max="100" step="1" />
<span id="sc_snippets_per_layer_val" class="sc-val">20</span>
</div>
</div>
<div class="sc-row">
<label for="sc_snippets_per_promotion">
<span>Snippets per Promotion</span>
<small class="sc-hint">How many oldest snippets merge together when promoting to the next layer.</small>
</label>
<div class="sc-slider-row">
<input type="range" id="sc_snippets_per_promotion" min="2" max="20" step="1" />
<span id="sc_snippets_per_promotion_val" class="sc-val">2</span>
</div>
</div>
<div class="sc-row">
<label for="sc_max_layers">
<span>Maximum Layer Depth</span>
<small class="sc-hint">How many recursive layers of summarization are allowed.</small>
</label>
<div class="sc-slider-row">
<input type="range" id="sc_max_layers" min="1" max="10" step="1" />
<span id="sc_max_layers_val" class="sc-val">5</span>
</div>
</div>
<hr class="sc-divider" />
<!-- Prompts -->
<h4 class="sc-section-title">✏️ Summarizer Prompts</h4>
<div class="sc-row">
<label for="sc_summarizer_system_prompt">
<span>System Prompt</span>
</label>
<textarea id="sc_summarizer_system_prompt" class="text_pole sc-textarea" rows="3"></textarea>
</div>
<div class="sc-setting-item">
<label for="sc_prompt_preset">
<small>Prompt Preset</small>
</label>
<select id="sc_prompt_preset" class="text_pole">
<option value="narrative">Narrative State (Default)</option>
<option value="gamestate">Game State</option>
<option value="custom">Custom</option>
</select>
</div>
<!-- Custom Prompt Management -->
<div id="sc_custom_prompt_manager" class="sc-custom-prompt-manager" style="display: none;">
<div class="sc-custom-prompt-row">
<div class="sc-custom-prompt-slots">
<label for="sc_custom_prompt_slot">
<small>Saved Custom Prompts</small>
</label>
<div class="sc-custom-prompt-slot-row">
<select id="sc_custom_prompt_slot" class="text_pole">
<option value="">-- Load a saved prompt --</option>
</select>
<button id="sc_custom_prompt_load" class="menu_button" title="Load selected prompt">
<i class="fa-solid fa-folder-open"></i>
</button>
<button id="sc_custom_prompt_delete_slot" class="menu_button menu_button_danger" title="Delete selected prompt">
<i class="fa-solid fa-trash"></i>
</button>
</div>
</div>
<div class="sc-custom-prompt-actions">
<div class="sc-custom-prompt-save-row">
<input id="sc_custom_prompt_name" type="text" class="text_pole" placeholder="Prompt name..." />
<button id="sc_custom_prompt_save" class="menu_button" title="Save current prompt">
<i class="fa-solid fa-floppy-disk"></i> Save
</button>
</div>
<div class="sc-custom-prompt-io-row">
<button id="sc_custom_prompt_export" class="menu_button" title="Export current prompt as .txt">
<i class="fa-solid fa-file-export"></i> Export
</button>
<button id="sc_custom_prompt_import" class="menu_button" title="Import prompt from .txt">
<i class="fa-solid fa-file-import"></i> Import
</button>
</div>
</div>
</div>
</div>
<div class="sc-row">
<label for="sc_summarizer_user_prompt">
<span>User Prompt (Turn → Snippet & Layer Promotion)</span>
<small class="sc-hint">
Variables: <code>{{player_name}}</code> <code>{{context_str}}</code> (that layer's existing snippets) <code>{{story_txt}}</code> (passage to summarize)
</small>
</label>
<textarea id="sc_summarizer_user_prompt" class="text_pole sc-textarea sc-textarea-tall" rows="10"></textarea>
</div>
<div class="sc-row">
<label for="sc_injection_template">
<span>Injection Wrapper Template</span>
<small class="sc-hint">Wraps the assembled block. Use <code>{{summary}}</code> for the combined text.</small>
</label>
<textarea id="sc_injection_template" class="text_pole sc-textarea" rows="3"></textarea>
</div>
<hr class="sc-divider" />
<!-- Strip Patterns -->
<div class="sc-row">
<label for="sc_strip_patterns">
<span>Strip Patterns (one per line)</span>
<small class="sc-hint">Tags and prefixes to remove from summarizer output. Handles reasoning model artifacts.</small>
</label>
<textarea id="sc_strip_patterns" class="text_pole sc-textarea" rows="4"></textarea>
</div>
<hr class="sc-divider" />
<!-- Debug -->
<div class="sc-row">
<label class="checkbox_label" for="sc_debug_mode">
<input type="checkbox" id="sc_debug_mode" />
<span>Debug Mode (verbose console logs)</span>
</label>
</div>
<div class="sc-row">
<label class="checkbox_label" for="sc_trace_mode">
<input type="checkbox" id="sc_trace_mode" />
<span>Trace Mode (detailed flow logs)</span>
</label>
<small class="sc-hint">Requires Debug Mode to be enabled.</small>
</div>
<hr class="sc-divider" />
<!-- Reset defaults -->
<div class="sc-button-row">
<button id="sc_reset_defaults" class="menu_button">
<i class="fa-solid fa-arrow-rotate-left"></i> Reset to Defaults
</button>
</div>
</div>
</div>
</div>
</div>
</div>