-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add allow_file_downloads
param to allow downloading image/video/audio media in chatbot
#9905
base: main
Are you sure you want to change the base?
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/36266906f8b4253cc5b6d920d5b54b7d19641291/gradio-5.5.0-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@36266906f8b4253cc5b6d920d5b54b7d19641291#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/36266906f8b4253cc5b6d920d5b54b7d19641291/gradio-client-1.7.1.tgz Use Lite from this PR <script type="module" src="https://gradio-lite-previews.s3.amazonaws.com/36266906f8b4253cc5b6d920d5b54b7d19641291/dist/lite.js""></script> |
🦄 change detectedThis Pull Request includes changes to the following packages.
With the following changelog entry.
Maintainers or the PR author can modify the PR title to modify this entry.
|
padding: var(--spacing-sm) var(--spacing-xl); | ||
border-color: var(--border-color-accent-subdued); | ||
background-color: var(--color-accent-soft); | ||
} | ||
@media (max-width: 480px) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't need this, dupe of .user earlier in the file
title={message.metadata.title} | ||
expanded={is_last_bot_message([message], value)} | ||
> | ||
<div class="message-content"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to apply padding only to text message content
name="Chatbot with copy button" | ||
args={{ | ||
show_copy_button: true | ||
}} | ||
/> | ||
|
||
<Story | ||
name="Chatbot with chat bubble full width disabled" | ||
args={{ | ||
bubble_full_width: false | ||
}} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removing these stories and consolidating their variants with other stories to reduce snapshot usage
Nice! Is it possible to respect the show_download_button parameter passed to the component instead of adding a component to the chatbot? I'm confused as to why the download button shows up when passed to the component but only when like/dislike is enabled (quoting from the issue - haven't verified!) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for reviewing @freddyaboulton and @aliabid94!
Yeah I forgot about it in the lower panel! It seems our logic to check when to show the panel ( |
…o into chatbot-allow-downloads
Description
We were never (iiuc) showing the download button in media messages in chatbot. I'e added an
allow_file_downloads
(default is false) param in case it's not actually wanted by certain users. Let me know if there's a better solution here!I've also tweaked the padding so that components dont have an unnecessary padding that only text needs (see screenshot).
Closes: #9217
🎯 PRs Should Target Issues
Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.
Not adhering to this guideline will result in the PR being closed.
Tests
PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests:
bash scripts/run_all_tests.sh
You may need to run the linters:
bash scripts/format_backend.sh
andbash scripts/format_frontend.sh