countTokens

Counts the number of tokens in a given text.

Return

A CountTokensResult containing the total number of tokens.

Parameters

contents

The contents to tokenize.

config

The configuration for counting tokens.


Counts the number of tokens in a list of content objects using default configuration.

Return

A CountTokensResult containing the total number of tokens.

Parameters

contents

The contents to tokenize.


Counts the number of tokens in a single content object.

Return

A CountTokensResult containing the total number of tokens.

Parameters

content

The content to tokenize.

config

The configuration for counting tokens.


Counts the number of tokens in a single content object using default configuration.

Return

A CountTokensResult containing the total number of tokens.

Parameters

content

The content to tokenize.


Counts the number of tokens in a text string.

Return

A CountTokensResult containing the total number of tokens.

Parameters

content

The text content to tokenize.

config

The configuration for counting tokens.


Counts the number of tokens in a text string using default configuration.

Return

A CountTokensResult containing the total number of tokens.

Parameters

content

The text content to tokenize.