Dispachter is not printing out the out put of a function from another python file

input_x1=tracker.get_slot("indigestion")
input_x2=tracker.get_slot("loss_of_appetite")
input_x3=tracker.get_slot("abdominal_pain")
input_x4=tracker.get_slot("passage_of_gases")
input_x5=tracker.get_slot("internal_itching")
dispatcher.utter_message(vomitting(input_x1,input_x2,input_x3,input_x4,input_x5)) 

the function from another file is

def vomitting(input_x1,input_x2,input_x3,input_x4,input_x5):
    df= pd.read_csv("Training.csv")  
    X= df[[ 'indigestion', 'loss_of_appetite', 'abdominal_pain' , 'passage_of_gases', 'internal_itching']]
    Y= df['prognosis']
    X.head()
    model= DecisionTreeClassifier()
    model.fit(X,Y)
            
    if input_x1=='indigestion':
        input_x1=1
    else:
        input_x1=0
    if input_x2=='loss_of_appetite':
        input_x2=1
    else:
        input_x2=0
    if input_x3=='abdominal_pain':
        input_x3=1
    else:
        input_x3=0
    if input_x4=='passage_of_gases':
        input_x4=1
    else:
        input_x4=0
    if input_x5=='internal_itching':
        input_x5=1
    else:
        input_x5=0 

    prediction1= model.predict([[input_x1, input_x2, input_x3, input_x4, input_x5]])
     
    pred= str(prediction1[0])
    print(pred)
    #dispatcher.utter_message(pred)  
    return vomitting

dispatcher is giving me an empty value, why is that

Hi!

Does the vomitting function actually return something? Can you try setting a breakpoint or printing the output from within your method?

So like this:

input_x1=tracker.get_slot("indigestion")
input_x2=tracker.get_slot("loss_of_appetite")
input_x3=tracker.get_slot("abdominal_pain")
input_x4=tracker.get_slot("passage_of_gases")
input_x5=tracker.get_slot("internal_itching")

result = vomitting(input_x1,input_x2,input_x3,input_x4,input_x5)
print(result) #BREAKPOINT OR PRINT STATEMENT HERE
dispatcher.utter_message(result)

Another thing you could check, are the slots filled as expected? What values are reaching the vomitting function?