class_docstr: ChatInterface is Gradio's high-level abstraction for creating chatbot UIs, and allows you to create
  a web-based demo around a chatbot model in a few lines of code. Only one parameter is required: fn, which
  takes a function that governs the response of the chatbot based on the user input and chat history. Additional
  parameters can be used to control the appearance and behavior of the demo.
  
  Example:
      import gradio as gr
  
      def echo(message, history):
          return message
  
      demo = gr.ChatInterface(fn=echo, examples=["hello", "hola", "merhaba"], title="Echo Bot")
      demo.launch()
  Demos: chatinterface_random_response, chatinterface_streaming_echo
  Guides: creating-a-chatbot-fast, sharing-your-app
code: def _setup_api(self) -> None:
      api_fn = (
          self._api_stream_fn
          if self.is_generator
          else self._api_submit_fn
      )
  
      self.fake_api_btn.click(
          api_fn,
          [self.textbox, self.chatbot_state] + self.additional_inputs,
          [self.textbox, self.chatbot_state],
          api_name="chat",
          concurrency_limit=cast(
              Union[int, Literal["default"], None],
              self.concurrency_limit,
          ),
      )
  
imports: from __future__ import annotations
  import inspect
  from typing import AsyncGenerator, Callable, Literal, Union, cast
  import anyio
  from gradio_client import utils
  from gradio_client.documentation import document, set_documentation_group
  from gradio.blocks import Blocks
  from gradio.components import Button, Chatbot, Component, Markdown, State, Textbox, get_component_instance
  from gradio.events import Dependency, on
  from gradio.helpers import create_examples
  from gradio.helpers import special_args
  from gradio.layouts import Accordion, Column, Group, Row
  from gradio.routes import Request
  from gradio.themes import ThemeClass
  from gradio.utils import SyncToAsyncIterator, async_iteration
label_desc: Use image node_id 4 for calling the ChatInterface obj's underlying member method code with example usage: obj._setup_api() without return types