(txt: string)
| 199 | const enc = getEncoding('gpt2'); |
| 200 | |
| 201 | export function countStringTokens(txt: string) { |
| 202 | // Tokenize the content |
| 203 | const content = enc.encode(txt); |
| 204 | return content.length; |
| 205 | } |
| 206 | |
| 207 | function countChatTokens( |
| 208 | chatMessages: ( |
no outgoing calls
no test coverage detected