The Gemini model provides access to Google’s Gemini models.

ParameterTypeDefaultDescription
idstr"gemini-2.0-flash-exp"The specific Gemini model ID to use.
namestr"Gemini"The name of this Gemini model instance.
providerstr"Google"The provider of the model.
function_declarationsOptional[List[FunctionDeclaration]]NoneList of function declarations for the model.
generation_configOptional[Any]NoneConfiguration for text generation.
safety_settingsOptional[Any]NoneSafety settings for the model.
generative_model_kwargsOptional[Dict[str, Any]]NoneAdditional keyword arguments for the generative model.
groundingboolFalseWhether to use grounding.
searchboolFalseWhether to use search.
grounding_dynamic_thresholdOptional[float]NoneThe dynamic threshold for grounding.
api_keyOptional[str]NoneAPI key for authentication.
vertexaiboolFalseWhether to use Vertex AI instead of Google AI Studio.
project_idOptional[str]NoneGoogle Cloud project ID for Vertex AI.
locationOptional[str]NoneGoogle Cloud region for Vertex AI.
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for the client.
clientOptional[GeminiClient]NoneThe underlying generative model client.
temperatureOptional[float]NoneControls randomness in the output. Higher values (e.g., 0.8) make the output more random, while lower values (e.g., 0.2) make it more focused and deterministic.
top_pOptional[float]NoneNucleus sampling parameter. Only consider tokens whose cumulative probability exceeds this value.
top_kOptional[int]NoneOnly consider the top k tokens for text generation.
max_output_tokensOptional[int]NoneThe maximum number of tokens to generate in the response.
stop_sequencesOptional[list[str]]NoneList of sequences where the model should stop generating further tokens.
logprobsOptional[bool]NoneWhether to return log probabilities of the output tokens.
presence_penaltyOptional[float]NonePenalizes new tokens based on whether they appear in the text so far.
frequency_penaltyOptional[float]NonePenalizes new tokens based on their frequency in the text so far.
seedOptional[int]NoneRandom seed for deterministic text generation.
request_paramsOptional[Dict[str, Any]]NoneAdditional parameters for the request.