Learn R Programming

askgpt (version 0.1.3)

estimate_token: Estimate token count

Description

Estimate token count

Usage

estimate_token(x, mult = 1.6)

Value

a integer vector of token counts

Arguments

x

character vector

mult

the multiplier used

Details

This function estimates how many tokens the API will make of the input words. For the models 1 word is more than one token. The default multiplier value resulted from testing the API. See <https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them> for more information.

Examples

Run this code
estimate_token("this is a test")

Run the code above in your browser using DataLab