pythonpython-3.xchatbotchatterbot

Cannot import name 'input_function' from 'chatterbot.utils'


I'm trying to implement feedback for bot replies created with chatterbot

https://github.com/gunthercox/ChatterBot/issues/935#issuecomment-324230394 But it returns me 2 errors

The first:

ImportError: cannot import name 'input_function' from 'chatterbot.utils' (/Users/xxx/Documents/.../utils.py)

The second one when I set the DEFAULT_SESSION_ID = bot.default_session.id:

Unresolved attribute reference 'default_session' for class 'ChatBot'

Solution

  • The previous one is no longer used. This and the new one. It is used:

    from chatterbot.conversation import Statement
    

    With the appropriate changes to the code present in the example

    https://github.com/gunthercox/ChatterBot/blob/4ff8af28567ed446ae796d37c246bb6a14032fe7/examples/learning_feedback_example.py