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

Gradio chat UI: Have 2 levels of examples #9689

Closed
1 task done
david-thrower opened this issue Oct 13, 2024 · 1 comment
Closed
1 task done

Gradio chat UI: Have 2 levels of examples #9689

david-thrower opened this issue Oct 13, 2024 · 1 comment

Comments

@david-thrower
Copy link

david-thrower commented Oct 13, 2024

  • I have searched to see if a similar issue already exists.

Is your feature request related to a problem? Please describe. Yes

In legacy versions of the Gradio chat UI, example buttons were displayed below the chat prompt field. These buttons were persistent and could be clicked multiple times during a conversation. However, in the current version of the chat UI, example buttons are displayed above the chat prompt field and are not practical to use you have started the conversation.

While the current implementation is suitable for some use cases, it is not ideal for others. For example, in our use case, we have a robot that guides users through a complex process by asking a series of 20 or so mostly closed-ended questions. The persistent example buttons in the legacy chat UI were helpful for quickly selecting the appropriate response without writing "No" | "Yes" repeatedly, and facilitating consistency in how answers were worded so we can eliminate that variable from the list of insults to accuracy.

Describe the solution you'd like

To address this issue, I propose keeping the "examples" as it is in the newer version and adding a new parameter to the gr.ChatInterface constructor, called answers. This parameter would allow users to specify a list of template responses that can be used [repeatedly] at any point during the conversation. These template responses would be displayed as persistent buttons below the chat prompt field, similar to the example buttons in the legacy versions of the chat UI.

Here is an example of how the answers parameter could be used:

gr.ChatInterface(
    ...
    answers=["No", "Yes mild issue", "Yes serious issue",  "I'm nor sure"]
)

This would display four persistent buttons below the chat prompt field, labeled"No", "Yes mild issue", "Yes serious issue", and "I'm nor sure" Users could click these buttons at any point during the conversation to quickly insert the corresponding template response into the chat prompt field.

@abidlabs
Copy link
Member

Hi @david-thrower thanks for creating this issue. That's an interesting use of examples for sure, but one that was "unintentionally supported in 4.x". We've intentionally redesigned examples to follow this format, and instead will try to support the use case you are describing via #4763

@abidlabs abidlabs closed this as not planned Won't fix, can't repro, duplicate, stale Oct 15, 2024
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

No branches or pull requests

2 participants