input: Write a function to create a simple chatbot using Python and state diagrams. The function should define the states, initialize the current state, and manage the conversation loop until a terminal state is reached. The function should also print the conversation history at the end.
  assert chatbot() == None
  assert chatbot() != None
output: def chatbot():
      states = {
          'start': {'greet': 'greet', 'exit': 'end'},
          'greet': {'how_are_you': 'how_are_you', 'exit': 'end'},
          'how_are_you': {'good': 'good', 'bad': 'bad', 'exit': 'end'},
          'good': {'exit': 'end'},
          'bad': {'exit': 'end'},
          'end': {}
      }
      
      current_state = 'start'
      conversation_history = []
      
      while current_state != 'end':
          if current_state == 'start':
              conversation_history.append("Bot: Hi! How can I help you today?")
              user_input = input("You: ")
              if user_input.lower() in ['hello', 'hi', 'hey']:
                  current_state = states[current_state]['greet']
              elif user_input.lower() in ['exit', 'bye']:
                  current_state = states[current_state]['exit']
          elif current_state == 'greet':
              conversation_history.append("Bot: How are you feeling today?")
              user_input = input("You: ")
              if user_input.lower() in ['good', 'great', 'fine']:
                  current_state = states[current_state]['how_are_you']
              elif user_input.lower() in ['exit', 'bye']:
                  current_state = states[current_state]['exit']
          elif current_state == 'how_are_you':
              if user_input.lower() in ['good', 'great', 'fine']:
                  conversation_history.append("Bot: That's great to hear!")
                  current_state = states[current_state]['good']
              elif user_input.lower() in ['bad', 'not good']:
                  conversation_history.append("Bot: I'm sorry to hear that. Is there anything I can do to help?")
                  current_state = states[current_state]['bad']
              elif user_input.lower() in ['exit', 'bye']:
                  current_state = states[current_state]['exit']
          elif current_state == 'good':
              conversation_history.append("Bot: Glad to hear that! Have a great day!")
              current_state = states[current_state]['exit']
          elif current_state == 'bad':
              conversation_history.append("Bot: I hope things get better soon. Take care!")
              current_state = states[current_state]['exit']
      
      for line in conversation_history:
          print(line)