ModuleNotFoundError: No module named 'chatbot/actions/action_file_01'
Am I doing something wrong and also is there a way to pass all three action_files to the server?
PS: I found a workaround, I don’t think is ideal. I created an actions.py-file inside the project_dir where I just import all my action_files. I then start the sdk-server using:
You don’t necessarily need to create a module that imports all the actions, but you need to make sure that the actions are all part of one module, e.g.
mind the additional __init__.py's to make the folders proper modules. After that you can specify any module and the sdk will recursivly try to find all the actions:
It’s throwing me error , can you please help.
I have written around 18 different custom actions in one actions.py file and i am returning different values but with same keyword in each class.
Its throwing me error that “UnboundLocalError: local variable ‘response’ referenced before assignment”
only the first two classes at top are getting executed and even when I changed the sequence of those two classes only those two are getting executed and other classes are not getting executed.
class AdmissionMcs(Action):
def name(self):
return 'admission_mcs'
def run(self,dispatcher,tracker,domain):
streams=tracker.get_slot('stream')
if 'streams' == 'msc comp sci' or 'mcs':
response=""" The admission for MCS is given on basis of 50% marks of bcs and 50% marks of entrance"""
dispatcher.utter_message(response)
return [SlotSet('stream',streams)]
class AdmissionBcs(Action):
def name(self):
return 'admission_bcs'
def run(self,dispatcher,tracker,domain):
streams=tracker.get_slot('stream')
if 'streams' == 'bcs' or 'bsc comp sci':
response=""" The admission for BCS is given on basis of entrance exam conducted by college"""
dispatcher.utter_message(response)
return [SlotSet('stream',streams)]
class AdmissionBba(Action):
def name(self):
return 'admission_bba'
def run(self,dispatcher,tracker,domain):
streams=tracker.get_slot('stream')
if 'streams' == 'bba':
response=""" The admission for BBA is given through merit list on basis of 12th Marks """
dispatcher.utter_message(response)
return [SlotSet('stream',streams)]
class AdmissionMba(Action):
def name(self):
return 'admission_mba'
def run(self,dispatcher,tracker,domain):
streams=tracker.get_slot('stream')
if 'streams' == 'mba':
response=""" The admission for MBA is given through marks scored in CAT """
dispatcher.utter_message(response)
return [SlotSet('stream',streams)]
The class AdmissionMcs and AdmissionBcs are executing even when i have changed the sequence of it, And when I try to access other classes its throwing me error :Local variable refereed before assignment.
Should i make separate action files or is there solution for this?