View source: R/provider_gemini.R
| create_gemini | R Documentation |
Factory function to create a Gemini provider.
create_gemini(
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_key |
Gemini API key. Defaults to GEMINI_API_KEY env var. |
base_url |
Base URL for API calls. Defaults to https://generativelanguage.googleapis.com/v1beta/models. |
headers |
Optional additional headers. |
name |
Optional provider name override. |
timeout_seconds |
Legacy alias for |
total_timeout_seconds |
Optional total request timeout in seconds for API calls. |
first_byte_timeout_seconds |
Optional time-to-first-byte timeout in seconds for API calls. |
connect_timeout_seconds |
Optional connection-establishment timeout in seconds for API calls. |
idle_timeout_seconds |
Optional stall timeout in seconds for API calls. |
A GeminiProvider object.
gemini-3-pro-preview: Preview Gemini 3 Pro model for advanced reasoning, coding, multimodal understanding, and agentic workflows. (Reasoning, Vision, Tools, Audio, Structured, Search) | ctx: 1049k
gemini-3-pro-preview-customtools: Gemini 3 Pro Preview endpoint tuned for agentic workflows that combine bash-like and custom tools. (Reasoning, Vision, Tools, Audio, Structured, Search) | ctx: 1049k
gemini-3-flash-preview: Preview Gemini 3 Flash model for frontier-class performance at lower latency and cost. (Reasoning, Vision, Tools, Audio, Structured, Search) | ctx: 1049k
gemini-2.5-pro: Stable Gemini 2.5 Pro model for complex reasoning, coding, STEM, and long-context analysis. (Reasoning, Vision, Tools, Audio, Structured, Search) | ctx: 1049k
gemini-2.5-flash: Stable Gemini 2.5 Flash model for price-performance, low-latency, high-volume, and agentic tasks. (Reasoning, Vision, Tools, Audio, Structured, Search) | ctx: 1049k
gemini-2.5-flash-lite: Stable Gemini 2.5 Flash-Lite model for cost-efficient high-throughput multimodal tasks. (Reasoning, Vision, Tools, Audio, Structured, Search) | ctx: 1049k
gemini-2.0-flash: Deprecated Gemini 2.0 Flash model with 1M context; migrate to Gemini 3 Flash Preview or a newer model. (Vision, Tools, Audio, Structured, Search) | ctx: 1049k
gemini-2.0-flash-lite: Deprecated Gemini 2.0 Flash-Lite model; migrate to Gemini 2.5 Flash-Lite or a newer model. (Vision, Tools, Audio, Structured) | ctx: 1049k
gemini-3-pro-image-preview: Preview Gemini 3 Pro image generation and editing model for professional-grade visuals and accurate text rendering. (Reasoning, Vision, Image-Out, Image-Edit, Structured, Search) | ctx: 66k
gemini-2.5-flash-image: Stable Gemini 2.5 Flash image generation and conversational editing model for high-volume creative workflows. (Vision, Image-Out, Image-Edit, Structured) | ctx: 66k
if (interactive()) {
gemini <- create_gemini(api_key = "AIza...")
model <- gemini$language_model("gemini-2.5-flash")
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.