When using node.js code generated by AI Studio
Having developed a prompt using audio file input, and having it work in AI Studio, I gathered the JavaScript code provided and proceeded to run in VSCode IDE on Windows. With a Key obtained, SDK and “npm install @google/generative-ai” run, I get the error
“Package subpath ‘./files’ is not defined by “exports” in "
The AI Studio generated code causing the error is
“const { GoogleAIFileManager } = require(”@google/generative-ai/files”);"
on searching for the relative or absolute path to “\files”, find it does not exist in “node_modules@google\generative-ai”
As a result I cannot upload an audiofile to Gemini.
The API documentation is scant on the audiofile upload documentation (It covers text and image and video.) Any ideas where the missing part of the library is?