Skip to content

Commit 8e81741

Browse files
committed
Fix session/message tokens calculation.
1 parent b42cfa0 commit 8e81741

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
- Fix session-tokens in usage notifications.
66
- Support context limit on usage notifications.
7+
- Fix session/message tokens calculation.
78

89
## 0.38.3
910

src/eca/features/chat.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@
6868
total-input-tokens (get-in db [:chats chat-id :total-input-tokens] 0)
6969
total-input-cache-creation-tokens (get-in db [:chats chat-id :total-input-cache-creation-tokens] nil)
7070
total-input-cache-read-tokens (get-in db [:chats chat-id :total-input-cache-read-tokens] nil)
71-
total-input-cache-tokens (+ (or total-input-cache-creation-tokens 0)
72-
(or total-input-cache-read-tokens 0))
71+
total-input-cache-tokens (or total-input-cache-read-tokens 0)
7372
total-output-tokens (get-in db [:chats chat-id :total-output-tokens] 0)
7473
model-capabilities (get-in db [:models full-model])]
7574
(assoc-some {:message-output-tokens output-tokens

0 commit comments

Comments
 (0)