Blame Raw
permissionBRICK · 0320ffda · · 157 lines (15.1 KB)
1 contributor
1<div id="memory_settings">
2 <div class="inline-drawer">
3 <div class="inline-drawer-toggle inline-drawer-header">
4 <div class="flex-container alignitemscenter margin0">
5 <b data-i18n="ext_sum_title">Summarize</b>
6 <i id="summaryExtensionPopoutButton" class="fa-solid fa-window-restore menu_button margin0"></i>
7 </div>
8 <div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div>
9 </div>
10 <div class="inline-drawer-content">
11 <div id="summaryExtensionDrawerContents">
12 <label for="summary_source" data-i18n="ext_sum_with">Summarize with:</label>
13 <select id="summary_source" class="text_pole">
14 <option value="main" data-i18n="ext_sum_main_api">Main API</option>
15 <option value="extras">Extras API (deprecated)</option>
16 <option value="webllm" data-i18n="ext_sum_webllm">WebLLM Extension</option>
17 </select><br>
18
19 <div class="flex-container justifyspacebetween alignitemscenter">
20 <span data-i18n="ext_sum_current_summary">Current summary:</span>
21 <i class="editor_maximize fa-solid fa-maximize right_menu_button" data-for="memory_contents" title="Expand the editor" data-i18n="[title]Expand the editor"></i>
22 <span class="flex1">&nbsp;</span>
23 <div id="memory_restore" class="menu_button margin0" data-i18n="[title]ext_sum_restore_tip" title="Restore a previous summary; use repeatedly to clear summarization state for this chat.">
24 <small data-i18n="ext_sum_restore_previous">Restore Previous</small>
25 </div>
26 </div>
27
28 <textarea id="memory_contents" class="text_pole textarea_compact" rows="6" data-i18n="[placeholder]ext_sum_memory_placeholder" placeholder="Summary will be generated here..."></textarea>
29 <div class="memory_contents_controls">
30 <div id="memory_force_summarize" data-summary-source="main,webllm" class="menu_button menu_button_icon" title="Trigger a summary update right now." data-i18n="[title]ext_sum_force_tip">
31 <i class="fa-solid fa-database"></i>
32 <span data-i18n="ext_sum_force_text">Summarize now</span>
33 </div>
34 <label for="memory_frozen" title="Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API)." data-i18n="[title]Disable automatic summary updates. While paused, the summary remains as-is. You can still force an update by pressing the Summarize now button (which is only available with the Main API)."><input id="memory_frozen" type="checkbox" /><span data-i18n="ext_sum_pause">Pause</span></label>
35 <label data-summary-source="main" for="memory_skipWIAN" title="Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN." data-i18n="[title]Omit World Info and Author's Note from text to be summarized. Only has an effect when using the Main API. The Extras API always omits WI/AN.">
36 <input id="memory_skipWIAN" type="checkbox" />
37 <span data-i18n="ext_sum_no_wi_an">No WI/AN</span>
38 </label>
39 </div>
40 <div class="memory_contents_controls">
41 <div id="summarySettingsBlockToggle" class="menu_button menu_button_icon" data-i18n="[title]ext_sum_settings_tip" title="Edit summarization prompt, insertion position, etc.">
42 <i class="fa-solid fa-cog"></i>
43 <span data-i18n="ext_sum_settings">Summary Settings</span>
44 </div>
45 </div>
46 <div id="summarySettingsBlock" style="display:none;">
47 <div data-summary-source="main">
48 <label data-i18n="ext_sum_prompt_builder">
49 Prompt builder
50 </label>
51 <label class="checkbox_label" for="memory_prompt_builder_raw_blocking" data-i18n="[title]ext_sum_prompt_builder_1_desc" title="Extension will build its own prompt using messages that were not summarized yet. Blocks the chat until the summary is generated.">
52 <input id="memory_prompt_builder_raw_blocking" type="radio" name="memory_prompt_builder" value="1" />
53 <span data-i18n="ext_sum_prompt_builder_1">Raw, blocking</span>
54 </label>
55 <label class="checkbox_label" for="memory_prompt_builder_raw_non_blocking" data-i18n="[title]ext_sum_prompt_builder_2_desc" title="Extension will build its own prompt using messages that were not summarized yet. Does not block the chat while the summary is being generated. Not all backends support this mode.">
56 <input id="memory_prompt_builder_raw_non_blocking" type="radio" name="memory_prompt_builder" value="2" />
57 <span data-i18n="ext_sum_prompt_builder_2">Raw, non-blocking</span>
58 </label>
59 <label class="checkbox_label" id="memory_prompt_builder_default" data-i18n="[title]ext_sum_prompt_builder_3_desc" title="Extension will use the regular main prompt builder and add the summary request to it as the last system message.">
60 <input id="memory_prompt_builder_default" type="radio" name="memory_prompt_builder" value="0" />
61 <span data-i18n="ext_sum_prompt_builder_3">Classic, blocking</span>
62 </label>
63 </div>
64 <div data-summary-source="main,webllm">
65 <label for="memory_prompt" class="title_restorable">
66 <span data-i18n="Summary Prompt">Summary Prompt</span>
67 <div id="memory_prompt_restore" data-i18n="[title]ext_sum_restore_default_prompt_tip" title="Restore default prompt" class="right_menu_button">
68 <div class="fa-solid fa-clock-rotate-left"></div>
69 </div>
70 </label>
71 <textarea id="memory_prompt" class="text_pole textarea_compact" rows="6" data-i18n="[placeholder]ext_sum_prompt_placeholder" placeholder="This prompt will be sent to AI to request the summary generation. &lcub;&lcub;words&rcub;&rcub; will resolve to the 'Number of words' parameter."></textarea>
72 <label for="memory_summary_prompt_role" data-i18n="ext_sum_prompt_role">Summary Prompt Role</label>
73 <select id="memory_summary_prompt_role" class="text_pole">
74 <option value="0" data-i18n="System">System</option>
75 <option value="1" data-i18n="User">User</option>
76 </select>
77 <small data-i18n="ext_sum_prompt_role_desc">The role used to send the summary request instruction to the model.</small>
78 <label for="memory_summary_connection_profile" data-i18n="ext_sum_connection_profile">Summary Connection Profile</label>
79 <select id="memory_summary_connection_profile" class="text_pole"></select>
80 <small data-i18n="ext_sum_connection_profile_desc">Summarize with a specific connection profile instead of the active model. Leave empty to use the active model.</small>
81 <label for="memory_prompt_words"><span data-i18n="ext_sum_target_length_1">Target summary length</span> <span data-i18n="ext_sum_target_length_2">(</span><span id="memory_prompt_words_value"></span><span data-i18n="ext_sum_target_length_3"> words)</span></label>
82 <input id="memory_prompt_words" type="range" value="{{defaultSettings.promptWords}}" min="{{defaultSettings.promptMinWords}}" max="{{defaultSettings.promptMaxWords}}" step="{{defaultSettings.promptWordsStep}}" />
83 <label for="memory_override_response_length">
84 <span data-i18n="ext_sum_api_response_length_1">API response length</span> <span data-i18n="ext_sum_api_response_length_2">(</span><span id="memory_override_response_length_value"></span><span data-i18n="ext_sum_api_response_length_3"> tokens)</span>
85 <small class="memory_disabled_hint" data-i18n="ext_sum_0_default">0 = default</small>
86 </label>
87 <input id="memory_override_response_length" type="range" value="{{defaultSettings.overrideResponseLength}}" min="{{defaultSettings.overrideResponseLengthMin}}" max="{{defaultSettings.overrideResponseLengthMax}}" step="{{defaultSettings.overrideResponseLengthStep}}" />
88 <label for="memory_max_messages_per_request">
89 <span data-i18n="ext_sum_raw_max_msg">[Raw/WebLLM] Max messages per request</span> (<span id="memory_max_messages_per_request_value"></span>)
90 <small class="memory_disabled_hint" data-i18n="ext_sum_0_unlimited">0 = unlimited</small>
91 </label>
92 <input id="memory_max_messages_per_request" type="range" value="{{defaultSettings.maxMessagesPerRequest}}" min="{{defaultSettings.maxMessagesPerRequestMin}}" max="{{defaultSettings.maxMessagesPerRequestMax}}" step="{{defaultSettings.maxMessagesPerRequestStep}}" />
93 <h4 data-i18n="Update frequency" class="textAlignCenter">
94 Update frequency
95 </h4>
96 <label for="memory_prompt_interval" class="title_restorable">
97 <span>
98 <span data-i18n="ext_sum_update_every_messages_1">Update every</span> <span id="memory_prompt_interval_value"></span><span data-i18n="ext_sum_update_every_messages_2"> messages</span>
99 <small class="memory_disabled_hint" data-i18n="ext_sum_0_disable">0 = disable</small>
100 </span>
101 <div id="memory_prompt_interval_auto" data-i18n="[title]ext_sum_auto_adjust_desc" title="Try to automatically adjust the interval based on the chat metrics." class="right_menu_button">
102 <div class="fa-solid fa-wand-magic-sparkles"></div>
103 </div>
104 </label>
105 <input id="memory_prompt_interval" type="range" value="{{defaultSettings.promptInterval}}" min="{{defaultSettings.promptMinInterval}}" max="{{defaultSettings.promptMaxInterval}}" step="{{defaultSettings.promptIntervalStep}}" />
106 <label for="memory_prompt_words_force" class="title_restorable">
107 <span>
108 <span data-i18n="ext_sum_update_every_words_1">Update every</span> <span id="memory_prompt_words_force_value"></span><span data-i18n="ext_sum_update_every_words_2"> words</span>
109 <small class="memory_disabled_hint" data-i18n="ext_sum_0_disable">0 = disable</small>
110 </span>
111 <div id="memory_prompt_words_auto" data-i18n="[title]ext_sum_auto_adjust_desc" title="Try to automatically adjust the interval based on the chat metrics." class="right_menu_button">
112 <div class="fa-solid fa-wand-magic-sparkles"></div>
113 </div>
114 </label>
115 <input id="memory_prompt_words_force" type="range" value="{{defaultSettings.promptForceWords}}" min="{{defaultSettings.promptMinForceWords}}" max="{{defaultSettings.promptMaxForceWords}}" step="{{defaultSettings.promptForceWordsStep}}" />
116 <small data-i18n="ext_sum_both_sliders">If both sliders are non-zero, then both will trigger summary updates at their respective intervals.</small>
117 <hr>
118 </div>
119 <div class="memory_template">
120 <label for="memory_template" data-i18n="ext_sum_injection_template">Injection Template</label>
121 <textarea id="memory_template" class="text_pole textarea_compact" rows="2" data-i18n="[placeholder]ext_sum_memory_template_placeholder" placeholder="&lcub;&lcub;summary&rcub;&rcub; will resolve to the current summary contents."></textarea>
122 </div>
123 <label for="memory_position" data-i18n="ext_sum_injection_position">Injection Position</label>
124 <label class="checkbox_label" for="memory_include_wi_scan" data-i18n="[title]ext_sum_include_wi_scan_desc" title="Include the latest summary in the WI scan.">
125 <input id="memory_include_wi_scan" type="checkbox" />
126 <span data-i18n="ext_sum_include_wi_scan">Include in World Info Scanning</span>
127 </label>
128 <div class="radio_group">
129 <label>
130 <input type="radio" name="memory_position" value="-1" />
131 <span data-i18n="None (not injected)">None (not injected)</span>
132 <i class="fa-solid fa-info-circle" title="The summary will not be injected into the prompt. You can still access it via the &lcub;&lcub;summary&rcub;&rcub; macro." data-i18n="[title]ext_sum_injection_position_none"></i>
133 </label>
134 <label>
135 <input type="radio" name="memory_position" value="2" />
136 <span data-i18n="Before Main Prompt / Story String">Before Main Prompt / Story String</span>
137 </label>
138 <label>
139 <input type="radio" name="memory_position" value="0" />
140 <span data-i18n="After Main Prompt / Story String">After Main Prompt / Story String</span>
141 </label>
142 <label class="flex-container alignItemsCenter" title="How many messages before the current end of the chat." data-i18n="[title]How many messages before the current end of the chat.">
143 <input type="radio" name="memory_position" value="1" />
144 <span data-i18n="In-chat @ Depth">In-chat @ Depth</span> <input id="memory_depth" class="text_pole widthUnset" type="number" min="0" max="9999" />
145 <span data-i18n="as">as</span>
146 <select id="memory_role" class="text_pole widthNatural">
147 <option value="0" data-i18n="System">System</option>
148 <option value="1" data-i18n="User">User</option>
149 <option value="2" data-i18n="Assistant">Assistant</option>
150 </select>
151 </label>
152 </div>
153 </div>
154 </div>
155 </div>
156 </div>
157</div>