(text)
| 1 | export function estimateTokenCount(text) { |
| 2 | if (!text) { |
| 3 | return 0; |
| 4 | } |
| 5 | return Math.ceil(text.length / 4); |
| 6 | } |
| 7 | |
| 8 | export function sumTokenCounts(items) { |
| 9 | return items.reduce((total, item) => total + item.tokens, 0); |
no outgoing calls
no test coverage detected