Complete the code to initialize the customer support agent with a knowledge base.
agent = CustomerSupportAgent(knowledge_base=[1])The knowledge base for the agent should be the FAQDatabase, which contains common questions and answers.
Complete the code to preprocess the user's message before passing it to the agent.
processed_message = preprocess([1])The user's message needs to be preprocessed before the agent can understand it.
Fix the error in the code that generates the agent's reply.
reply = agent.generate_reply([1])The agent should generate a reply based on the processed message, not the raw input or other variables.
Fill both blanks to update the agent's state and log the conversation.
agent.update_state([1]) logger.log_conversation([2])
The agent's state should be updated with the reply, and the conversation logger should log the user's original message.
Fill all three blanks to define the main loop of the customer support agent.
while True: [1] = listen_to_user() [2] = preprocess([1]) [3] = agent.generate_reply([2]) send_to_user([3])
The loop listens to the user, preprocesses the input, generates a reply, and sends it back.
