-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Allow supplying custom gr.Chatbot
with events to gr.ChatInterface
#8677
Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-builds.s3.amazonaws.com/65dc93b2bdc1eca41daa08cbca588de1f0c10b8b/gradio-4.37.2-py3-none-any.whl Install Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@65dc93b2bdc1eca41daa08cbca588de1f0c10b8b#subdirectory=client/python" Install Gradio JS Client from this PR npm install https://gradio-builds.s3.amazonaws.com/65dc93b2bdc1eca41daa08cbca588de1f0c10b8b/gradio-client-1.2.1.tgz |
🦄 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.
|
gr.Chatbot
with events to gr.ChatInterface
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.
Nice fix @abidlabs !
@@ -136,6 +136,25 @@ gr.ChatInterface( | |||
|
|||
The placeholder appears vertically and horizontally centered in the chatbot. | |||
|
|||
If you would like to attach event listeners to your custom chatbot, wrap the chatbot as well as the `gr.ChatInterface` inside of a `gr.Blocks` like this: |
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.
feel like the "creating a chatbot fast" guide should be quick and sweet, this particular usecase doesn't seem common enough to be here.
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.
That's fair, this guide is getting quite bloated. It would be better to move this over to the docs page for gr.ChatInterface
. Let me do that
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.
LGTM!
gr.Chatbot
with events to gr.ChatInterface
gr.Chatbot
with events to gr.ChatInterface
Thanks folks! |
Fixes: #8675 so that now you can put a
gr.ChatInterface
inside agr.Blocks
with a customgr.Chatbot
and attach events, like this: