gradio
gradio copied to clipboard
Gradio components in `gr.Chatbot()`
Description
Use Image, Audio, Video, Gallery, and Plot components in the chatbot.
Closes: #(issue)
🎯 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
🪼 branch checks and previews
• | Name | Status | URL |
---|---|---|---|
Spaces | Spaces preview | ||
Website | Website preview | ||
Storybook | Storybook preview | ||
:unicorn: | Changes | Details |
Install Gradio from this PR
pip install https://gradio-builds.s3.amazonaws.com/a7ca1542cb43a1c6b49dfa23dd4be4ed6f1bd807/gradio-4.31.4-py3-none-any.whl
Install Gradio Python Client from this PR
pip install "gradio-client @ git+https://github.com/gradio-app/gradio@a7ca1542cb43a1c6b49dfa23dd4be4ed6f1bd807#subdirectory=client/python"
🦄 change detected
This Pull Request includes changes to the following packages.
Package | Version |
---|---|
@gradio/chatbot |
minor |
@gradio/image |
minor |
@gradio/multimodaltextbox |
minor |
@gradio/plot |
minor |
gradio |
minor |
- [ ] Maintainers can select this checkbox to manually select packages to update.
With the following changelog entry.
Gradio components in
gr.Chatbot()
Maintainers or the PR author can modify the PR title to modify this entry.
Something isn't right?
- Maintainers can change the version label to modify the version bump.
- If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.
@dawoodkhan82 Would be neat if there was added support for gradio.Dataframe
, gradio.Code
, and gradio.Button
as well, as our application needs it :] As a minimum, gradio.Dataframe
would be quite neat.
Could be done in a separate PR I suppose. Just throwing it out there, as you are already adding support for five of the most commonly used ones.
@andreped For sure, dataframe is already on the roadmap. Will look into adding additional components in a future PR.
Sorry should've commented earlier, but this seems a lot of custom code for each component. We should have a general approach that works for all components, rather than having to support each component one by one. We should also only import components "dynamically" if needed, rather than making chatbot have every other type of component as a dependency. Also think visually, Component outputs should not be in a bubble, but stand alone in their usual Block. Happy to sync on this to design a solution.