input: from typing import Optional
  
  def get_current_datetime(format_string: Optional[str] = "%Y-%m-%d %H:%M:%S") -> str:
      """
      Returns the current date and time as a formatted string.
  
      Args:
      format_string (Optional[str]): The format string to format the date and time. Defaults to "%Y-%m-%d %H:%M:%S".
  
      Returns:
      str: The current date and time formatted according to the format_string.
  
      Example:
      >>> get_current_datetime()
      '2023-10-05 14:30:45'
      >>> get_current_datetime("%m/%d/%Y %I:%M %p")
      '10/05/2023 02:30 PM'
      """
      import datetime
      return datetime.datetime.now().strftime(format_string)
output:     import datetime
      return datetime.datetime.now().strftime(format_string)