Customized Gemini with context

Hi All, I tried several things already:

  • NotebookLM works perfect for uploading files, sources and it will return a lot of information based on those sources
  • I can also upload a lot of files to a chat in Gemini and ask to use those sources as context, this also works fine.
  • I can also create a Gem, set a goal. To brainstorm with users to get a desired output.
  • I also tried AI Studio, which also works OK, but I need to create some first steps for the user to upload context / sources and so on.

With all things I tried, I can get a solution for myself, or sometimes for users within my organization. But what if I want to develop a customized Gem or Gemini chat for anyone who registers? I am familiar with Firebase, so I could develop it on the Firebase platform and also in Firebase Studio.

But my limitations at this moment are that I didn’t find a solution at this moment to upload sources, files, text and a desired result (output form).

Please let me know if you have any ideas.

1 Like

The documentation is your friend: Files API  |  Gemini API  |  Google AI for Developers

1 Like

Hi Richard,

Thanks for your reply. So the solution would be that for every session, I develop a initiation session, where the code uploads the files and sends instructions, all through the API.

The final step would be to send a message to the user: I have set everything up, good luck!

I also saw in AI Studio that you can branch a chat. Would it also be possible to use the API to a specific branch?

Regards Peter

If you want Gemini to read files then you have to use the FileAPI to upload them. Then you can feed the list of URLs to Gemini along with how you want them analyzed. If the files are small (less than 20MB) you could use base64 them and send them in the context. Personally, I wouldn’t, but you can.

But yes, your thinking is right - upload the files as stage 1 then pass the file details with the prompt as stage 2. From a user perspective, this can be a single step though.