Skip to content

Commit ca2e280

Browse files
authored
Merge branch 'master' into chore/drop-gguf-vram-estimation
2 parents 5162a40 + 397f7f0 commit ca2e280

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

core/http/static/chat.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,6 +1404,11 @@ async function promptGPT(systemPrompt, input) {
14041404
case "reasoning":
14051405
hasReasoningFromAPI = true; // Mark that we're receiving reasoning from API
14061406
if (eventData.content) {
1407+
// Count tokens for rate calculation (thinking/reasoning)
1408+
const reasoningRequest = activeRequests.get(chatId);
1409+
if (reasoningRequest) {
1410+
reasoningRequest.tokensReceived += Math.ceil(eventData.content.length / 4);
1411+
}
14071412
const currentChat = chatStore.getChat(chatId);
14081413
if (!currentChat) break; // Chat was deleted
14091414
const isMCPMode = currentChat.mcpMode || false;
@@ -1959,6 +1964,11 @@ async function promptGPT(systemPrompt, input) {
19591964
if (reasoningDelta && reasoningDelta.trim() !== "") {
19601965
hasReasoningFromAPI = true; // Mark that we're receiving reasoning from API
19611966
reasoningContent += reasoningDelta;
1967+
// Count tokens for rate calculation (thinking/reasoning)
1968+
const reasoningRequest = activeRequests.get(chatId);
1969+
if (reasoningRequest) {
1970+
reasoningRequest.tokensReceived += Math.ceil(reasoningDelta.length / 4);
1971+
}
19621972
const currentChat = chatStore.getChat(chatId);
19631973
if (!currentChat) {
19641974
// Chat was deleted, skip this line

0 commit comments

Comments
 (0)