generative-ai-js
generative-ai-js copied to clipboard
refactor: update uploadFile method to accept both file paths and Buffers
The code was refactored to accept both file paths and Buffers as inputs for uploading files with metadata. This change improves flexibility by eliminating synchronous file reads and allowing the in-memory ready buffer to be given to the uploadFile method instead of forcing developers to write the file locally and then read it again.