(model: string)
| 34 | |
| 35 | // "gpt-tokens" does not support new models. This is a temporary workaround. |
| 36 | function getSupportedModel(model: string): supportModelType { |
| 37 | const modelMapping: Record<string, supportModelType> = { |
| 38 | "gpt-4-0125-preview": "gpt-4-1106-preview", |
| 39 | "gpt-3.5-turbo-0125": "gpt-3.5-turbo-1106", |
| 40 | }; |
| 41 | |
| 42 | return modelMapping[model] || (model as supportModelType); |
| 43 | } |
| 44 | |
| 45 | export const countLlamaTokens = (input: string) => llamaTokenizer.encode(input).length; |
| 46 |
no outgoing calls
no test coverage detected