(byModel: Record<string, TokenUsage>)
| 71 | } |
| 72 | |
| 73 | function totalUsage(byModel: Record<string, TokenUsage>): TokenUsage | undefined { |
| 74 | let total: TokenUsage | undefined; |
| 75 | for (const usage of Object.values(byModel)) { |
| 76 | total = total === undefined ? copyUsage(usage) : addUsage(total, usage); |
| 77 | } |
| 78 | return total; |
| 79 | } |