| 1 | <div class="vectors_settings"> |
| 2 | <div class="inline-drawer"> |
| 3 | <div class="inline-drawer-toggle inline-drawer-header"> |
| 4 | <b data-i18n="Vector Storage">Vector Storage</b> |
| 5 | <div class="inline-drawer-icon fa-solid fa-circle-chevron-down down"></div> |
| 6 | </div> |
| 7 | <div class="inline-drawer-content"> |
| 8 | <div class="flex-container flexFlowColumn"> |
| 9 | <label for="vectors_source" data-i18n="Vectorization Source"> |
| 10 | Vectorization Source |
| 11 | </label> |
| 12 | <select id="vectors_source" class="text_pole"> |
| 13 | <option value="chutes">Chutes</option> |
| 14 | <option value="workers_ai">Cloudflare Workers AI</option> |
| 15 | <option value="cohere">Cohere</option> |
| 16 | <option value="electronhub">Electron Hub</option> |
| 17 | <option value="extras">Extras (deprecated)</option> |
| 18 | <option value="palm">Google AI Studio</option> |
| 19 | <option value="vertexai">Google Vertex AI</option> |
| 20 | <option value="koboldcpp">KoboldCpp</option> |
| 21 | <option value="llamacpp">llama.cpp</option> |
| 22 | <option value="transformers" data-i18n="Local (Transformers)">Local (Transformers)</option> |
| 23 | <option value="mistral">MistralAI</option> |
| 24 | <option value="nanogpt">NanoGPT</option> |
| 25 | <option value="nomicai">NomicAI</option> |
| 26 | <option value="ollama">Ollama</option> |
| 27 | <option value="openai">OpenAI</option> |
| 28 | <option value="openrouter">OpenRouter</option> |
| 29 | <option value="siliconflow">SiliconFlow</option> |
| 30 | <option value="togetherai">TogetherAI</option> |
| 31 | <option value="vllm">vLLM</option> |
| 32 | <option value="webllm" data-i18n="WebLLM Extension">WebLLM Extension</option> |
| 33 | </select> |
| 34 | </div> |
| 35 | <div class="flex-container flexFlowColumn" id="chutes_vectorsModel"> |
| 36 | <label for="vectors_chutes_model" data-i18n="Vectorization Model"> |
| 37 | Vectorization Model |
| 38 | </label> |
| 39 | <select id="vectors_chutes_model" class="text_pole"></select> |
| 40 | <i data-i18n="Hint: Set your Chutes API key in API Connections."> |
| 41 | Hint: Set your Chutes API key in API Connections. |
| 42 | </i> |
| 43 | </div> |
| 44 | <div class="flex-container flexFlowColumn" id="nanogpt_vectorsModel"> |
| 45 | <label for="vectors_nanogpt_model" data-i18n="Vectorization Model"> |
| 46 | Vectorization Model |
| 47 | </label> |
| 48 | <select id="vectors_nanogpt_model" class="text_pole"></select> |
| 49 | <i data-i18n="Hint: Set your NanoGPT API key in API Connections."> |
| 50 | Hint: Set your NanoGPT API key in API Connections. |
| 51 | </i> |
| 52 | </div> |
| 53 | <div class="flex-container flexFlowColumn" id="electronhub_vectorsModel"> |
| 54 | <label for="vectors_electronhub_model" data-i18n="Vectorization Model"> |
| 55 | Vectorization Model |
| 56 | </label> |
| 57 | <select id="vectors_electronhub_model" class="text_pole"></select> |
| 58 | <i data-i18n="Hint: Set your Electron Hub API key in API Connections."> |
| 59 | Hint: Set your Electron Hub API key in API Connections. |
| 60 | </i> |
| 61 | </div> |
| 62 | <div class="flex-container flexFlowColumn" id="vector_altEndpointUrl"> |
| 63 | <label class="checkbox_label" for="vector_altEndpointUrl_enabled" title="Enable secondary endpoint URL usage, instead of the main one."> |
| 64 | <input id="vector_altEndpointUrl_enabled" type="checkbox" class="checkbox"> |
| 65 | <span data-i18n="Use secondary URL">Use secondary URL</span> |
| 66 | </label> |
| 67 | <label for="vector_altEndpoint_address" data-i18n="Secondary Embedding endpoint URL"> |
| 68 | Secondary Embedding endpoint URL |
| 69 | </label> |
| 70 | <input id="vector_altEndpoint_address" class="text_pole" type="text" placeholder="e.g. http://localhost:5001" /> |
| 71 | </div> |
| 72 | <div class="flex-container flexFlowColumn" id="webllm_vectorsModel"> |
| 73 | <label for="vectors_webllm_model" data-i18n="Vectorization Model"> |
| 74 | Vectorization Model |
| 75 | </label> |
| 76 | <div class="flex-container"> |
| 77 | <select id="vectors_webllm_model" class="text_pole flex1"> |
| 78 | </select> |
| 79 | <div id="vectors_webllm_load" class="menu_button menu_button_icon" title="Verify and load the selected model."> |
| 80 | <i class="fa-solid fa-check-to-slot"></i> |
| 81 | </div> |
| 82 | </div> |
| 83 | <div> |
| 84 | Requires the WebLLM extension to be installed. Click <a href="#" id="vectors_webllm_install">here</a> to install. |
| 85 | </div> |
| 86 | </div> |
| 87 | <div class="flex-container flexFlowColumn" id="ollama_vectorsModel"> |
| 88 | <label for="vectors_ollama_model" data-i18n="Vectorization Model"> |
| 89 | Vectorization Model |
| 90 | </label> |
| 91 | <input id="vectors_ollama_model" class="text_pole" type="text" placeholder="Model tag, e.g. llama3" /> |
| 92 | <label for="vectors_ollama_keep" class="checkbox_label" title="When checked, the model will not be unloaded after use."> |
| 93 | <input id="vectors_ollama_keep" type="checkbox" /> |
| 94 | <span data-i18n="Keep model in memory">Keep model in memory</span> |
| 95 | </label> |
| 96 | <div> |
| 97 | The model must be downloaded first! Do it with the <code>ollama pull</code> command or <a href="#" id="vectors_ollama_pull">click here</a>. |
| 98 | </div> |
| 99 | <i data-i18n="Hint: Set the URL in the API connection settings."> |
| 100 | Hint: Set the URL in the API connection settings. |
| 101 | </i> |
| 102 | </div> |
| 103 | <div class="flex-container flexFlowColumn" id="koboldcpp_vectorsModel"> |
| 104 | <span> |
| 105 | Set the KoboldCpp URL in the Text Completion API connection settings. |
| 106 | </span> |
| 107 | <span> |
| 108 | Must use version 1.87 or higher and have an embedding model loaded. |
| 109 | </span> |
| 110 | </div> |
| 111 | <div class="flex-container flexFlowColumn" id="llamacpp_vectorsModel"> |
| 112 | <span data-i18n="The server MUST be started with the --embedding flag to use this feature!"> |
| 113 | The server MUST be started with the <code>--embedding</code> flag to use this feature! |
| 114 | </span> |
| 115 | <i data-i18n="Hint: Set the URL in the API connection settings."> |
| 116 | Hint: Set the URL in the API connection settings. |
| 117 | </i> |
| 118 | </div> |
| 119 | <div class="flex-container flexFlowColumn" id="openai_vectorsModel"> |
| 120 | <label for="vectors_openai_model" data-i18n="Vectorization Model"> |
| 121 | Vectorization Model |
| 122 | </label> |
| 123 | <select id="vectors_openai_model" class="text_pole"> |
| 124 | <option value="text-embedding-ada-002">text-embedding-ada-002</option> |
| 125 | <option value="text-embedding-3-small">text-embedding-3-small</option> |
| 126 | <option value="text-embedding-3-large">text-embedding-3-large</option> |
| 127 | </select> |
| 128 | </div> |
| 129 | <div class="flex-container flexFlowColumn" id="cohere_vectorsModel"> |
| 130 | <label for="vectors_cohere_model" data-i18n="Vectorization Model"> |
| 131 | Vectorization Model |
| 132 | </label> |
| 133 | <select id="vectors_cohere_model" class="text_pole"> |
| 134 | <option value="embed-v4.0">embed-v4.0</option> |
| 135 | <option value="embed-english-v3.0">embed-english-v3.0</option> |
| 136 | <option value="embed-multilingual-v3.0">embed-multilingual-v3.0</option> |
| 137 | <option value="embed-english-light-v3.0">embed-english-light-v3.0</option> |
| 138 | <option value="embed-multilingual-light-v3.0">embed-multilingual-light-v3.0</option> |
| 139 | <option value="embed-english-v2.0">embed-english-v2.0</option> |
| 140 | <option value="embed-english-light-v2.0">embed-english-light-v2.0</option> |
| 141 | <option value="embed-multilingual-v2.0">embed-multilingual-v2.0</option> |
| 142 | </select> |
| 143 | </div> |
| 144 | <div class="flex-container flexFlowColumn" id="together_vectorsModel"> |
| 145 | <label for="vectors_togetherai_model" data-i18n="Vectorization Model"> |
| 146 | Vectorization Model |
| 147 | </label> |
| 148 | <select id="vectors_togetherai_model" class="text_pole"> |
| 149 | <option value="togethercomputer/m2-bert-80M-32k-retrieval">M2-BERT-Retrieval-32k</option> |
| 150 | <option value="togethercomputer/m2-bert-80M-8k-retrieval">M2-BERT-Retrieval-8k</option> |
| 151 | <option value="togethercomputer/m2-bert-80M-2k-retrieval">M2-BERT-Retrieval-2K</option> |
| 152 | <option value="WhereIsAI/UAE-Large-V1">UAE-Large-V1</option> |
| 153 | <option value="BAAI/bge-large-en-v1.5">BAAI-Bge-Large-1p5</option> |
| 154 | <option value="BAAI/bge-base-en-v1.5">BAAI-Bge-Base-1p5</option> |
| 155 | <option value="sentence-transformers/msmarco-bert-base-dot-v5">Sentence-BERT</option> |
| 156 | <option value="bert-base-uncased">Bert Base Uncased</option> |
| 157 | </select> |
| 158 | </div> |
| 159 | <div class="flex-container flexFlowColumn" id="vllm_vectorsModel"> |
| 160 | <label for="vectors_vllm_model" data-i18n="Vectorization Model"> |
| 161 | Vectorization Model |
| 162 | </label> |
| 163 | <input id="vectors_vllm_model" class="text_pole" type="text" placeholder="Model name, e.g. intfloat/e5-mistral-7b-instruct" /> |
| 164 | <i data-i18n="Hint: Set the URL in the API connection settings."> |
| 165 | Hint: Set the URL in the API connection settings. |
| 166 | </i> |
| 167 | </div> |
| 168 | <div class="flex-container flexFlowColumn" id="google_vectorsModel"> |
| 169 | <label for="vectors_google_model" data-i18n="Vectorization Model"> |
| 170 | Vectorization Model |
| 171 | </label> |
| 172 | <select id="vectors_google_model" class="text_pole"> |
| 173 | <option value="gemini-embedding-001">gemini-embedding-001</option> |
| 174 | <option value="gemini-embedding-2-preview">gemini-embedding-2-preview</option> |
| 175 | <option value="gemini-embedding-exp-03-07">gemini-embedding-exp-03-07</option> |
| 176 | <option value="text-embedding-004">text-embedding-004</option> |
| 177 | <option value="text-embedding-005">text-embedding-005</option> |
| 178 | <option value="embedding-001">embedding-001</option> |
| 179 | </select> |
| 180 | </div> |
| 181 | <div class="flex-container alignItemsCenter" id="nomicai_apiKey"> |
| 182 | <label for="api_key_nomicai" class="flex1"> |
| 183 | <span data-i18n="NomicAI API Key">NomicAI API Key</span> |
| 184 | </label> |
| 185 | <div id="api_key_nomicai" class="menu_button menu_button_icon manage-api-keys" data-key="api_key_nomicai"> |
| 186 | <i class="fa-solid fa-key"></i> |
| 187 | <span data-i18n="Click to set">Click to set</span> |
| 188 | </div> |
| 189 | </div> |
| 190 | <div class="flex-container flexFlowColumn" id="openrouter_vectorsModel"> |
| 191 | <label for="vectors_openrouter_model" data-i18n="Vectorization Model"> |
| 192 | Vectorization Model |
| 193 | </label> |
| 194 | <select id="vectors_openrouter_model" class="text_pole"></select> |
| 195 | <i data-i18n="Hint: Set your OpenRouter API key in API Connections."> |
| 196 | Hint: Set your OpenRouter API key in API Connections. |
| 197 | </i> |
| 198 | </div> |
| 199 | <div class="flex-container flexFlowColumn" id="siliconflow_vectorsModel"> |
| 200 | <label for="vectors_siliconflow_model" data-i18n="Vectorization Model"> |
| 201 | Vectorization Model |
| 202 | </label> |
| 203 | <select id="vectors_siliconflow_model" class="text_pole"></select> |
| 204 | <i data-i18n="Hint: Set your SiliconFlow API key in API Connections."> |
| 205 | Hint: Set your SiliconFlow API key in API Connections. |
| 206 | </i> |
| 207 | </div> |
| 208 | |
| 209 | <div class="flex-container flexFlowColumn" id="workers_ai_vectorsModel"> |
| 210 | <label for="vectors_workers_ai_model" data-i18n="Vectorization Model"> |
| 211 | Vectorization Model |
| 212 | </label> |
| 213 | <select id="vectors_workers_ai_model" class="text_pole"></select> |
| 214 | <i data-i18n="Hint: Set your Workers AI API key and Account ID in API Connections."> |
| 215 | Hint: Set your Workers AI API key and Account ID in API Connections. |
| 216 | </i> |
| 217 | </div> |
| 218 | |
| 219 | <div class="flex-container marginTopBot5"> |
| 220 | <div class="flex-container flex1 flexFlowColumn" title="How many last messages will be matched for relevance."> |
| 221 | <label for="vectors_query"> |
| 222 | <small data-i18n="Query messages">Query messages</small> |
| 223 | </label> |
| 224 | <input type="number" id="vectors_query" class="text_pole" min="1" max="99" /> |
| 225 | </div> |
| 226 | <div class="flex-container flex1 flexFlowColumn" title="Cut-off score for relevance. Helps to filter out irrelevant data."> |
| 227 | <label for="vectors_query"> |
| 228 | <small data-i18n="Score threshold">Score threshold</small> |
| 229 | </label> |
| 230 | <input type="number" id="vectors_score_threshold" class="text_pole" min="0" max="1" step="0.05" /> |
| 231 | </div> |
| 232 | <div class="flex-container flex1 flexFlowColumn" title="Prioritize chunking on the preferred delimiter."> |
| 233 | <label for="vectors_force_chunk_delimiter"> |
| 234 | <small data-i18n="Chunk boundary">Chunk boundary</small> |
| 235 | </label> |
| 236 | <textarea id="vectors_force_chunk_delimiter" class="text_pole" rows="1" placeholder="(None)"></textarea> |
| 237 | </div> |
| 238 | </div> |
| 239 | |
| 240 | <div class="flex-container"> |
| 241 | <label class="checkbox_label expander" for="vectors_include_wi" title="Query results can activate World Info entries."> |
| 242 | <input id="vectors_include_wi" type="checkbox" class="checkbox"> |
| 243 | <span data-i18n="Include in World Info Scanning">Include in World Info Scanning</span> |
| 244 | </label> |
| 245 | </div> |
| 246 | |
| 247 | <hr> |
| 248 | |
| 249 | <h4 data-i18n="World Info settings"> |
| 250 | World Info settings |
| 251 | </h4> |
| 252 | |
| 253 | <label class="checkbox_label" for="vectors_enabled_world_info" title="Enable activation of World Info entries based on vector similarity."> |
| 254 | <input id="vectors_enabled_world_info" type="checkbox" class="checkbox"> |
| 255 | <span data-i18n="Enable for World Info">Enable for World Info</span> |
| 256 | </label> |
| 257 | |
| 258 | <div id="vectors_world_info_settings" class="marginTopBot5"> |
| 259 | <div class="flex-container"> |
| 260 | <label for="vectors_enabled_for_all" class="checkbox_label"> |
| 261 | <input id="vectors_enabled_for_all" type="checkbox" /> |
| 262 | <span data-i18n="Enabled for all entries">Enabled for all entries</span> |
| 263 | </label> |
| 264 | <ul class="margin0"> |
| 265 | <li> |
| 266 | <small data-i18n="Checked: all entries except ❌ status can be activated.">Checked: all entries except ❌ status can be activated.</small> |
| 267 | </li> |
| 268 | <li> |
| 269 | <small data-i18n="Unchecked: only entries with ❌ status can be activated.">Unchecked: only entries with 🔗 status can be activated.</small> |
| 270 | </li> |
| 271 | </ul> |
| 272 | </div> |
| 273 | <div class="flex-container"> |
| 274 | <div class="flex1"> |
| 275 | <!-- Vacant for future use --> |
| 276 | </div> |
| 277 | <div class="flex1" title="Maximum number of entries to be activated"> |
| 278 | <label for="vectors_max_entries" > |
| 279 | <small data-i18n="Max Entries">Max Entries</small> |
| 280 | </label> |
| 281 | <input id="vectors_max_entries" type="number" class="text_pole widthUnset" min="1" max="9999" /> |
| 282 | </div> |
| 283 | <div class="flex1"> |
| 284 | <!-- Vacant for future use --> |
| 285 | </div> |
| 286 | </div> |
| 287 | </div> |
| 288 | |
| 289 | <h4 data-i18n="File vectorization settings"> |
| 290 | File vectorization settings |
| 291 | </h4> |
| 292 | |
| 293 | <label class="checkbox_label" for="vectors_enabled_files"> |
| 294 | <input id="vectors_enabled_files" type="checkbox" class="checkbox"> |
| 295 | <span data-i18n="Enable for files">Enable for files</span> |
| 296 | </label> |
| 297 | |
| 298 | <div id="vectors_files_settings" class="marginTopBot5"> |
| 299 | <label class="checkbox_label" for="vectors_only_custom_boundary" title="Create a chunk for every custom Chunk boundary detected in the file text. Don't chunk on default boundaries."> |
| 300 | <input id="vectors_only_custom_boundary" type="checkbox" class="checkbox"> |
| 301 | <span data-i18n="Only chunk on custom boundary"> |
| 302 | Only chunk on custom boundary |
| 303 | </span> |
| 304 | </label> |
| 305 | <label class="checkbox_label" for="vectors_translate_files" title="This can help with retrieval accuracy if using embedding models that are trained on English data. Uses the selected API from Chat Translation extension settings."> |
| 306 | <input id="vectors_translate_files" type="checkbox" class="checkbox"> |
| 307 | <span data-i18n="Translate files into English before processing"> |
| 308 | Translate files into English before processing |
| 309 | </span> |
| 310 | <i class="fa-solid fa-flask" title="Experimental feature"></i> |
| 311 | </label> |
| 312 | <div class="flex justifyCenter" title="These settings apply to files attached directly to messages."> |
| 313 | <span data-i18n="Message attachments">Message attachments</span> |
| 314 | </div> |
| 315 | <div class="flex-container"> |
| 316 | <div class="flex1" title="Only files past this size will be vectorized."> |
| 317 | <label for="vectors_size_threshold"> |
| 318 | <small data-i18n="Size threshold (KB)">Size threshold (KB)</small> |
| 319 | </label> |
| 320 | <input id="vectors_size_threshold" type="number" class="text_pole" min="1" max="99999" /> |
| 321 | </div> |
| 322 | <div class="flex1" title="Chunk size for file splitting."> |
| 323 | <label for="vectors_chunk_size"> |
| 324 | <small data-i18n="Chunk size (chars)">Chunk size (chars)</small> |
| 325 | </label> |
| 326 | <input id="vectors_chunk_size" type="number" class="text_pole" min="1" max="99999" /> |
| 327 | </div> |
| 328 | <div class="flex1" title="The overlap between adjacent chunks in % from chunk size. The overlap text is trimmed to sentence boundaries. 0 = disabled."> |
| 329 | <label for="vectors_overlap_percent"> |
| 330 | <small data-i18n="Chunk overlap (%)">Chunk overlap (%)</small> |
| 331 | </label> |
| 332 | <input id="vectors_overlap_percent" type="number" class="text_pole" min="0" max="99" step="1" /> |
| 333 | </div> |
| 334 | <div class="flex1" title="How many chunks to retrieve when querying."> |
| 335 | <label for="vectors_chunk_count"> |
| 336 | <small data-i18n="Retrieve chunks">Retrieve chunks</small> |
| 337 | </label> |
| 338 | <input id="vectors_chunk_count" type="number" class="text_pole" min="1" max="99999" /> |
| 339 | </div> |
| 340 | </div> |
| 341 | <div class="flex justifyCenter" title="These settings apply to files stored in the Data Bank."> |
| 342 | <span data-i18n="Data Bank files">Data Bank files</span> |
| 343 | </div> |
| 344 | <div class="flex-container"> |
| 345 | <div class="flex1" title="Only files past this size will be vectorized."> |
| 346 | <label for="vectors_size_threshold_db"> |
| 347 | <small data-i18n="Size threshold (KB)">Size threshold (KB)</small> |
| 348 | </label> |
| 349 | <input id="vectors_size_threshold_db" type="number" class="text_pole" min="1" max="99999" /> |
| 350 | </div> |
| 351 | <div class="flex1" title="Chunk size for file splitting."> |
| 352 | <label for="vectors_chunk_size_db"> |
| 353 | <small data-i18n="Chunk size (chars)">Chunk size (chars)</small> |
| 354 | </label> |
| 355 | <input id="vectors_chunk_size_db" type="number" class="text_pole" min="1" max="99999" /> |
| 356 | </div> |
| 357 | <div class="flex1" title="The overlap between adjacent chunks in % from chunk size. The overlap text is trimmed to sentence boundaries. 0 = disabled."> |
| 358 | <label for="vectors_overlap_percent_db"> |
| 359 | <small data-i18n="Chunk overlap (%)">Chunk overlap (%)</small> |
| 360 | </label> |
| 361 | <input id="vectors_overlap_percent_db" type="number" class="text_pole" min="0" max="99" step="1" /> |
| 362 | </div> |
| 363 | <div class="flex1" title="How many chunks to retrieve when querying."> |
| 364 | <label for="vectors_chunk_count_db"> |
| 365 | <small data-i18n="Retrieve chunks">Retrieve chunks</small> |
| 366 | </label> |
| 367 | <input id="vectors_chunk_count_db" type="number" class="text_pole" min="1" max="99999" /> |
| 368 | </div> |
| 369 | </div> |
| 370 | <div class="flex-container flexFlowColumn"> |
| 371 | <label for="vectors_file_template_db"> |
| 372 | <span data-i18n="Injection Template">Injection Template</span> |
| 373 | </label> |
| 374 | <textarea id="vectors_file_template_db" class="margin0 text_pole textarea_compact" rows="3" placeholder="Use {{text}} macro to specify the position of retrieved text."></textarea> |
| 375 | <label for="vectors_file_position_db" data-i18n="Injection Position">Injection Position</label> |
| 376 | <div class="radio_group"> |
| 377 | <label> |
| 378 | <input type="radio" name="vectors_file_position_db" value="2" /> |
| 379 | <span data-i18n="Before Main Prompt / Story String">Before Main Prompt / Story String</span> |
| 380 | </label> |
| 381 | <!--Keep these as 0 and 1 to interface with the setExtensionPrompt function--> |
| 382 | <label> |
| 383 | <input type="radio" name="vectors_file_position_db" value="0" /> |
| 384 | <span data-i18n="After Main Prompt / Story String">After Main Prompt / Story String</span> |
| 385 | </label> |
| 386 | <label for="vectors_file_depth_db" title="How many messages before the current end of the chat." data-i18n="[title]How many messages before the current end of the chat."> |
| 387 | <input type="radio" name="vectors_file_position_db" value="1" /> |
| 388 | <span data-i18n="In-chat @ Depth">In-chat @ Depth</span> |
| 389 | <input id="vectors_file_depth_db" class="text_pole widthUnset" type="number" min="0" max="9999" /> |
| 390 | <span>as</span> |
| 391 | <select id="vectors_file_depth_role_db" class="text_pole widthNatural"> |
| 392 | <option value="0" data-i18n="System">System</option> |
| 393 | <option value="1" data-i18n="User">User</option> |
| 394 | <option value="2" data-i18n="Assistant">Assistant</option> |
| 395 | </select> |
| 396 | </label> |
| 397 | </div> |
| 398 | </div> |
| 399 | <div class="flex-container"> |
| 400 | <div id="vectors_files_vectorize_all" class="menu_button menu_button_icon" title="Vectorize all files in the Data Bank and current chat."> |
| 401 | <span data-i18n="Vectorize All">Vectorize All</span> |
| 402 | </div> |
| 403 | <div id="vectors_files_purge" class="menu_button menu_button_icon" title="Purge all file vectors in the Data Bank and current chat."> |
| 404 | <span data-i18n="Purge Vectors">Purge Vectors</span> |
| 405 | </div> |
| 406 | </div> |
| 407 | </div> |
| 408 | |
| 409 | <hr> |
| 410 | |
| 411 | <h4 data-i18n="Chat vectorization settings"> |
| 412 | Chat vectorization settings |
| 413 | </h4> |
| 414 | <label class="checkbox_label" for="vectors_enabled_chats"> |
| 415 | <input id="vectors_enabled_chats" type="checkbox" class="checkbox"> |
| 416 | <span data-i18n="Enabled for chat messages">Enabled for chat messages</span> |
| 417 | </label> |
| 418 | |
| 419 | <hr> |
| 420 | |
| 421 | <div id="vectors_chats_settings"> |
| 422 | <label class="checkbox_label expander" for="vectors_keep_hidden" title="Keep hidden (system) messages in the vector index and include them in query results."> |
| 423 | <input id="vectors_keep_hidden" type="checkbox" class="checkbox"> |
| 424 | <span data-i18n="Include hidden messages">Include hidden messages</span> |
| 425 | </label> |
| 426 | <div id="vectors_advanced_settings"> |
| 427 | <label for="vectors_template" data-i18n="Injection Template"> |
| 428 | Injection Template |
| 429 | </label> |
| 430 | <textarea id="vectors_template" class="text_pole textarea_compact" rows="3" placeholder="Use {{text}} macro to specify the position of retrieved text."></textarea> |
| 431 | <label for="vectors_position" data-i18n="Injection Position">Injection Position</label> |
| 432 | <div class="radio_group"> |
| 433 | <label> |
| 434 | <input type="radio" name="vectors_position" value="2" /> |
| 435 | <span data-i18n="Before Main Prompt / Story String">Before Main Prompt / Story String</span> |
| 436 | </label> |
| 437 | <!--Keep these as 0 and 1 to interface with the setExtensionPrompt function--> |
| 438 | <label> |
| 439 | <input type="radio" name="vectors_position" value="0" /> |
| 440 | <span data-i18n="After Main Prompt / Story String">After Main Prompt / Story String</span> |
| 441 | </label> |
| 442 | <label for="vectors_depth" title="How many messages before the current end of the chat." data-i18n="[title]How many messages before the current end of the chat."> |
| 443 | <input type="radio" name="vectors_position" value="1" /> |
| 444 | <span data-i18n="In-chat @ Depth">In-chat @ Depth </span> |
| 445 | <input id="vectors_depth" class="text_pole widthUnset" type="number" min="0" max="9999" /> |
| 446 | </label> |
| 447 | </div> |
| 448 | <div class="flex-container"> |
| 449 | <div class="flex1" title="Can increase the retrieval quality for the cost of processing. 0 = disabled."> |
| 450 | <label for="vectors_message_chunk_size"> |
| 451 | <small data-i18n="Chunk size (chars)">Chunk size (chars)</small> |
| 452 | </label> |
| 453 | <input id="vectors_message_chunk_size" type="number" class="text_pole widthUnset" min="0" max="9999" /> |
| 454 | </div> |
| 455 | <div class="flex1" title="Prevents last N messages from being placed out of order."> |
| 456 | <label for="vectors_protect"> |
| 457 | <small data-i18n="Retain#">Retain#</small> |
| 458 | </label> |
| 459 | <input type="number" id="vectors_protect" class="text_pole widthUnset" min="1" max="9999" /> |
| 460 | </div> |
| 461 | <div class="flex1" title="How many past messages to insert as memories."> |
| 462 | <label for="vectors_insert"> |
| 463 | <small data-i18n="Insert#">Insert#</small> |
| 464 | </label> |
| 465 | <input type="number" id="vectors_insert" class="text_pole widthUnset" min="1" max="9999" /> |
| 466 | </div> |
| 467 | </div> |
| 468 | <hr class="m-b-1"> |
| 469 | <div class="flex-container flexFlowColumn"> |
| 470 | <div class="flex-container alignitemscenter justifyCenter"> |
| 471 | <i class="fa-solid fa-flask" title="Summarization for vectors is an experimental feature that may improve vectors or may worsen them. Use at your own discretion."></i> |
| 472 | <span data-i18n="Vector Summarization">Vector Summarization</span> |
| 473 | </div> |
| 474 | <label class="checkbox_label expander" for="vectors_summarize" title="Summarize chat messages before generating embeddings."> |
| 475 | <input id="vectors_summarize" type="checkbox" class="checkbox"> |
| 476 | <span data-i18n="Summarize chat messages for vector generation">Summarize chat messages for vector generation</span> |
| 477 | </label> |
| 478 | <i class="failure" data-i18n="Warning: This will slow down vector generation drastically, as all messages have to be summarized first.">Warning: This will slow down vector generation drastically, as all messages have to be summarized first.</i> |
| 479 | |
| 480 | <label class="checkbox_label expander" for="vectors_summarize_user" title="Summarize sent chat messages before generating embeddings."> |
| 481 | <input id="vectors_summarize_user" type="checkbox" class="checkbox"> |
| 482 | <span data-i18n="Summarize chat messages when sending">Summarize chat messages when sending</span> |
| 483 | </label> |
| 484 | <i class="failure" data-i18n="Warning: This might cause your sent messages to take a bit to process and slow down response time.">Warning: This might cause your sent messages to take a bit to process and slow down response time.</i> |
| 485 | |
| 486 | <label for="vectors_summary_source" title="Summarize with:">Summarize with:</label> |
| 487 | <select id="vectors_summary_source" class="text_pole"> |
| 488 | <option value="main" data-i18n="Main API">Main API</option> |
| 489 | <option value="extras" data-i18n="Extras API">Extras API</option> |
| 490 | <option value="webllm" data-i18n="WebLLM Extension">WebLLM Extension</option> |
| 491 | </select> |
| 492 | |
| 493 | <label for="vectors_summary_prompt" title="Summary Prompt:">Summary Prompt:</label> |
| 494 | <small data-i18n="Only used when Main API or WebLLM Extension is selected.">Only used when Main API or WebLLM Extension is selected.</small> |
| 495 | <textarea id="vectors_summary_prompt" class="text_pole textarea_compact" rows="6" placeholder="This prompt will be sent to AI to request the summary generation."></textarea> |
| 496 | |
| 497 | <label for="vectors_summary_retries" title="Number of attempts per message before aborting vectorization."> |
| 498 | <span data-i18n="Summarization retries per message">Summarization retries per message</span> |
| 499 | </label> |
| 500 | <input id="vectors_summary_retries" type="number" class="text_pole widthUnset" min="1" max="10" step="1" /> |
| 501 | |
| 502 | <label for="vectors_summary_threshold" title="Messages shorter than this (in characters) are embedded as-is without summarization. Set to 0 to always summarize."> |
| 503 | <span data-i18n="Summarization min length (chars)">Summarization min length (chars)</span> |
| 504 | </label> |
| 505 | <input id="vectors_summary_threshold" type="number" class="text_pole widthUnset" min="0" step="1" /> |
| 506 | </div> |
| 507 | </div> |
| 508 | <small data-i18n="Old messages are vectorized gradually as you chat. To process all previous messages, click the button below."> |
| 509 | Old messages are vectorized gradually as you chat. |
| 510 | To process all previous messages, click the button below. |
| 511 | </small> |
| 512 | <div class="flex-container"> |
| 513 | <div id="vectors_vectorize_all" class="menu_button menu_button_icon" data-i18n="Vectorize All"> |
| 514 | Vectorize All |
| 515 | </div> |
| 516 | <div id="vectors_purge" class="menu_button menu_button_icon" data-i18n="Purge Vectors"> |
| 517 | Purge Vectors |
| 518 | </div> |
| 519 | <div id="vectors_view_stats" class="menu_button menu_button_icon" data-i18n="View Stats"> |
| 520 | View Stats |
| 521 | </div> |
| 522 | </div> |
| 523 | <div id="vectorize_progress" style="display: none;"> |
| 524 | <small> |
| 525 | Processed <span id="vectorize_progress_percent">0</span>% of messages. |
| 526 | ETA: <span id="vectorize_progress_eta">...</span> seconds. |
| 527 | </small> |
| 528 | </div> |
| 529 | </div> |
| 530 | </div> |
| 531 | </div> |
| 532 | </div> |