gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
33.41k stars 2.53k forks source link

Allow downloading Chatbot content as a PDF #5405

Closed 0xSynapse closed 10 months ago

0xSynapse commented 1 year ago

I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe.
add a feature in gr.chatbot that in chatbot frame there will be a download button in the corner as share button is there rn to download a particular conversation between user and bot as pdf.

Describe the solution you'd like
using pypdf lib I have created a function to do the similar and implemented that in a gr.button by passing the function. but I want to add that in gr.chatbot as a parameter itself so anyone can enable that using calling that feature and setting that to true or false. and it should be in the chatbot corner itself not a separate button.

if possible I want to work on this feature if you allow me to do so, and if it's already available then sorry I am not able to find that and please guide me on how to implement the same.

Additional context
Screenshot 2023-09-03 124145 Screenshot 2023-09-03 124237

abidlabs commented 1 year ago

Hi @0xSynapse thanks for creating the issue. We wouldn't want to add another dependency to gradio so I don't see this as a feature we'd add to gradio core. Probably makes more sense as a custom component, which we are working on enabling in Gradio 4.0. I'll label this issue to reflect that.

0xSynapse commented 1 year ago

Thanks. yeah, I agree it makes more sense if you add it as a component... I want to work on this issue if you allow me and guide me a bit... I would love to be a part of gradio.

abidlabs commented 11 months ago

Hey! We've now made it possible for Gradio users to create their own custom components -- meaning that you can write some Python and JavaScript (Svelte), and publish it as a Gradio component. You can use it in your own Gradio apps, or share it so that anyone can use it in their Gradio apps. Here are some examples of custom Gradio components:

You can see the source code for those components by clicking the "Files" icon and then clicking "src". The complete source code for the backend and frontend is visible. In particular, its very fast if you want to build off an existing component. We've put together a Guide: https://www.gradio.app/guides/five-minute-guide, and we're happy to help. Hopefully this will help address this issue.

abidlabs commented 10 months ago

I'll go ahead and close this issue since we are not planning to include this in the core Gradio library. But happy to help if you are interested in making this a custom Gradio component (feel free to ask questions in this issue).

0xSynapse commented 10 months ago

love to make a custom gradio component with your guidance sir !!!