gemini_request | R Documentation |
Sends a POST request to the Gemini API with the specified URL and body, and returns the response as a character string.
gemini_request(url, body)
url |
Character. The Gemini API endpoint URL. |
body |
List. The request body to send as JSON. |
Character string containing the API response.
## Not run:
body <- list(contents = list(list(parts = list(list(text = "Hello!")))))
gemini_request(
paste0("https://generativelanguage.googleapis.com/v1beta/models/",
"gemini-2.5-flash-image-preview:generateContent"), body)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.