Skip to content
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

Implement simple gradio demo app to showcase Vanna #1

Draft
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

andreped
Copy link

⚠️ This PR is a WIP ⚠️

I only made it a draft to discuss some implementation ideas.

@zainhoda
Copy link
Contributor

zainhoda commented Mar 2, 2024

Thanks!! I couldn't find any documentation on this but is it possible to get the Plotly chart to display as part of the Gradio chatbot interface?

@andreped
Copy link
Author

andreped commented Mar 12, 2024

is it possible to get the Plotly chart to display as part of the Gradio chatbot interface?

Sorry, I have been on holiday and I am returning back to work from tomorrow.

Before I left, I looked into embedding non-text widgets inside Gradio's ChatBot widget. I was surprised to learn that the widget only support static items.

You can display figures if you save them as image files on disk. This I managed to get working, but I am not sure this is what we want.

If we want a similar chat UI feeling as Streamlit offers, we either need to use a custom chatbot widget, implement our own container widget and see if we can add widgets similarly to a chatbot, or we have to go away from a typical chatbot flow, with different views for different scenarios in the prompt-completion flow.

What do you think?


EDIT: Note that it is possible to render plotly stuff using gradio.Plot (see here), but I am unable to add it to the gradio.Chatbot widget similarly as done with text or static images, which is unfortunate. But if it is OK to have this figure static, that is a potential workaround.

Gonna be impossible to add a way to change the generated SQL query code directly in the gradio.Chatbot widget though.

@andreped
Copy link
Author

Made some progress on the proposed solution above.

I will be in transit for the rest of the day, but I can pick this up tomorrow and hopefully finish the draft :]

Screenshot 2024-03-12 at 15 19 56

@andreped
Copy link
Author

Made some more progress. But now I am losing internet access on the airplane, so will have to wait till tomorrow...

Screenshot 2024-03-12 at 19 58 59

@zainhoda
Copy link
Contributor

This looks really really good! Is it ready to merge? I'd love to try this out

@andreped
Copy link
Author

This looks really really good! Is it ready to merge? I'd love to try this out

@zainhoda No, not yet. I got a bit busy with finalising my thesis work. Im submitting my PhD thesis at the end of April, but I can take a look at this again after Easter. Stay tuned! :]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants