Use Google’s AI Studio to access the Gemini and Gemma models.

Authentication

Set your GOOGLE_API_KEY environment variable. You can get one from Google here.

Example

Use Gemini with your Agent:

Params

ParameterTypeDefaultDescription
idstr"gemini-1.5-flash"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.
api_keyOptional[str]NoneAPI key for authentication.
client_paramsOptional[Dict[str, Any]]NoneAdditional parameters for the client.
clientOptional[GenerativeModel]NoneThe underlying generative model client.