Skip to content

utils

dandy.llm.tokens.utils

get_estimated_token_count_for_string

Source code in dandy/llm/tokens/utils.py
def get_estimated_token_count_for_string(string: str) -> int:
    return int(len(string) / ESTIMATED_CHARACTERS_PER_TOKEN)