Refactor getStreamingReply to use nullish coalescing for show_thoughts

This commit is contained in:
Cohee
2025-03-22 18:27:49 +02:00
parent 7df6a78f33
commit 0b937237c3

View File

@ -2271,7 +2271,7 @@ async function sendOpenAIRequest(type, messages, signal) {
*/ */
export function getStreamingReply(data, state, { chatCompletionSource = null, overrideShowThoughts = null } = {}) { export function getStreamingReply(data, state, { chatCompletionSource = null, overrideShowThoughts = null } = {}) {
const chat_completion_source = chatCompletionSource ?? oai_settings.chat_completion_source; const chat_completion_source = chatCompletionSource ?? oai_settings.chat_completion_source;
const show_thoughts = overrideShowThoughts !== null ? overrideShowThoughts : oai_settings.show_thoughts; const show_thoughts = overrideShowThoughts ?? oai_settings.show_thoughts;
if (chat_completion_source === chat_completion_sources.CLAUDE) { if (chat_completion_source === chat_completion_sources.CLAUDE) {
if (show_thoughts) { if (show_thoughts) {