diff --git a/public/scripts/openai.js b/public/scripts/openai.js index 860cc251c..8e77040cb 100644 --- a/public/scripts/openai.js +++ b/public/scripts/openai.js @@ -2167,15 +2167,15 @@ function getStreamingReply(data, state) { state.reasoning += (data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning || ''); } return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; - } else if(oai_settings.chat_completion_source === chat_completion_sources.CUSTOM){ + } else if (oai_settings.chat_completion_source === chat_completion_sources.CUSTOM) { if (oai_settings.show_thoughts) { state.reasoning += - data.choices?.filter(x => x?.delta?.reasoning_content)?.[0]?.delta?.reasoning_content?? - data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning?? - ''; + data.choices?.filter(x => x?.delta?.reasoning_content)?.[0]?.delta?.reasoning_content ?? + data.choices?.filter(x => x?.delta?.reasoning)?.[0]?.delta?.reasoning ?? + ''; } return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; - }else{ + } else { return data.choices?.[0]?.delta?.content ?? data.choices?.[0]?.message?.content ?? data.choices?.[0]?.text ?? ''; } } diff --git a/public/scripts/reasoning.js b/public/scripts/reasoning.js index 02a2f34dc..815135814 100644 --- a/public/scripts/reasoning.js +++ b/public/scripts/reasoning.js @@ -76,10 +76,10 @@ export function extractReasoningFromData(data) { return data?.choices?.[0]?.message?.reasoning ?? ''; case chat_completion_sources.MAKERSUITE: return data?.responseContent?.parts?.filter(part => part.thought)?.map(part => part.text)?.join('\n\n') ?? ''; - case chat_completion_sources.CUSTOM:{ + case chat_completion_sources.CUSTOM: { return data?.choices?.[0]?.message?.reasoning_content - ?? data?.choices?.[0]?.message?.reasoning - ?? ''; + ?? data?.choices?.[0]?.message?.reasoning + ?? ''; } } break;