Echoshard / Gemini_Discordbot

A Gemini Discord bot that can accept images and has conversation memory
MIT License
67 stars 38 forks source link

File attachment support (outside of images) #11

Closed Spicytin closed 1 month ago

Spicytin commented 6 months ago

Recently Google updated the Gemini API in AI studio to support files (e.g: PDFs) other than images. Is it possible to add this to your bot? since one time ago before the update was released, I tried to add pdf/txt support to your code with Bard/Gemini's help but it failed.

Echoshard commented 6 months ago

I will be working on this this weekend along with the threads request I saw. I have had trouble with file upload so far

simplifyme7 commented 2 months ago

Any updates? In my use case, users will likely upload very long text messages which automatically become .txt files on Discord. Although the bot recognizes and does in fact start typing, after some time, the typing just stops and there is no response. Would love if .txt and .pdf files would just work as smoothly as text and images do.

Appreciate the work, you helped me out so much with this!

hihumanzone commented 1 month ago

Recently Google updated the Gemini API in AI studio to support files (e.g: PDFs) other than images. Is it possible to add this to your bot? since one time ago before the update was released, I tried to add pdf/txt support to your code with Bard/Gemini's help but it failed.

Looking at the supported file formats mentioned here: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=python. It seems that PDFs are not supported.

Echoshard commented 1 month ago

Recently Google updated the Gemini API in AI studio to support files (e.g: PDFs) other than images. Is it possible to add this to your bot? since one time ago before the update was released, I tried to add pdf/txt support to your code with Bard/Gemini's help but it failed.

Looking at the supported file formats mentioned here: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=python. It seems that PDFs are not supported.

Cause it's discord I don't think I will actually use the file API. Instead I will just support PDF (Then just convert them to text) and text files.

I will be adding web scraping and you tube summary from the transcript.

hihumanzone commented 1 month ago

Looking at the supported file formats mentioned here: https://ai.google.dev/gemini-api/docs/prompting_with_media?lang=python. It seems that PDFs are not supported.

Cause it's discord I don't think I will actually use the file API. Instead I will just support PDF (Then just convert them to text) and text files.

I will be adding web scraping and you tube summary from the transcript.

Ohk, cool. that works too. Thank you!

simplifyme7 commented 1 month ago

Cause it's discord I don't think I will actually use the file API. Instead I will just support PDF (Then just convert them to text) and text files.

I will be adding web scraping and you tube summary from the transcript.

Alright, that's perfect. Thanks a lot!

Echoshard commented 1 month ago

@SimplifyMe69 @hihumanzone @Spicytin I updated it so you should have everything you need!