Models
Gemini - AI Studio
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
Parameter | Type | Default | Description |
---|---|---|---|
id | str | "gemini-2.0-flash-exp" | The specific Gemini model ID to use. |
name | str | "Gemini" | The name of this Gemini model instance. |
provider | str | "Google" | The provider of the model. |
function_declarations | Optional[List[FunctionDeclaration]] | None | List of function declarations for the model. |
generation_config | Optional[Any] | None | Configuration for text generation. |
safety_settings | Optional[Any] | None | Safety settings for the model. |
generative_model_kwargs | Optional[Dict[str, Any]] | None | Additional keyword arguments for the generative model. |
api_key | Optional[str] | None | API key for authentication. |
client_params | Optional[Dict[str, Any]] | None | Additional parameters for the client. |
client | Optional[GenerativeModel] | None | The underlying generative model client. |
Gemini
is a subclass of the Model class and has access to the same params.