@@ -61,8 +61,8 @@ def api():
61
61
intent = Intent .objects (
62
62
intentId = app .config ["DEFAULT_WELCOME_INTENT_NAME" ]).first ()
63
63
result_json ["complete" ] = True
64
- result_json ["intent" ]["intentId " ] = intent .intentId
65
- result_json ["intent" ]["id" ] = str (intent .id )
64
+ result_json ["intent" ]["object_id " ] = str ( intent .id )
65
+ result_json ["intent" ]["id" ] = str (intent .intentId )
66
66
result_json ["input" ] = request_json .get ("input" )
67
67
template = Template (
68
68
intent .speechResponse ,
@@ -74,7 +74,7 @@ def api():
74
74
75
75
intent_id , confidence ,suggetions = predict (request_json .get ("input" ))
76
76
app .logger .info ("Suggetions => %s" % suggetions )
77
- intent = Intent .objects .get (id = ObjectId ( intent_id ) )
77
+ intent = Intent .objects .get (intentId = intent_id )
78
78
79
79
if intent .parameters :
80
80
parameters = intent .parameters
@@ -84,9 +84,9 @@ def api():
84
84
if ((request_json .get ("complete" ) is None ) or (
85
85
request_json .get ("complete" ) is True )):
86
86
result_json ["intent" ] = {
87
- "name " : intent .name ,
87
+ "object_id " : str ( intent .id ) ,
88
88
"confidence" : confidence ,
89
- "id" : str (intent .id )
89
+ "id" : str (intent .intentId )
90
90
}
91
91
92
92
if parameters :
@@ -127,7 +127,7 @@ def api():
127
127
elif request_json .get ("complete" ) is False :
128
128
if "cancel" not in intent .name :
129
129
intent_id = request_json ["intent" ]["id" ]
130
- intent = Intent .objects .get (id = ObjectId ( intent_id ) )
130
+ intent = Intent .objects .get (intentId = intent_id )
131
131
132
132
extracted_parameter = entity_extraction .replace_synonyms ({
133
133
request_json .get ("currentNode" ): request_json .get ("input" )
0 commit comments