compute Tokens
Computes the number of tokens for the given List
This method is not supported by the Gemini Developer API.
Return
A ComputeTokensResponse object containing the token information.
Parameters
The model to use for computing tokens.
The List
Optional configuration for computing tokens.
Throws
if called with a non-Gemini Enterprise Agent Platform (previously known as Vertex AI) client.
Computes the number of tokens for the provided Content object.
This method is not supported by the Gemini Developer API.
Return
A ComputeTokensResponse object containing the token information.
Parameters
The model to use for computing tokens.
The Content object to compute tokens for.
Optional configuration for computing tokens.
Throws
if called with a non-Gemini Enterprise Agent Platform (previously known as Vertex AI) client.
Computes the number of tokens for the provided text string.
This method is not supported by the Gemini Developer API.
Return
A ComputeTokensResponse object containing the token information.
Parameters
The model to use for computing tokens.
The text string to compute tokens for.
Optional configuration for computing tokens.
Throws
if called with a non-Gemini Enterprise Agent Platform (previously known as Vertex AI) client.