Merge branch 'staging' into feature/access-log-middleware
| @@ -0,0 +1,13 @@ | ||
| 1 | +These are master copies of the default content files and are managed by SillyTavern. | |
| 2 | + | |
| 3 | +Editing any of these files would not only have no effect, but will also cause merge conflicts during update pulls. | |
| 4 | + | |
| 5 | +You should edit their respective copies instead, for example: | |
| 6 | + | |
| 7 | +1. /default/config.yaml => /config.yaml | |
| 8 | +2. /default/public/css/user.css => /public/css/user.css | |
| 9 | +etc. | |
| 10 | + | |
| 11 | +Any questions? You're always welcome at our official documentation website: | |
| 12 | + | |
| 13 | +https://docs.sillytavern.app/ | |
| @@ -2000,7 +2000,7 @@ | ||
| 2000 | 2000 | </span> |
| 2001 | 2001 | </div> |
| 2002 | 2002 | </div> |
| 2003 | 2003 | <div class="range-block" data-source="deepseek,openrouter,custom"> |
| 2004 | 2004 | <label for="openai_show_thoughts" class="checkbox_label widthFreeExpand"> |
| 2005 | 2005 | <input id="openai_show_thoughts" type="checkbox" /> |
| 2006 | 2006 | <span> |
| @@ -3253,6 +3253,10 @@ | ||
| 3253 | 3253 | <option value="sonar">sonar</option> |
| 3254 | 3254 | <option value="sonar-pro">sonar-pro</option> |
| 3255 | 3255 | <option value="sonar-reasoning">sonar-reasoning</option> |
| 3256 | + <option value="sonar-reasoning-pro">sonar-reasoning-pro</option> | |
| 3257 | + </optgroup> | |
| 3258 | + <optgroup label="Offline Models"> | |
| 3259 | + <option value="r1-1776">r1-1776</option> | |
| 3256 | 3260 | </optgroup> |
| 3257 | 3261 | <optgroup label="Deprecated Models"> |
| 3258 | 3262 | <!-- These are scheduled for deprecation after 2/22/2025 --> |
| @@ -1487,7 +1487,7 @@ jQuery(function () { | ||
| 1487 | 1487 | ...chat.filter(x => x?.extra?.type !== system_message_types.ASSISTANT_NOTE), |
| 1488 | 1488 | ]; |
| 1489 | 1489 | |
| 1490 | 1490 | download(JSONchatToSave.stringifymap(chatToSave,(m) null,=> 4JSON.stringify(m)).join('\n'), `Assistant - ${humanizedDateTime()}.jsonjsonl`, 'application/json'); |
| 1491 | 1491 | }); |
| 1492 | 1492 | |
| 1493 | 1493 | // Do not change. #attachFile is added by extension. |
| @@ -2167,6 +2167,14 @@ function getStreamingReply(data, state) { | ||
| 2167 | 2167 | state.reasoning += (data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning || ''); |
| 2168 | 2168 | } |
| 2169 | 2169 | return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; |
| 2170 | + } else if (oai_settings.chat_completion_source === chat_completion_sources.CUSTOM) { | |
| 2171 | + if (oai_settings.show_thoughts) { | |
| 2172 | + state.reasoning += | |
| 2173 | + data.choices?.filter(x => x?.delta?.reasoning_content)?.[0]?.delta?.reasoning_content ?? | |
| 2174 | + data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning ?? | |
| 2175 | + ''; | |
| 2176 | + } | |
| 2177 | + return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; | |
| 2170 | 2178 | } else { |
| 2171 | 2179 | return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; |
| 2172 | 2180 | } |
| @@ -4387,7 +4395,7 @@ async function onModelChange() { | ||
| 4387 | 4395 | if (oai_settings.max_context_unlocked) { |
| 4388 | 4396 | $('#openai_max_context').attr('max', unlocked_max); |
| 4389 | 4397 | } |
| 4390 | 4398 | else if (['sonar', 'sonar-reasoning', 'sonar-reasoning-pro', 'r1-1776'].includes(oai_settings.perplexity_model)) { |
| 4391 | 4399 | $('#openai_max_context').attr('max', 127000); |
| 4392 | 4400 | } |
| 4393 | 4401 | else if (['sonar-pro'].includes(oai_settings.perplexity_model)) { |
| @@ -76,6 +76,11 @@ export function extractReasoningFromData(data) { | ||
| 76 | 76 | return data?.choices?.[0]?.message?.reasoning ?? ''; |
| 77 | 77 | case chat_completion_sources.MAKERSUITE: |
| 78 | 78 | return data?.responseContent?.parts?.filter(part => part.thought)?.map(part => part.text)?.join('\n\n') ?? ''; |
| 79 | + case chat_completion_sources.CUSTOM: { | |
| 80 | + return data?.choices?.[0]?.message?.reasoning_content | |
| 81 | + ?? data?.choices?.[0]?.message?.reasoning | |
| 82 | + ?? ''; | |
| 83 | + } | |
| 79 | 84 | } |
| 80 | 85 | break; |
| 81 | 86 | } |
| @@ -338,14 +343,15 @@ export class ReasoningHandler { | ||
| 338 | 343 | return mesChanged; |
| 339 | 344 | } |
| 340 | 345 | |
| 341 | 346 | if (this.state === ReasoningState.None || this.#isHiddenReasoningModel) { |
| 342 | 347 | // If streamed message starts with the opening, cut it out and put all inside reasoning |
| 343 | 348 | if (message.mes.startsWith(power_user.reasoning.prefix) && message.mes.length > power_user.reasoning.prefix.length) { |
| 344 | 349 | this.#isParsingReasoning = true; |
| 345 | 350 | |
| 346 | 351 | // Manually set starting state here, as we might already have received the ending suffix |
| 347 | 352 | this.state = ReasoningState.Thinking; |
| 348 | 353 | this.startTime = this.startTime ?? this.initialTime; |
| 354 | + this.endTime = null; | |
| 349 | 355 | } |
| 350 | 356 | } |
| 351 | 357 | |
| @@ -679,7 +679,7 @@ export function getTokenizerModel() { | ||
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | if (oai_settings.chat_completion_source === chat_completion_sources.PERPLEXITY) { |
| 682 | 682 | if (oai_settings.perplexity_model.includes('sonar-reasoning') || oai_settings.perplexity_model.includes('r1-1776')) { |
| 683 | 683 | return deepseekTokenizer; |
| 684 | 684 | } |
| 685 | 685 | if (oai_settings.perplexity_model.includes('llama-3') || oai_settings.perplexity_model.includes('llama3')) { |
| @@ -55,6 +55,10 @@ | ||
| 55 | 55 | --interactable-outline-color: var(--white100); |
| 56 | 56 | --interactable-outline-color-faint: var(--white20a); |
| 57 | 57 | |
| 58 | + --reasoning-body-color: var(--SmartThemeEmColor); | |
| 59 | + --reasoning-em-color: color-mix(in srgb, var(--SmartThemeEmColor) 67%, var(--SmartThemeBlurTintColor) 33%); | |
| 60 | + --reasoning-saturation: 0.5; | |
| 61 | + | |
| 58 | 62 | |
| 59 | 63 | /*Default Theme, will be changed by ToolCool Color Picker*/ |
| 60 | 64 | --SmartThemeBodyColor: rgb(220, 220, 210); |
| @@ -348,13 +352,13 @@ input[type='checkbox']:focus-visible { | ||
| 348 | 352 | |
| 349 | 353 | .mes_reasoning { |
| 350 | 354 | display: block; |
| 351 | 355 | border-left: 2px solid var(--SmartThemeEmColorreasoning-body-color); |
| 352 | 356 | border-radius: 2px; |
| 353 | 357 | padding: 5px; |
| 354 | 358 | padding-left: 14px; |
| 355 | 359 | margin-bottom: 0.5em; |
| 356 | 360 | overflow-y: auto; |
| 357 | - color: var(--SmartThemeEmColor); | |
| 361 | + color: hsl(from var(--reasoning-body-color) h calc(s * var(--reasoning-saturation)) l); | |
| 358 | 362 | } |
| 359 | 363 | |
| 360 | 364 | .mes_reasoning_details { |
| @@ -374,18 +378,6 @@ input[type='checkbox']:focus-visible { | ||
| 374 | 378 | margin-bottom: 0; |
| 375 | 379 | } |
| 376 | 380 | |
| 377 | -.mes_reasoning em, | |
| 378 | -.mes_reasoning i, | |
| 379 | -.mes_reasoning u, | |
| 380 | -.mes_reasoning q, | |
| 381 | -.mes_reasoning blockquote { | |
| 382 | - filter: saturate(0.5); | |
| 383 | -} | |
| 384 | - | |
| 385 | -.mes_reasoning_details .mes_reasoning em { | |
| 386 | - color: color-mix(in srgb, var(--SmartThemeEmColor) 67%, var(--SmartThemeBlurTintColor) 33%); | |
| 387 | -} | |
| 388 | - | |
| 389 | 381 | .mes_reasoning_header_block { |
| 390 | 382 | flex-grow: 1; |
| 391 | 383 | } |
| @@ -461,26 +453,36 @@ input[type='checkbox']:focus-visible { | ||
| 461 | 453 | } |
| 462 | 454 | |
| 463 | 455 | .mes_text i, |
| 464 | 456 | .mes_text em, { |
| 457 | + color: var(--SmartThemeEmColor); | |
| 458 | +} | |
| 465 | 459 | .mes_reasoning i, |
| 466 | 460 | .mes_reasoning em { |
| 467 | - color: var(--SmartThemeEmColor); | |
| 461 | + color: hsl(from var(--reasoning-em-color) h calc(s * var(--reasoning-saturation)) l); | |
| 468 | 462 | } |
| 469 | 463 | |
| 470 | 464 | .mes_text q i, |
| 471 | 465 | .mes_text q em { |
| 472 | 466 | color: inherit; |
| 473 | 467 | } |
| 468 | +.mes_reasoning q i, | |
| 469 | +.mes_reasoning q em { | |
| 470 | + color: hsl(from var(--SmartThemeQuoteColor) h calc(s * var(--reasoning-saturation)) l); | |
| 471 | +} | |
| 474 | 472 | |
| 475 | 473 | .mes_text u, { |
| 476 | -.mes_reasoning u { | |
| 477 | 474 | color: var(--SmartThemeUnderlineColor); |
| 478 | 475 | } |
| 476 | +.mes_reasoning u { | |
| 477 | + color: hsl(from var(--SmartThemeUnderlineColor) h calc(s * var(--reasoning-saturation)) l); | |
| 478 | +} | |
| 479 | 479 | |
| 480 | 480 | .mes_text q, { |
| 481 | -.mes_reasoning q { | |
| 482 | 481 | color: var(--SmartThemeQuoteColor); |
| 483 | 482 | } |
| 483 | +.mes_reasoning q { | |
| 484 | + color: hsl(from var(--SmartThemeQuoteColor) h calc(s * var(--reasoning-saturation)) l); | |
| 485 | +} | |
| 484 | 486 | |
| 485 | 487 | .mes_text font[color] em, |
| 486 | 488 | .mes_text font[color] i, |
| @@ -244,7 +244,6 @@ const cliArguments = yargs(hideBin(process.argv)) | ||
| 244 | 244 | describe: 'Request proxy URL (HTTP or SOCKS protocols)', |
| 245 | 245 | }).option('requestProxyBypass', { |
| 246 | 246 | type: 'array', |
| 247 | - default: null, | |
| 248 | 247 | describe: 'Request proxy bypass list (space separated list of hosts)', |
| 249 | 248 | }).parseSync(); |
| 250 | 249 | |