from chatterbot import ChatBot

# Create a new chat bot named Charlie
chatbot = ChatBot('Charlie')

# Get a response to the input text 'How are you?'
response = chatbot.get_response('How are you?')

print(response)

from chatterbot import ChatBot

# Create a new chat bot named Charlie
chatbot = ChatBot(
    'Charlie',
    trainer='chatterbot.trainers.ListTrainer'
)

chatbot.train([
    "Hi, can I help you?",
    "Sure, I'd to book a flight to Iceland.",
    "Your flight has been booked."
])

# Get a response to the input text 'How are you?'
response = chatbot.get_response('I would like to book a flight.')

print(response)

Add training to basic example
Add training to basic example

  from chatterbot import ChatBot
  
  # Create a new chat bot named Charlie
- chatbot = ChatBot('Charlie')
+ chatbot = ChatBot(
+     'Charlie',
+     trainer='chatterbot.trainers.ListTrainer'
+ )
+ 
+ chatbot.train([
+     "Hi, can I help you?",
+     "Sure, I'd to book a flight to Iceland.",
+     "Your flight has been booked."
+ ])
  
  # Get a response to the input text 'How are you?'
- response = chatbot.get_response('How are you?')
+ response = chatbot.get_response('I would like to book a flight.')
  
  print(response)
  
Add training to basic example
## Code Before:
from chatterbot import ChatBot

# Create a new chat bot named Charlie
chatbot = ChatBot('Charlie')

# Get a response to the input text 'How are you?'
response = chatbot.get_response('How are you?')

print(response)

## Instruction:
Add training to basic example
## Code After:
from chatterbot import ChatBot

# Create a new chat bot named Charlie
chatbot = ChatBot(
    'Charlie',
    trainer='chatterbot.trainers.ListTrainer'
)

chatbot.train([
    "Hi, can I help you?",
    "Sure, I'd to book a flight to Iceland.",
    "Your flight has been booked."
])

# Get a response to the input text 'How are you?'
response = chatbot.get_response('I would like to book a flight.')

print(response)
