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