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

ChatInterface don't have 'retry_btn', 'undo_btn' and 'clear_btn' arguments #9917

Closed
1 task done
nmtan2001 opened this issue Nov 8, 2024 · 4 comments · Fixed by #9989
Closed
1 task done

ChatInterface don't have 'retry_btn', 'undo_btn' and 'clear_btn' arguments #9917

nmtan2001 opened this issue Nov 8, 2024 · 4 comments · Fixed by #9989
Assignees
Labels
bug Something isn't working docs/website Related to documentation or website

Comments

@nmtan2001
Copy link

Describe the bug

I tried the code example in
https://www.gradio.app/guides/creating-a-chatbot-fast#customizing-your-chatbot

which have

try_btn=None,
undo_btn="Delete Previous",
clear_btn="Clear",

all of these got error:
TypeError: ChatInterface.init() got an unexpected keyword argument 'retry_btn'

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

import gradio as gr

def yes_man(message, history):
    if message.endswith("?"):
        return "Yes"
    else:
        return "Ask me anything!"

gr.ChatInterface(
    yes_man,
    type="messages",
    chatbot=gr.Chatbot(height=300),
    textbox=gr.Textbox(placeholder="Ask me a yes or no question", container=False, scale=7),
    title="Yes Man",
    description="Ask Yes Man any question",
    theme="soft",
    examples=[{"text": "Hello"}, {"text": "Am I cool?"}, {"text": "Are tomatoes vegetables?"}],
    cache_examples=True,
    retry_btn=None,
    # undo_btn="Delete Previous",
    # clear_btn="Clear",
).launch()

Screenshot

image

Logs

No response

System Info

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 5.3.0
gradio_client version: 1.4.2

Severity

I can work around it

@nmtan2001 nmtan2001 added the bug Something isn't working label Nov 8, 2024
@abidlabs abidlabs added the docs/website Related to documentation or website label Nov 8, 2024
@pabl-o-ce
Copy link

The new version docs it seems that there is no more this options and buttons in the UI.
They choose more minimalist style

@programmer-ke
Copy link

programmer-ke commented Nov 11, 2024

There also seem to be other related issues with the example.

I had to set type on the chatbot parameter for the example to run, in addition to excluding the 3 arguments:

    ...
    chatbot=gr.Chatbot(height=300, type="messages"),
    ...

Also, there's an error thrown when one tries to click on any of the examples:

/gradio/components/chatbot.py", line 321, in _check_format
    raise Error(
gradio.exceptions.Error: "Data incompatible with messages format. Each message should be a dictionary with 'role' and 'content' keys or a ChatMessage object.

Gradio environment:

Gradio Environment Information:
------------------------------
Operating System: Linux
gradio version: 5.5.0
gradio_client version: 1.4.2

@kebiyoon
Copy link

kebiyoon commented Nov 12, 2024

I faced the same problem....😂
Here's the documentation written about the changes in the gradio5 version. It says that the 'retry_btn', 'undo_btn', and 'clear_btn' parameters are all gone.

#9463

@abidlabs abidlabs self-assigned this Nov 16, 2024
@burtenshaw
Copy link

I also found this error.

@abidlabs I have some time to tackle it, if you think it's a good first issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working docs/website Related to documentation or website
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants