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

Make the accordion open by default if its the last message in the chatbot history #9081

Closed
1 task done
davidberenstein1957 opened this issue Aug 11, 2024 · 7 comments
Closed
1 task done
Labels
💬 Chatbot Related to the Chatbot component enhancement New feature or request

Comments

@davidberenstein1957
Copy link
Contributor

Describe the bug

The docs show different bahavior https://www.gradio.app/docs/gradio/chatbot#behavior

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

https://github.com/davidberenstein1957/data-viber/blob/main/README.md

from data_viber import AnnotatorInterFace

prompts = [
    [
        {
            "role": "user",
            "content": "Tell me something about Anthony Bourdain."
        },
        {
            "role": "assistant",
            "content": "Anthony Michael Bourdain was an American celebrity chef, author, and travel documentarian."
        }
    ]
]

interface = AnnotatorInterFace.for_chat_classification_per_message(
    prompts=prompts,
    labels=["toxic", "non-toxic"],
    fn=None, # a callable e.g. (function or transformers pipelines) that returns [{"label": str, "score": float}]
    dataset_name=None # "<my_hf_org>/<my_dataset>" if you want to log to the hub
)
interface.launch()

Screenshot

image

Logs

No response

System Info

MacOS 
Chromium
gradio                        4.22.0

Severity

I can work around it

@davidberenstein1957 davidberenstein1957 added the bug Something isn't working label Aug 11, 2024
@abidlabs
Copy link
Member

Hi @davidberenstein1957 sorry I didn't understand, can you elaborate what the issue is? In your screenshot, it looks like the accordion is expanded, no?

@davidberenstein1957
Copy link
Contributor Author

Hi @aliabid94, It is collapsed by default and according to the docs it should not be an accordion at all. I think having the accordion collapsed by default makes it a bit useless for chat interactionsbut I guess it inherits the behavior from the agent tool information accordion? Would it be possible to add an additional flag to the Metadata to control this? "expanded=True" or something?

@freddyaboulton
Copy link
Collaborator

ah the image linked in the docs is outdated, will fix. We designed the accordion for tool responses which is why they are closed by default. If you want to add a general title for your message, I think you can use include it as a markdown header in your response.

@davidberenstein1957
Copy link
Contributor Author

davidberenstein1957 commented Aug 13, 2024 via email

@abidlabs
Copy link
Member

abidlabs commented Aug 13, 2024

Slight tangent: but one thing that I think we should do is make the accordion open by default if its the last message in the chatbot history. That creates a nice effect that while a message is streaming, you can see the tool use, but once its finished, it doesn't take up unnecessary space. Not sure whether that would be sufficient for you @davidberenstein1957?

@davidberenstein1957
Copy link
Contributor Author

davidberenstein1957 commented Aug 14, 2024 via email

@abidlabs abidlabs changed the title Chatbot with ChatMessage with metadata.title is shown as collapsed accordion Make the accordion open by default if its the last message in the chatbot history Aug 21, 2024
@abidlabs abidlabs added enhancement New feature or request 💬 Chatbot Related to the Chatbot component and removed bug Something isn't working pending clarification labels Aug 21, 2024
@abidlabs
Copy link
Member

Closed via #9359

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

No branches or pull requests

3 participants