You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A possible fix would be to fall back to using the file extension if the MIME type not found, using https://www.npmjs.com/package/mime (lite version) which is really compact.
The issue is, Gemini AI is not in any way aware of the file extension (or even the file name at all, for that matter). This is by design, as Gemini AI was not supposed to read from files directly anyway (as that would require fs, thus involving a Node-only dep, causing browser incompatibility. In the past, we have considered dynamically importing fs, but that was just a mess)... however, what I can do is make it so that the user can manually specify a MIME type.
Activity
XInTheDark commentedon Jun 13, 2024
I have done some debugging and the issue is because
fileTypeFromBuffer(used in utils.ts) wrongly returnsundefinedon txt, mov, etc. files.XInTheDark commentedon Jun 13, 2024
A possible fix would be to fall back to using the file extension if the MIME type not found, using https://www.npmjs.com/package/mime (lite version) which is really compact.
EvanZhouDev commentedon Jun 24, 2024
The issue is, Gemini AI is not in any way aware of the file extension (or even the file name at all, for that matter). This is by design, as Gemini AI was not supposed to read from files directly anyway (as that would require
fs, thus involving a Node-only dep, causing browser incompatibility. In the past, we have considered dynamically importingfs, but that was just a mess)... however, what I can do is make it so that the user can manually specify a MIME type.