mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Merge branch 'staging' into reasoning-template
This commit is contained in:
@ -87,19 +87,24 @@ function toggleReasoningAutoExpand() {
|
||||
* @param {object} data Response data
|
||||
* @returns {string} Extracted reasoning
|
||||
*/
|
||||
export function extractReasoningFromData(data) {
|
||||
switch (main_api) {
|
||||
export function extractReasoningFromData(data, {
|
||||
mainApi = null,
|
||||
ignoreShowThoughts = false,
|
||||
textGenType = null,
|
||||
chatCompletionSource = null
|
||||
} = {}) {
|
||||
switch (mainApi ?? main_api) {
|
||||
case 'textgenerationwebui':
|
||||
switch (textgenerationwebui_settings.type) {
|
||||
switch (textGenType ?? textgenerationwebui_settings.type) {
|
||||
case textgen_types.OPENROUTER:
|
||||
return data?.choices?.[0]?.reasoning ?? '';
|
||||
}
|
||||
break;
|
||||
|
||||
case 'openai':
|
||||
if (!oai_settings.show_thoughts) break;
|
||||
if (!ignoreShowThoughts && !oai_settings.show_thoughts) break;
|
||||
|
||||
switch (oai_settings.chat_completion_source) {
|
||||
switch (chatCompletionSource ?? oai_settings.chat_completion_source) {
|
||||
case chat_completion_sources.DEEPSEEK:
|
||||
return data?.choices?.[0]?.message?.reasoning_content ?? '';
|
||||
case chat_completion_sources.OPENROUTER:
|
||||
|
Reference in New Issue
Block a user