| GeminiProvider | R Documentation |
Provider class for Google Gemini.
specification_versionProvider spec version.
new()Initialize the Gemini provider.
GeminiProvider$new( api_key = NULL, base_url = NULL, headers = NULL, name = NULL, timeout_seconds = NULL, total_timeout_seconds = NULL, first_byte_timeout_seconds = NULL, connect_timeout_seconds = NULL, idle_timeout_seconds = NULL )
api_keyGemini API key. Defaults to GEMINI_API_KEY env var.
base_urlBase URL for API calls. Defaults to https://generativelanguage.googleapis.com/v1beta/models.
headersOptional additional headers.
nameOptional provider name override.
timeout_secondsLegacy alias for total_timeout_seconds.
total_timeout_secondsOptional total request timeout in seconds for API calls.
first_byte_timeout_secondsOptional time-to-first-byte timeout in seconds for API calls.
connect_timeout_secondsOptional connection-establishment timeout in seconds for API calls.
idle_timeout_secondsOptional stall timeout in seconds for API calls.
language_model()Create a language model.
GeminiProvider$language_model(
model_id = Sys.getenv("GEMINI_MODEL", "gemini-2.5-flash")
)model_idThe model ID (e.g., "gemini-1.5-pro", "gemini-1.5-flash", "gemini-2.0-flash").
A GeminiLanguageModel object.
image_model()Create an image model.
GeminiProvider$image_model(
model_id = Sys.getenv("GEMINI_IMAGE_MODEL", "gemini-2.5-flash-image")
)model_idThe model ID for image generation.
A GeminiImageModel object.
clone()The objects of this class are cloneable with this method.
GeminiProvider$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.