count_text_tokens

count_text_tokens(content: str | list[dict[str, Any] | str] | None) -> int

Calculates the number of text tokens in the given message content.

Parameters:
NameDescription
contentThe message content to calculate the number of text tokens for.

Type: str | list[dict[str, typing.Any] | str] | None