diff --git a/chatterbot/chatterbot.py b/chatterbot/chatterbot.py index fc242c7d1..70371f944 100644 --- a/chatterbot/chatterbot.py +++ b/chatterbot/chatterbot.py @@ -111,7 +111,7 @@ def get_response(self, input_item, session_id=None): for preprocessor in self.preprocessors: input_statement = preprocessor(self, input_statement) - statement, response, confidence = self.generate_response(input_statement, session_id) + statement, response = self.generate_response(input_statement, session_id) # Learn that the user's input was a valid response to the chat bot's previous output previous_statement = self.conversation_sessions.get( @@ -122,7 +122,7 @@ def get_response(self, input_item, session_id=None): self.conversation_sessions.update(session_id, (statement, response, )) # Process the response output with the output adapter - return self.output.process_response(response, confidence, session_id) + return self.output.process_response(response, session_id) def generate_response(self, input_statement, session_id=None): """ @@ -137,7 +137,7 @@ def generate_response(self, input_statement, session_id=None): # Select a response to the input statement response = self.logic.process(input_statement) - return input_statement, response, response.confidence + return input_statement, response def learn_response(self, statement, previous_statement): """ diff --git a/tests/test_chatbot.py b/tests/test_chatbot.py index 99fb4ef0f..20094a9d7 100644 --- a/tests/test_chatbot.py +++ b/tests/test_chatbot.py @@ -108,11 +108,11 @@ def test_response_extra_data(self): def test_generate_response(self): statement = Statement('Many insects adopt a tripedal gait for rapid yet stable walking.') - input_statement, response, confidence = self.chatbot.generate_response(statement) + input_statement, response = self.chatbot.generate_response(statement) self.assertEqual(input_statement, statement) self.assertEqual(response, statement) - self.assertEqual(confidence, 1) + self.assertEqual(response.confidence, 1) def test_learn_response(self): previous_response = Statement('Define Hemoglobin.')