Chatterbot: chatterbot.logic.SpecificResponseAdapter not giving specified response

Created on 31 May 2019  路  3Comments  路  Source: gunthercox/ChatterBot

While running the code on documentation

from chatterbot import ChatBot

Create a new instance of a ChatBot

bot = ChatBot(
'Exact Response Example Bot',
storage_adapter='chatterbot.storage.SQLStorageAdapter',
logic_adapters=[
{
'import_path': 'chatterbot.logic.BestMatch'
},
{
'import_path': 'chatterbot.logic.SpecificResponseAdapter',
'input_text': 'Help me!',
'output_text': 'Ok, here is a link: http://chatterbot.rtfd.org'
}
]
)

Get a response given the specific input

response = bot.get_response('Help me!')
print(response)

output_text': 'Ok, here is a link: http://chatterbot.rtfd.org' ---IS NOT PRINTED

bug

Most helpful comment

similar issue. you can find solution in this issue.

All 3 comments

similar issue. you can find solution in this issue.

    self.response_statement = Statement(text=output_text)

def can_process(self, statement):
    if statement == self.input_text:
    if str(statement) == self.input_text:  ###code change calling str explicitly solves the problem 
        return True

    return False

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yuvalBor picture yuvalBor  路  3Comments

engrphil picture engrphil  路  3Comments

coolrb picture coolrb  路  3Comments

gunthercox picture gunthercox  路  3Comments

AfrahAsif picture AfrahAsif  路  3Comments