Skip to content

Commit

Permalink
Add response to statement instead of statement.
Browse files Browse the repository at this point in the history
This was creating an issue durring serialization because a serialized
response object was expected.
  • Loading branch information
gunthercox committed Aug 9, 2016
1 parent 154757c commit e7b21b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions chatterbot/chatterbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .adapters.logic import LogicAdapter, MultiLogicAdapter
from .adapters.input import InputAdapter
from .adapters.output import OutputAdapter
from .conversation import Statement
from .conversation import Statement, Response
from .utils.queues import ResponseQueue
from .utils.module_loading import import_module

Expand Down Expand Up @@ -143,7 +143,9 @@ def get_response(self, input_item):
previous_statement = self.get_last_response_statement()

if previous_statement:
input_statement.add_response(previous_statement)
input_statement.add_response(
Response(previous_statement.text)
)

# Update the database after selecting a response
self.storage.update(input_statement)
Expand Down

0 comments on commit e7b21b3

Please sign in to comment.