@builder.io/dev-tools
Version:
Builder.io Visual CMS Devtools
9 lines (8 loc) • 405 B
TypeScript
/**
* Token estimation calculator for OpenAI API
* OpenAI api does not return usage information for some of its apis
* This function returns a rough estimate of the tokens used for a given string
* The function has been copied from webapp and written by @aziz
* Ref: https://github.com/BuilderIO/builder-internal/pull/5255/files
*/
export declare function estimateCodeTokens(text: string): number;