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
Adds kwarg to disable html sanitization in gr.Chatbot()
#5304
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/cbbb9784aca375f58fe594d975a8f3dfe4aba697/gradio-3.41.2-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@cbbb9784aca375f58fe594d975a8f3dfe4aba697#subdirectory=client/python" |
🦄 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.
|
Will have to update this pr once #5279 is merged in. I can also add this kwarg to markdown and dataframe. |
gradio/components/chatbot.py
Outdated
@@ -76,6 +77,7 @@ def __init__( | |||
show_share_button: If True, will show a share icon in the corner of the component that allows user to share outputs to Hugging Face Spaces Discussions. If False, icon does not appear. If set to None (default behavior), then the icon appears if this Gradio app is launched on Spaces, but not otherwise. | |||
show_copy_button: If True, will show a copy button for each chatbot message. | |||
avatar_images: Tuple of two avatar image paths or URLs for user and bot (in that order). Pass None for either the user or bot image to skip. Must be within the working directory of the Gradio app or an external URL. | |||
disable_html_sanitization: If True, will disable HTML sanitization for chatbot messages. This is not recommended, as it can lead to security vulnerabilities. |
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.
disable_html_sanitization: If True, will disable HTML sanitization for chatbot messages. This is not recommended, as it can lead to security vulnerabilities. | |
disable_html_sanitization: If True, will disable HTML sanitization for chatbot messages. This is generally not recommended, as it can lead to cross-site scripting security vulnerabilities. |
Makes sense. Put a suggestion above as well |
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.
Agree with @abidlabs renaming suggestion. Otherwise this looks good to me!
* add chmod commands to grant execute permissions to each script before running them * increase the memory limit * Increase memory requirement to 8 * Setting a minimum specification for codespace machines
* add chmod commands to grant execute permissions to each script before running them * increase the memory limit * Increase memory requirement to 8 * Setting a minimum specification for codespace machines * Added label_angle parameter to LinePlot * add the x_label_angle and y_label_angle to the postprocess * Add x_label_angle and y_label_angle to ScatterPlot * Add x_label_angle and y_label_angle to BarPlot * Remove postCreateCommand update from this PR, it is in its own PR * Remove custumization on the devcontainer, it is on another PR * Remove extra line on the devcontainer, it is on another PR * add changeset * update the parameter definition in the docstring --------- Co-authored-by: Abubakar Abid <abubakar@huggingface.co> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* waveform res fix * add changeset * add changeset * Improve audio streaming (#5238) * changes * changes * add changeset * add changeset * chages * Update silver-clowns-brush.md * changes * chagers * changes * Update silver-clowns-brush.md * change * change --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: pngwn <hello@pngwn.io> * Tweaks to `icon` parameter in `gr.Button()` (#5285) * button * add changeset * fix * add changeset * add changeset * types * type fix * formatting * fix based on review * fix unit tests * stories --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> * test * test --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: aliabid94 <aabid94@gmail.com> Co-authored-by: pngwn <hello@pngwn.io> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* changes * changes * add changeset * add changeset * chages * Update silver-clowns-brush.md * changes * chagers * changes * Update silver-clowns-brush.md * change * change * change * changes * chages * changes * add changeset * changes * changes * changes --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: pngwn <hello@pngwn.io>
* changes * changes * remove languages from code docs * fix img path in guide * rework event listeners * add changeset * remove console log * name it event arguments * Update js/_website/src/lib/components/EventListeners.svelte Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * Update js/_website/src/lib/components/EventListeners.svelte Co-authored-by: Abubakar Abid <abubakar@huggingface.co> * requested changes --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* only start listening for events after the components are mounted * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* removes missing part of bottom border on file component * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* test test * fix test * tweak * tweak test name
* add json generation to prepare * add changeset * remove pnpm prepare * add changeset * bring back prepare, add ignore scripts * delete changeset * add to right commadn * add frozen lockfile to gh_action_pypi * remove unused gh_action_pypi script * remove unused scripts --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* ensure dropwdown stays open when new data is passed in * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* fix changelog generation * fix changelog generation * fix
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix changelog generation * fix changelog generation * fix * fix script
* fix changelog generation * fix changelog generation * fix * fix script * fix script
* fix changelog generation * fix changelog generation * fix * fix script * fix script * fix vars
* fix changelog generation * fix changelog generation * fix * fix script * fix script * fix vars * fix vars
* Fix bug * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
* changes * changes * add changeset * changes * changes * fix box changes on website * add changeset * changes * changes * Revert "changes" This reverts commit 189b4e8. * chanegs * changes * changes * changes * changes * add changeset * Update fancy-bats-deny.md --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: aliabd <ali.si3luwa@gmail.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
* fix: wrap avatar-image in a div to clip its shape and add data url support * add changeset * revert get file from data url * add changeset --------- Co-authored-by: Dawood Khan <dawoodkhan82@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
Adds kwarg to disable html sanitization in
gr.Chatbot()
Closes: #5078
🎯 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