estimate_token: Estimate token count

View source: R/utils.r

estimate_tokenR 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")

askgpt documentation built on Sept. 8, 2023, 5:42 p.m.