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

different 'display modes' for gr.Chatbot #5646

Closed
1 task done
pngwn opened this issue Sep 21, 2023 · 6 comments · Fixed by #5699
Closed
1 task done

different 'display modes' for gr.Chatbot #5646

pngwn opened this issue Sep 21, 2023 · 6 comments · Fixed by #5699
Assignees
Labels
enhancement New feature or request

Comments

@pngwn
Copy link
Member

pngwn commented Sep 21, 2023

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

Is your feature request related to a problem? Please describe.
Previously the Chatbot was more like a mobile message app with chat bubbles. With the popularity of LLMs we modified the design to be more suitable for long form text. However, in doping so we removed the old 'bubble' style in favour of the larger panels.

While LLMs are certainly ubiquitous, there are other uses for chatbots too and i would like us to bring back the bubble style in some form

Describe the solution you'd like
An option to enable 'bubbles' vs 'panels'. Maybe a new kwarg:

display_mode: Literal["bubbles", "panels"] = "panels"

Additional context
We've had a few rquests for this, i just can't find them.

@pngwn pngwn added the enhancement New feature or request label Sep 21, 2023
@pngwn pngwn added this to the Component Cleanup milestone Sep 21, 2023
@pngwn
Copy link
Member Author

pngwn commented Sep 21, 2023

We could also use this opportunity to clean up the design. Atm i think the chatbot is trying to be two things at once and doesn't quite work for either. This would allows us to tailor the design more carefully.

@hannahblair hannahblair self-assigned this Sep 21, 2023
@abidlabs
Copy link
Member

@pngwn @hannahblair this is already taken care of by #5334 right?

@hannahblair
Copy link
Collaborator

hannahblair commented Sep 22, 2023

@abidlabs this is actually more about switching between a conversation-like mode to an LLM mode - conversation mode displaying messages as speech bubbles with user and bot text being displayed on either side of the component (see example img) and the panel mode being displayed similar to that of chatgpt. We think there are different use cases for both designs and users might find this option valuable. Open to thoughts here! I have some improvements on chatbot raised in a separate branch so I picked this up since I'm working on it.

Screenshot 2023-09-22 at 14 46 00

vs
Screenshot 2023-09-22 at 14 32 57

@pngwn
Copy link
Member Author

pngwn commented Sep 22, 2023

Yeah. I don't think that PR really solves the core problem. Which in my opinion is that the chatbot is trying to be everything at once and not really succeeding at either. It is one of our most popular components at the minute but I think it lacks the polish of some of the others.

I think we should have explicit short /longform modes that go further than that PR from a design PoV. Whether or not we should reuse the same kwargs isn't something I've thought about.

@abidlabs
Copy link
Member

abidlabs commented Sep 22, 2023

Okay I can see some value in having a full panel layout, with a separate parameter (maybe: layout) to control it.

@gr1336
Copy link

gr1336 commented Sep 26, 2023

For an additional control for each message, i would also recommend changing the way that the messages are handled. This is a something that I had in mind:

# The old history style:
old_message_turn_style = [("User/Outgoing message", "AI/Incoming message")]

# A different way to handle each message/history:
new_message_turn_style = [
    {
        "message": "content", # The content of the message.
        "incoming": False, # This can be used to set the message balloon on the left or right side. Defaults to False.
        "entity": "Username", # The name of the entity that can be displayed below the image defined for it. It can default to 'None' so that no name would be displayed.
        "Image": "characters/user/def.png", # Where the image will be used in the current entity. The default is None. If 'avatar_images' has been defined, use it as the default.
        "colorset": ["#434343", "#FFFFFF"] # This option would be interesting to define a different background for different entities. If not defined, use the default turn colors.
    }
]
# Examples of messages, if only using the non-optional values:
minimal_history_from_new_turn_style = [
    {
        "message": "Hello, who are you?", #User's message
    },
    {
        "message": "Hello, I'm Gradio! How can I help you?", #AI's message
        "incoming": True
    },
]

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

Successfully merging a pull request may close this issue.

4 participants