From the course: Advanced Gemini API for Integration

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Prompting with files

Prompting with files

- [Instructor] Now that we understand and have demonstrated the process of uploading files to the Gemini Cloud, using the Gemini file API, let's now see how we can make use of the data that is returned in prompting our Gemini model. As at the time of this recording, prompting Gemini with file URLs is not natively supported on the restful API. Thus, we'll be continuing with our node JS project in order to use the client SDK to send our file based prompt. We'll be writing another script that will take in our file URL and the file mime type and use it to prompt the Gemini API. So here in VS Code, let's create a new file. I'm going to be calling the file "fileprompt.js". This file will contain our no JS script for prompting Gemini with our file URL returned from the file API. Inside the file, we start by bringing in the Google Generative AI library. This will give us access to the Google Generative AI class. Next we get the file URL and the file mime type as arguments from our command…

Contents