csvaldellon commited on
Commit
577e00d
·
1 Parent(s): ecbc7d3

fix: index by queryResult first before intent and confidence

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -25,7 +25,7 @@ async def webhook(request: Request):
25
  data = await request.json()
26
  logger.info(data)
27
 
28
- intent_name = data['intent']['displayName']
29
- confidence_score = data['intentDetectionConfidence']
30
 
31
  return {"fulfillmentText": f"I am {round(confidence_score*100, 2)}% certain you are talking about {intent_name}."}
 
25
  data = await request.json()
26
  logger.info(data)
27
 
28
+ intent_name = data['queryResult']['intent']['displayName']
29
+ confidence_score = data['queryResult']['intentDetectionConfidence']
30
 
31
  return {"fulfillmentText": f"I am {round(confidence_score*100, 2)}% certain you are talking about {intent_name}."}