IGenerativeModelCountTokensAsync(IEnumerablePart) Method
Asynchronously counts the tokens in the provided collection of parts.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
Task<CountTokensResponse> CountTokensAsync(
IEnumerable<Part> parts
)
- parts IEnumerablePart
- A collection of Part objects representing the input data for token counting.
TaskCountTokensResponseA task representing the asynchronous operation, containing the
CountTokensResponse with the token counting results.