GoogleLLM
Google Gemini LLM provider. Supports both the Gemini API (viaapiKey) and Vertex AI (set vertexai: true
with projectId and service-account credentials).
Constructor
Google AI (Gemini) API key. Falls back to the
GOOGLE_API_KEY environment variable, then null. Not used for Vertex AI auth.Gemini model id. Default
'gemini-2.5-flash-lite'.Sampling temperature controlling randomness. Default
0.7.Maximum number of tokens to generate in the response. Default
8192.Token budget for Gemini “thinking” (reasoning).
0 disables thinking. Default 0.Whether to include the model’s thought/reasoning content in responses. Default
false.Gemini safety/content-filter settings, as an array of category/threshold maps. Default
null (provider defaults).Nucleus sampling probability mass. Default
null (model default).Top-K sampling cutoff. Default
null (model default).Presence penalty discouraging repeated topics. Default
null (model default).Frequency penalty discouraging repeated tokens. Default
null (model default).Seed for reproducible sampling. Default
null (non-deterministic).Route requests through Vertex AI instead of the Gemini API. When
true, projectId is required. Default false.Google Cloud project id for Vertex AI auth. Required when
vertexai is true; falls back to GOOGLE_CLOUD_PROJECT. Default null.Vertex AI region. Default
'us-central1'. Only used when vertexai is true.Vertex AI service-account credentials, as a JSON string or parsed object. Used when
vertexai is true. Default null.Path to a Vertex AI service-account JSON file. Used when
vertexai is true; falls back to GOOGLE_APPLICATION_CREDENTIALS. Default null.