code: def validate_text(toast_text: SupportsStr) -> SupportsStr:
      if str(toast_text) == "":
          raise StreamlitAPIException(
              f"Toast body cannot be blank - please provide a message."
          )
      else:
          return toast_text
  
file_path: streamlit/lib/streamlit/elements/toast.py
imports: from typing import TYPE_CHECKING, Optional, cast
  from streamlit.errors import StreamlitAPIException
  from streamlit.proto.Toast_pb2 import Toast
  from streamlit.runtime.metrics_util import gather_metrics
  from streamlit.string_util import clean_text, validate_emoji
  from streamlit.type_util import SupportsStr
label_desc: Use image node_id 1 for calling a global function with example usage: validate_text(toast_text) and returns: toast_text