Send LLMMessage to Gemini API
gemini_chat(
.llm,
.model = "gemini-2.0-flash",
.fileid = NULL,
.temperature = NULL,
.max_output_tokens = NULL,
.top_p = NULL,
.top_k = NULL,
.grounding_threshold = NULL,
.presence_penalty = NULL,
.frequency_penalty = NULL,
.stop_sequences = NULL,
.safety_settings = NULL,
.json_schema = NULL,
.tools = NULL,
.timeout = 120,
.dry_run = FALSE,
.max_tries = 3,
.verbose = FALSE,
.stream = FALSE
)
A new LLMMessage
object containing the original messages plus the assistant's response.
An existing LLMMessage object or an initial text prompt.
The model identifier (default: "gemini-1.5-flash").
Optional vector of file IDs uploaded via gemini_upload_file()
(default: NULL).
Controls randomness in generation (default: NULL, range: 0.0-2.0).
Maximum tokens in the response (default: NULL).
Controls nucleus sampling (default: NULL, range: 0.0-1.0).
Controls diversity in token selection (default: NULL, range: 0 or more).
A grounding threshold between 0 and 1. With lower grounding thresholds Gemini will use Google to search for relevant information before answering. (default: NULL).
Penalizes new tokens (default: NULL, range: -2.0 to 2.0).
Penalizes frequent tokens (default: NULL, range: -2.0 to 2.0).
Optional character sequences to stop generation (default: NULL, up to 5).
A list of safety settings (default: NULL).
A schema to enforce an output structure
Either a single TOOL object or a list of TOOL objects representing the available functions for tool calls.
When should our connection time out (default: 120 seconds).
If TRUE, perform a dry run and return the request object.
Maximum retries to perform request (default: 3).
Should additional information be shown after the API call.
Should the response be streamed (default: FALSE).