( content: string, bytesPerToken: number = 4, )
| 213 | } |
| 214 | |
| 215 | export function roughTokenCountEstimation( |
| 216 | content: string, |
| 217 | bytesPerToken: number = 4, |
| 218 | ): number { |
| 219 | return Math.round(content.length / bytesPerToken) |
| 220 | } |
| 221 | |
| 222 | /** |
| 223 | * Returns an estimated bytes-per-token ratio for a given file extension. |
no outgoing calls
no test coverage detected