( content: string, bytesPerToken: number = 4, )
| 201 | } |
| 202 | |
| 203 | export function roughTokenCountEstimation( |
| 204 | content: string, |
| 205 | bytesPerToken: number = 4, |
| 206 | ): number { |
| 207 | return Math.round(content.length / bytesPerToken) |
| 208 | } |
| 209 | |
| 210 | /** |
| 211 | * Returns an estimated bytes-per-token ratio for a given file extension. |
no outgoing calls
no test coverage detected