diff --git a/public/script.js b/public/script.js index 6e11186f5..9123ad32b 100644 --- a/public/script.js +++ b/public/script.js @@ -5930,6 +5930,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); chat[chat.length - 1]['extra']['reasoning'] = reasoning; + chat[chat.length - 1]['extra']['reasoning_duration'] = null; if (power_user.message_token_count_enabled) { const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes']; chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0); @@ -5952,6 +5953,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); chat[chat.length - 1]['extra']['reasoning'] = reasoning; + chat[chat.length - 1]['extra']['reasoning_duration'] = null; if (power_user.message_token_count_enabled) { const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes']; chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0); @@ -5971,6 +5973,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); chat[chat.length - 1]['extra']['reasoning'] += reasoning; + // We don't know if the reasoning duration extended, so we don't update it here on purpose. if (power_user.message_token_count_enabled) { const tokenCountText = (reasoning || '') + chat[chat.length - 1]['mes']; chat[chat.length - 1]['extra']['token_count'] = await getTokenCountAsync(tokenCountText, 0); @@ -5990,6 +5993,7 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, chat[chat.length - 1]['extra']['api'] = getGeneratingApi(); chat[chat.length - 1]['extra']['model'] = getGeneratingModel(); chat[chat.length - 1]['extra']['reasoning'] = reasoning; + chat[chat.length - 1]['extra']['reasoning_duration'] = null; if (power_user.trim_spaces) { getMessage = getMessage.trim(); }