IGenerativeModelCountTokensAsync(IEnumerableContent) Method
Asynchronously counts the tokens in the given contents.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
Task<CountTokensResponse> CountTokensAsync(
IEnumerable<Content> contents
)
- contents IEnumerableContent
- A collection of Content objects representing the input for which tokens need to be counted.
TaskCountTokensResponseA task representing the asynchronous operation, containing the
CountTokensResponse with the resulting token count.