class_docstr: 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
code: def _preprocess_chat_messages(
      self, chat_message: str | FileMessage | None
  ) -> str | tuple[str | None] | tuple[str | None, str] | None:
      if chat_message is None:
          return None
      elif isinstance(chat_message, FileMessage):
          if chat_message.alt_text is not None:
              return (chat_message.file.path, chat_message.alt_text)
          else:
              return (chat_message.file.path,)
      elif isinstance(chat_message, str):
          return chat_message
      else:
          raise ValueError(
              f"Invalid message for Chatbot component: {chat_message}"
          )
  
imports: from __future__ import annotations
  import inspect
  from pathlib import Path
  from typing import Any, Callable, List, Literal, Optional, Tuple, Union
  from gradio_client import utils
  from gradio_client.documentation import document, set_documentation_group
  from gradio import processing_utils, utils
  from gradio.components.base import Component
  from gradio.data_classes import FileData, GradioModel, GradioRootModel
  from gradio.events import Events
label_desc: Use image node_id 2 for calling the Chatbot obj's underlying member method code with example usage: obj._preprocess_chat_messages(chat_message) and returns: None, chat_message,  chat_message, chat_message, chat_message