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 model ID used for generating responses.
namestr"Gemini"The name identifier for the agent.
providerstr"Google"The provider of the model.
function_declarationsOptional[List[FunctionDeclaration]]-A list of function declarations that the model can utilize during the response generation process.
generation_configOptional[Any]-Configuration settings for the generation process, such as parameters for controlling output behavior.
safety_settingsOptional[Any]-Settings related to safety measures, ensuring the generation of appropriate and safe content.
generative_model_kwargsOptional[Dict[str, Any]]-Additional keyword arguments for the generative model.
api_keyOptional[str]-The API key for authenticating requests to the Google AI Studio service.
client_paramsOptional[Dict[str, Any]]-Additional parameters for client configuration.
clientOptional[GenerativeModel]-A pre-configured instance of the Gemini client.