(text)
| 275 | } |
| 276 | |
| 277 | function quickTokenEstimate(text) { |
| 278 | const source = String(text || ''); |
| 279 | if (!source.trim()) { |
| 280 | return 0; |
| 281 | } |
| 282 | return Math.max(1, Math.ceil(source.length / 4)); |
| 283 | } |
| 284 | |
| 285 | function mergeEstimateParts(parts) { |
| 286 | const grouped = new Map(); |