generative-ai-python

google.generativeai.protos.CountTextTokensResponse

A response from CountTextTokens.

It returns the model’s token_count for the prompt.

`token_count` `int` The number of tokens that the ``model`` tokenizes the ``prompt`` into. Always non-negative.