IGenerativeModelCountTokensAsync(CountTokensRequest) Method
Counts tokens asynchronously based on the provided request.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
Task<CountTokensResponse> CountTokensAsync(
CountTokensRequest request
)
- request CountTokensRequest
- An instance of CountTokensRequest containing the details of contents or generation parameters for counting tokens.
TaskCountTokensResponseA task that represents the asynchronous operation, containing a
CountTokensResponse with the token count details.