generative-ai-js icon indicating copy to clipboard operation
generative-ai-js copied to clipboard

refactor: update uploadFile method to accept both file paths and Buffers

Open Maged-Zaki opened this issue 1 year ago • 0 comments

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.

Maged-Zaki avatar Jul 02 '24 20:07 Maged-Zaki