The parameters for computing tokens.
The response from the API.
Counts the number of tokens in the given contents. Multimodal input is supported for Gemini models.
The parameters for counting tokens.
The response from the API.
Calculates embeddings for the given contents. Only text is supported.
The parameters for embedding contents.
The response from the API.
Makes an API request to generate content with a given model.
For the model
parameter, supported formats for Vertex AI API include:
/
separated publisher and model name, for example:
'google/gemini-2.0-flash' or 'meta/llama-3.1-405b-instruct-maas'For the model
parameter, supported formats for Gemini API include:
Some models support multimodal input and output.
The parameters for generating content.
The response from generating content.
Makes an API request to generate content with a given model and yields the response in chunks.
For the model
parameter, supported formats for Vertex AI API include:
/
separated publisher and model name, for example:
'google/gemini-2.0-flash' or 'meta/llama-3.1-405b-instruct-maas'For the model
parameter, supported formats for Gemini API include:
Some models support multimodal input and output.
The parameters for generating content with streaming response.
The response from generating content.
Generates an image based on a text description and configuration.
The parameters for generating images.
The response from the API.
Given a list of contents, returns a corresponding TokensInfo containing the list of tokens and list of token ids.
This method is not supported by the Gemini Developer API.