![]() |
Calls the API to count the number of tokens in the text prompt.
google.generativeai.count_text_tokens(
model: model_types.AnyModelNameOptions,
prompt: str,
client: (glm.TextServiceClient | None) = None,
request_options: (helper_types.RequestOptionsType | None) = None
) -> text_types.TokenCount