(modelName: ModelName, text: string)
| 139 | } |
| 140 | |
| 141 | function buildCacheKey(modelName: ModelName, text: string): string { |
| 142 | const checksum = CRC32.str(text); |
| 143 | return `${modelName}:${checksum}:${text.length}`; |
| 144 | } |
| 145 | |
| 146 | async function countTokensInternal(modelName: ModelName, text: string): Promise<number> { |
| 147 | assert(typeof text === "string", "Tokenizer countTokens expects string input"); |
no outgoing calls
no test coverage detected