PromptTokenizer

An interface that provides utilities for tokenizing and calculating token usage in messages and prompts.

Inheritors

Functions

Link copied to clipboard
abstract fun tokenCountFor(prompt: Prompt): Int

Calculates the total number of tokens spent in a given prompt.

abstract fun tokenCountFor(message: Message): Int

Calculates the number of tokens required for a given message.