From 8613a52573ddeaa8c67c1985043046015cc95a0f Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Mon, 10 Jul 2023 10:35:09 -0500 Subject: [PATCH] Quick update for the docstring in `gr.Chatbot` (#4860) * push * docstring * remove file * chatbot * tweak --- gradio/components/chatbot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gradio/components/chatbot.py b/gradio/components/chatbot.py index 2e28a8d493..b37c857084 100644 --- a/gradio/components/chatbot.py +++ b/gradio/components/chatbot.py @@ -25,9 +25,9 @@ set_documentation_group("component") @document() class Chatbot(Changeable, Selectable, IOComponent, JSONSerializable): """ - Displays a chatbot output showing both user submitted messages and responses. Supports a subset of Markdown including bold, italics, code, and images. - Preprocessing: passes the history of messages as a {List[List[str | None | Tuple]]}, i.e. a list of lists. The inner list has 2 elements: the user message and the response message. Messages can be strings, tuples (filepath to image/video/audio, [optional string alt text]), or `None`. - Postprocessing: expects function to return a {List[List[str | None | Tuple]]}, i.e. a list of lists. The inner list should have 2 elements: the user message and the response message. Messages should be strings, tuples, or Nones. If the message is a string, it can include Markdown. If it is a tuple, it should consist of (filepath to image/video/audio, [optional string alt text]). Messages that are `None` are not displayed. + Displays a chatbot output showing both user submitted messages and responses. Supports a subset of Markdown including bold, italics, code, tables. Also supports audio/video/image files, which are displayed in the Chatbot, and other kinds of files which are displayed as links. + Preprocessing: passes the messages in the Chatbot as a {List[List[str | None | Tuple]]}, i.e. a list of lists. The inner list has 2 elements: the user message and the response message. See `Postprocessing` for the format of these messages. + Postprocessing: expects function to return a {List[List[str | None | Tuple]]}, i.e. a list of lists. The inner list should have 2 elements: the user message and the response message. The individual messages can be (1) strings in valid Markdown, (2) tuples if sending files: (a filepath or URL to a file, [optional string alt text]) -- if the file is image/video/audio, it is displayed in the Chatbot, or (3) None, in which case the message is not displayed. Demos: chatbot_simple, chatbot_multimodal Guides: creating-a-chatbot