Options related to tokenization for a tool invocation.

Fields

tokenBudget:Int

If known, the maximum number of tokens the tool should emit in its result.

countTokens(text:String, ?token:CancellationToken):Thenable<Int>

Count the number of tokens in a message using the model specific tokenizer-logic. @link CancellationTokenSource} for how to create one.

Parameters:

text

A string.

token

Optional cancellation token. See {

Returns:

A thenable that resolves to the number of tokens.