gradio icon indicating copy to clipboard operation
gradio copied to clipboard

Gradio components in `gr.Chatbot()`

Open dawoodkhan82 opened this issue 2 months ago • 6 comments

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

  1. 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

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

dawoodkhan82 avatar Apr 25 '24 15:04 dawoodkhan82

🪼 branch checks and previews

• Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
Storybook ready! Storybook preview
:unicorn: Changes detected! 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"

gradio-pr-bot avatar Apr 29 '24 15:04 gradio-pr-bot

🦄 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.

gradio-pr-bot avatar Apr 29 '24 15:04 gradio-pr-bot

@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 avatar May 15 '24 20:05 andreped

@andreped For sure, dataframe is already on the roadmap. Will look into adding additional components in a future PR.

dawoodkhan82 avatar May 16 '24 00:05 dawoodkhan82

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.

aliabid94 avatar May 16 '24 20:05 aliabid94