ContextWindow.overflow()

Calculate how many tokens over budget the text is.

Usage

Source

ContextWindow.overflow(text)

Parameters

text: str
Text to check.

Returns

int
Number of tokens over budget (0 if within budget).