public static int tokens(Encoding enc, String text) {
        return encode(enc, text).size();
    }
Calculate tokens of text information through Encoding.

@param enc  Encoding type
@param text Text information
@return Number of tokens
api/src/main/java/com/theokanning/openai/utils/TikTokensUtil.java