Gemini is a platform for providing endpoints for Large Language models. See more information here.

We recommend experimenting to find the best-suited model for your use-case. Here are some general recommendations:

  • gemini-1.5-flash is good for most use-cases.
  • gemini-1.5-flash-8b is their most cost-effective model.
  • gemini-2.0-flash-exp is their strongest multi-modal model.

Authentication

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

Example

Use Gemini with your Agent:

View more examples here.

Params

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

Gemini is a subclass of the Model class and has access to the same params.