File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 293293 {:keys [messages]} (f.mcp/get-prompt! prompt args-vals @db*)]
294294 (prompt-messages! messages false chat-ctx)))
295295
296- (defn ^:private handle-command! [{:keys [command]} {:keys [chat-id db*] :as chat-ctx}]
296+ (defn ^:private handle-command! [{:keys [command]} {:keys [chat-id db* model ] :as chat-ctx}]
297297 (case command
298298 " costs" (let [db @db*
299299 total-input-tokens (get-in db [:chats chat-id :total-input-tokens ] 0 )
305305 (str " Total input cache creation tokens: " total-input-cache-creation-tokens))
306306 (when total-input-cache-read-tokens
307307 (str " Total input cache read tokens: " total-input-cache-read-tokens))
308- (str " Total output tokens: " total-output-tokens))]
308+ (str " Total output tokens: " total-output-tokens)
309+ (str " Total cost: $" (tokens->cost total-input-tokens total-input-cache-creation-tokens total-input-cache-read-tokens total-output-tokens model db)))]
309310 (send-content! chat-ctx :system {:type :text
310311 :text text}))
311312 (send-content! chat-ctx :system {:type :text
You can’t perform that action at this time.
0 commit comments