countTokens
abstract fun countTokens(text: String, token: CancellationToken = definedExternally): PromiseLike<JsInt>(source)
Count the number of tokens in a message using the model specific tokenizer-logic.
Parameters
text
A string or a message instance.
token
Optional cancellation token. See CancellationTokenSource for how to create one.
abstract fun countTokens(text: LanguageModelChatMessage, token: CancellationToken = definedExternally): PromiseLike<JsInt>(source)