estimate_token {askgpt} | R Documentation |
Estimate token count
Description
Estimate token count
Usage
estimate_token(x, mult = 1.6)
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.
Value
a integer vector of token counts
Examples
estimate_token("this is a test")
[Package askgpt version 0.1.3 Index]