GenerativeModelCountTokensAsync Method

Overload List

CountTokensAsync(CountTokensRequest) Counts tokens asynchronously based on the provided request.
CountTokensAsync(GenerateContentRequest) Counts the number of tokens in the content based on the provided GenerateContentRequest.
CountTokensAsync(IEnumerableContent) Asynchronously counts the tokens in the given contents.
CountTokensAsync(IEnumerablePart) Asynchronously counts the tokens in the provided collection of parts.
CountTokensAsync(String, CountTokensRequest) Counts the number of tokens in a given input using the provided model and request.

See Also