Gemini

Description

The Gemini component allows you to use Gemini with VQA (Visual Question Answering) functionality. You can do the following:

Get responses based on user messages

• Specify a model and input system instructions and user messages to get responses.

Get responses from analyzing photos or video files

• Specify photos or video files and a model with system instructions and user messages to get responses from analyzing the photos or videos.

Output PayloadDescription
cv.PayloadOutputs the response from Gemini.

Component Properties

Property NameDescription
ModelSelect the model to use from gemini-2.0-flash, gemini-2.0-flash-lite
System InstructionsSpecify system instructions for Gemini
User MessageEnter prompts or questions for Gemini
File NameSpecify files for Gemini to analyze. Multiple files can be specified by separating with commas
File MIME TypeMIME type of files to upload. Multiple file MIME types can be specified by separating with commas
Delete Upload FilesSpecify to delete files after uploading to Gemini
Conversation HistoryProvides a JSON array representing previous conversation turns
Response MIME TypeMIME type of response from Gemini. Specify either text/plain or application/json
Max TokensSets the maximum number of tokens allowed in the generated response
TemperatureSpecifies the randomness and creativity of Gemini's response in the range of 0.0 to 2.0
TopPSpecifies nucleus sampling in the range of 0.0 to 1.0. Affects the diversity of generated text
Stop SequenceDefines a list of strings (words or phrases) in JSON format that cause Gemini to stop generating text
Safety SettingsSets the level of content filtering. Helps prevent generation of potentially harmful or sensitive content
TimeoutHTTP request response timeout value
API KeySpecify the API key to use Gemini

Component Variables

Component VariableDescription
cv.ConversationHistoryJSON of conversation history. Can be used as input to Gemini component in subsequent calls to maintain conversation context
cv.FinishReasonsIndicates why the model stopped generating tokens. Useful for debugging or understanding model behavior
cv.UploadedFileURIList of URIs of successfully uploaded files
cv.UploadedMIMETypeList of MIME types corresponding to uploaded files