As a proud LTD member, I’m embarking on my first project and am in the learning phase.
I’ve resorted to using a custom JavaScript node to monitor files within a specific folder because I haven’t found an existing node that meets this need. There seems to be a node that monitors new files across all folders simultaneously, but not one for a specific folder (though I could be mistaken).
Here’s the issue:
I’m attempting to pass a file (pdf and jpg) to the Gemini node for analysis, but it consistently indicates that no file is attached. My attempts have included various methods:
URL
Download URL
Sharing URL
Downloading the file prior to inputting it into the Gemini node
My objectives are:
To deposit a file into a directory labeled ‘invoice’
To process it with Gemini for analysis
To create a JSON with specific extracted values (this is functional)
To dynamically write the extracted data into the correct column and sheet for accounting purposes (there are multiple sheets for each month, and this is functional)
To move the file into a dynamically selected folder named after the month for classification purposes (this is functional)
To remove the original file from the upload directory (this is functional)
Currently, the sole issue is transmitting the file to Gemini. It seems like it shouldn’t be a complex task, yet my approach might be flawed. Providing the file’s URL isn’t an option. I’ve even tried a custom Gemini node where I authenticate directly with Google Drive to retrieve the file within the same node, but to no avail.
Additionally, it would be beneficial to integrate the google/gemini-flash-1.5-8b model into the Gemini node, as it’s a remarkably swift model.
Could you please share which Gemini nodes you’re using? Are you working with one of our no-code nodes, or are you accessing their API through an HTTP request?
I am currently using the file analysis with Gemini, the module you provided. I’ve also attempted to integrate it into a custom JavaScript without success.
I am now attempting to implement it using a custom JavaScript based on the openrouter service; I’ll see how it progresses.
Thank you for your response. Is it possible to accomplish this with a Google Drive file? I would like the user to be able to drop the file into a Google Drive folder from their iPhone, and then have it processed automatically.
Add a trigger for new files in Google Drive > insert the file ID into the download file action > send the content to Gemini. This seems like a logical solution
Latenode supports multiple triggers, so this scenario is feasible, and your triggers won’t interfere with each other
You can simply filter these values because the trigger also receives the folder ID in the “parents” path where the file was uploaded—here’s how it will look.
Thank you for your suggestion; it seems like it will work. However, if there are multiple file transfers to that drive, it will trigger for every new file, potentially leading to excessive credit consumption for files that are not of interest to me.
I have found the issue with the Gemini analysis file. The Gemini 1.5 Flash does not process the file properly, whereas the Pro version 1.5 does.
You should consider adding the following model to the list: Gemini 1.5 Flash-8B. This version can process files more quickly and is also less expensive than pro.
With this model, I can manually trigger when I want to pull information with my custom node, without incurring credits for files outside my desired folder.
If you can provide that model, I will be an happy guy!
P.S.: I discovered that my module was retrieving files from the folder that were in the trash, which is why the model was never accessing the correct file. It selected the first file in the list, which was deleted but still in the trash, and consequently, the Gemini module reported that the file did not exist, which was accurate.
Just a thought, but with the LN limitation of file uploads, you could create a 2 step solution in Zapier using their free account to monitor the folder and send a HTTP request to a LN webhook trigger.