time_to_first_token moved to extras
| @@ -2477,7 +2477,7 @@ export function addOneMessage(mes, { type = 'normal', insertAfter = null, scroll | |||
| 2477 | timestamp: timestamp, | 2477 | timestamp: timestamp, |
| 2478 | extra: mes.extra, | 2478 | extra: mes.extra, |
| 2479 | tokenCount: mes.extra?.token_count ?? 0, | 2479 | tokenCount: mes.extra?.token_count ?? 0, |
| 2480 | ...formatGenerationTimer(mes.gen_started, mes.gen_finished, mes.extra?.token_count, mes.time_to_first_token, mes.extra?.reasoning_duration), | 2480 | ...formatGenerationTimer(mes.gen_started, mes.gen_finished, mes.extra?.token_count, mes.extra?.time_to_first_token, mes.extra?.reasoning_duration), |
| 2481 | }; | 2481 | }; |
| 2482 | 2482 | ||
| 2483 | const renderedMessage = getMessageFromTemplate(params); | 2483 | const renderedMessage = getMessageFromTemplate(params); |
| @@ -3252,11 +3252,11 @@ class StreamingProcessor { | |||
| 3252 | const currentTime = new Date(); | 3252 | const currentTime = new Date(); |
| 3253 | chat[messageId]['mes'] = processedText; | 3253 | chat[messageId]['mes'] = processedText; |
| 3254 | chat[messageId]['gen_started'] = this.timeStarted; | 3254 | chat[messageId]['gen_started'] = this.timeStarted; |
| 3255 | chat[messageId]['time_to_first_token'] = this.timeToFirstToken; | ||
| 3256 | chat[messageId]['gen_finished'] = currentTime; | 3255 | chat[messageId]['gen_finished'] = currentTime; |
| 3257 | if (!chat[messageId]['extra']) { | 3256 | if (!chat[messageId]['extra']) { |
| 3258 | chat[messageId]['extra'] = {}; | 3257 | chat[messageId]['extra'] = {}; |
| 3259 | } | 3258 | } |
| 3259 | chat[messageId]['extra']['time_to_first_token'] = this.timeToFirstToken; | ||
| 3260 | 3260 | ||
| 3261 | // Update reasoning | 3261 | // Update reasoning |
| 3262 | await this.reasoningHandler.process(messageId, mesChanged); | 3262 | await this.reasoningHandler.process(messageId, mesChanged); |
| @@ -3278,7 +3278,6 @@ class StreamingProcessor { | |||
| 3278 | 'send_date': chat[messageId]['send_date'], | 3278 | 'send_date': chat[messageId]['send_date'], |
| 3279 | 'gen_started': chat[messageId]['gen_started'], | 3279 | 'gen_started': chat[messageId]['gen_started'], |
| 3280 | 'gen_finished': chat[messageId]['gen_finished'], | 3280 | 'gen_finished': chat[messageId]['gen_finished'], |
| 3281 | 'time_to_first_token': chat[messageId]['time_to_first_token'], | ||
| 3282 | 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])) | 3281 | 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])) |
| 3283 | }; | 3282 | }; |
| 3284 | } | 3283 | } |
| @@ -3375,7 +3374,6 @@ class StreamingProcessor { | |||
| 3375 | 'send_date': chat[messageId]['send_date'], | 3374 | 'send_date': chat[messageId]['send_date'], |
| 3376 | 'gen_started': chat[messageId]['gen_started'], | 3375 | 'gen_started': chat[messageId]['gen_started'], |
| 3377 | 'gen_finished': chat[messageId]['gen_finished'], | 3376 | 'gen_finished': chat[messageId]['gen_finished'], |
| 3378 | 'time_to_first_token': chat[messageId]['time_to_first_token'], | ||
| 3379 | 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])) }; | 3377 | 'extra': JSON.parse(JSON.stringify(chat[messageId]['extra'])) }; |
| 3380 | } | 3378 | } |
| 3381 | } | 3379 | } |
| @@ -6094,7 +6092,6 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, | |||
| 6094 | send_date: item['send_date'], | 6092 | send_date: item['send_date'], |
| 6095 | gen_started: item['gen_started'], | 6093 | gen_started: item['gen_started'], |
| 6096 | gen_finished: item['gen_finished'], | 6094 | gen_finished: item['gen_finished'], |
| 6097 | time_to_first_token: item['time_to_first_token'], | ||
| 6098 | extra: JSON.parse(JSON.stringify(item['extra'])), | 6095 | extra: JSON.parse(JSON.stringify(item['extra'])), |
| 6099 | }; | 6096 | }; |
| 6100 | } else { | 6097 | } else { |
| @@ -6105,7 +6102,6 @@ export async function saveReply(type, getMessage, fromStreaming, title, swipes, | |||
| 6105 | send_date: chat[chat.length - 1]['send_date'], | 6102 | send_date: chat[chat.length - 1]['send_date'], |
| 6106 | gen_started: chat[chat.length - 1]['gen_started'], | 6103 | gen_started: chat[chat.length - 1]['gen_started'], |
| 6107 | gen_finished: chat[chat.length - 1]['gen_finished'], | 6104 | gen_finished: chat[chat.length - 1]['gen_finished'], |
| 6108 | time_to_first_token: chat[chat.length - 1]['time_to_first_token'], | ||
| 6109 | extra: JSON.parse(JSON.stringify(chat[chat.length - 1]['extra'])), | 6105 | extra: JSON.parse(JSON.stringify(chat[chat.length - 1]['extra'])), |
| 6110 | }; | 6106 | }; |
| 6111 | } | 6107 | } |
| @@ -8859,7 +8855,6 @@ const swipe_right = () => { | |||
| 8859 | 'send_date': chat[chat.length - 1]['send_date'], | 8855 | 'send_date': chat[chat.length - 1]['send_date'], |
| 8860 | 'gen_started': chat[chat.length - 1]['gen_started'], | 8856 | 'gen_started': chat[chat.length - 1]['gen_started'], |
| 8861 | 'gen_finished': chat[chat.length - 1]['gen_finished'], | 8857 | 'gen_finished': chat[chat.length - 1]['gen_finished'], |
| 8862 | 'time_to_first_token': chat[chat.length - 1]['time_to_first_token'], | ||
| 8863 | 'extra': JSON.parse(JSON.stringify(chat[chat.length - 1]['extra'])) | 8858 | 'extra': JSON.parse(JSON.stringify(chat[chat.length - 1]['extra'])) |
| 8864 | }; | 8859 | }; |
| 8865 | //assign swipe info array with last message from chat | 8860 | //assign swipe info array with last message from chat |