I want to perform a FTP operation on the basis of input data.
Function performing is task is there.
How to call that function. conversation will be like:
chatbot.get_response("I am having some alarms on node")
response - "do you want me to take db backup. Yes/No"
chatbot.get_response("Yes")
reponse - "please wait, I'll notify once backup done"
Now, here when user give "Yes" how will I call the FTP backup function
Also, that operation will take time.
So do I proceed with thread approach, and notify once operation will be done
Or can I make chatterBot inactive, till the time operation completes.
Do i have to write a separate logical adapter for this, or we have inbuilt support for calling functions on the basis of input
@decode007 I think you have to write you own logic adapter based on your question, more information about how to write a new logic adapter documented here http://chatterbot.readthedocs.io/en/stable/logic/create-a-logic-adapter.html
@decode007 I am closing off this issue, Still your problem isn't resolved, please feel free to reopen this issue.
@decode007
I would suggest using threading as an option. Because we know that Python does not provide an Asynchronous model for programming just like NodeJS.
It does not work on callbacks and hence managing time would be a problem in your case.
You can create threads corresponding to different works that you want to do.
t1 = Thread() to run ChatBot
t2 = Thread() to run the Backup process.
and then creating 'the condition' to operate between the two threads.
Threading will help you establish an asynchronous model to perform the backup task and you'll not have to keep ChatBot inactive.
Hope it helps.
:)
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
@decode007 I think you have to write you own logic adapter based on your question, more information about how to write a new logic adapter documented here http://chatterbot.readthedocs.io/en/stable/logic/create-a-logic-adapter.html