TokenCounter

class echo_artistry.services.TokenCounter(model_name='gpt-3.5-turbo-1106')

A class for counting tokens.

count_tokens(text)

Count the number of tokens in a text.

Parameters:

text (str) – The text to count the tokens of.

Returns:

The number of tokens in the text.

Return type:

int