* Generic token estimation fallback
(text: string, avgCharsPerToken: number)
| 301 | * Generic token estimation fallback |
| 302 | */ |
| 303 | function estimateGenericTokens(text: string, avgCharsPerToken: number): number { |
| 304 | const charCount = text.trim().length |
| 305 | return Math.ceil(charCount / avgCharsPerToken) |
| 306 | } |
| 307 | |
| 308 | /** |
| 309 | * Estimates tokens for input content including context |
no outgoing calls
no test coverage detected