Hi,
I would like to initialize a chatbot with a different db name.. Is it possible to do it?
I can do it for the JsonFileStorageAdapter class by
j1 = JsonFileStorageAdapter(database = "sampledb.db")
However, I am not sure how to create a chatbot that references a db other than database.db
As of now I am doing the following.. please let me know if this is correct:
c1 = ChatBot("wisebot", storage_adapter = "chatterbot.storage.JsonFileAdapter")
c1.storage.__init__(database = "sampledb.db")
I can see a separate db called sampledb being created if this is being done...But im not sure if this is the apt way to do it :)
Did you tried like this
# -*- coding: utf-8 -*-
from chatterbot import ChatBot
# Create a new instance of a ChatBot
bot = ChatBot(
'Exact Response Example Bot',
storage_adapter='chatterbot.storage.JsonFileStorageAdapter',
database='myJson.db',
)
# Get a response given the specific input
response = bot.get_response('Help me!')
print(response)
Yes. It works... silly me.
Thanks.
Response while using the storage adapter is too slow
What can be done in order to get a swift response?
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.
Most helpful comment
Did you tried like this