GenerativeModel
Represents a multimodal model (like Gemini), capable of generating content based on various input types.
On Android the model also takes an android.graphics.Bitmap prompt in generateContent, generateContentStream and countTokens; send images as InlineDataParts in common code.
Represents a multimodal model (like Gemini), capable of generating content based on various input types.
On Android the model also takes an android.graphics.Bitmap prompt in generateContent, generateContentStream and countTokens; send images as InlineDataParts in common code.
A model of the cloud backend, over the platform SDK. The platforms other than Android have no on-device model (as Android without the firebase-ai-ondevice library): OnDeviceConfig modes that prefer one of the two fall back to the cloud, ONLY_ON_DEVICE fails with FirebaseAIOnDeviceNotAvailableException, and onDeviceExtension is null.
Properties
The extension for on-device inference, when the model was created with an OnDeviceConfig.
The extension for on-device inference, when the model was created with an OnDeviceConfig.
The extension for on-device inference, when the model was created with an OnDeviceConfig.
Functions
Counts the number of tokens in a text prompt using the model's tokenizer.
Counts the number of tokens in a prompt using the model's tokenizer.
Counts the number of tokens in a text prompt using the model's tokenizer.
Counts the number of tokens in a prompt using the model's tokenizer.
Counts the number of tokens in a text prompt using the model's tokenizer.
Counts the number of tokens in a prompt using the model's tokenizer.
Generates new content from the text input given to the model as a prompt.
Generates new content from the input Content given to the model as a prompt.
Generates new content from the text input given to the model as a prompt.
Generates new content from the input Content given to the model as a prompt.
Generates new content from the text input given to the model as a prompt.
Generates new content from the input Content given to the model as a prompt.
Generates new content as a stream from the text input given to the model as a prompt.
Generates new content as a stream from the input Content given to the model as a prompt.
Generates new content as a stream from the text input given to the model as a prompt.
Generates new content as a stream from the input Content given to the model as a prompt.
Generates new content as a stream from the text input given to the model as a prompt.
Generates new content as a stream from the input Content given to the model as a prompt.
Generates an object from the text input given to the model as a prompt.
Generates an object from the input Content given to the model as a prompt.
Generates an object from the text input given to the model as a prompt.
Generates an object from the input Content given to the model as a prompt.
Generates an object from the text input given to the model as a prompt.
Generates an object from the input Content given to the model as a prompt.