input: 
  def chatbot():
      """
      Create a simple chatbot using Python with state diagrams. This function initializes 
      states for the chatbot, each with a message and possible replies that transition 
      to another state. The function then runs an infinite loop where it interacts with 
      the user, updates states based on user input, and keeps track of the conversation. 
      The conversation ends when the chatbot reaches a terminal state with no replies.
      >>> chatbot()
      Hello! How can I help you?
      >> I need some advice
      Sure, what kind of advice do you need?
      >> Career advice
      It is always a good idea to research the field you are interested in and creating a plan to learn the skills that are required. Make sure to contact professionals in the field to understand their experience.
      Goodbye!
      =========================
      Conversation:
      Hello! How can I help you?
      I need some advice
      Sure, what kind of advice do you need?
      Career advice
      It is always a good idea to research the field you are interested in and creating a plan to learn the skills that are required. Make sure to contact professionals in the field to understand their experience.
      """
  
output:     
      states = {
          "start": {
              "message": "Hello! How can I help you?",
              "replies": {
                  "I need some advice": "advice"
              }
          },
          "advice": {
              "message": "Sure, what kind of advice do you need?",
              "replies": {
                  "Career advice": "career_advice",
                  "Relationship advice": "relationship_advice"
              }
          },
          "career_advice": {
              "message": "It is always a good idea to research the field you are interested in and creating a plan to learn the skills that are required. Make sure to contact professionals in the field to understand their experience.",
              "replies": {}
          },
          "relationship_advice": {
              "message": "Communication is key in any relationship. Make sure to listen to your partner and express your feelings openly.",
              "replies": {}
          }
      }
  
      current_state = "start"
      while states[current_state]["replies"]:
          print(states[current_state]["message"])
          user_input = input(">> ").strip()
          if user_input in states[current_state]["replies"]:
              current_state = states[current_state]["replies"][user_input]
          else:
              print("I didn't understand that. Please try again.")
  
      print(states[current_state]["message"])
      print("Goodbye!")
      print("=" * 25)
      print("Conversation:")
      for state in states:
          print(states[state]["message"])
  