all: only display total input tokens
Knowing the cache reads and writes was mildly interesting for us,
but it is inside baseball, and our calculations ended up being a little wrong.
Streamline the UI and make the math right.
Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/ant/ant.go b/ant/ant.go
index 2ba714e..463d5fb 100644
--- a/ant/ant.go
+++ b/ant/ant.go
@@ -908,6 +908,11 @@
u.TotalCostUSD += resp.TotalDollars()
}
+// TotalInputTokens returns the grand total cumulative input tokens in u.
+func (u *CumulativeUsage) TotalInputTokens() uint64 {
+ return u.InputTokens + u.CacheReadInputTokens + u.CacheCreationInputTokens
+}
+
// Attr returns the cumulative usage as a slog.Attr with key "usage".
func (u CumulativeUsage) Attr() slog.Attr {
elapsed := time.Since(u.StartTime)