View source: R/provider-google-upload.R
| google_upload | R Documentation |
This function uploads a file then waits for Gemini to finish processing it so that you can immediately use it in a prompt. It's experimental because it's currently Gemini specific, and we expect other providers to evolve similar feature in the future.
Uploaded files are automatically deleted after 2 days. Each file must be less than 2 GB and you can upload a total of 20 GB. ellmer doesn't currently provide a way to delete files early; please file an issue if this would be useful for you.
google_upload(
path,
base_url = "https://generativelanguage.googleapis.com/",
api_key = NULL,
credentials = NULL,
mime_type = NULL
)
path |
Path to a file to upload. |
base_url |
The base URL to the API endpoint. |
api_key |
|
credentials |
A function that returns a list of authentication headers
or |
mime_type |
Optionally, specify the mime type of the file. If not specified, will be guesses from the file extension. |
A <ContentUploaded> object that can be passed to $chat().
## Not run:
file <- google_upload("path/to/file.pdf")
chat <- chat_google_gemini()
chat$chat(file, "Give me a three paragraph summary of this PDF")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.