Skip to content

Commit

Permalink
Fix Dialogflow confidence check
Browse files Browse the repository at this point in the history
  • Loading branch information
morfeusys committed Nov 12, 2020
1 parent 1d7dca1 commit 8a61fc5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ class DialogflowIntentActivator(
override fun recogniseIntent(botContext: BotContext, request: BotRequest): List<DialogflowActivatorContext> {
val params = queryParametersProvider.provideParameters(botContext, request)

val qr = connector.detectIntent(request, params) ?: return emptyList()
val qr = connector.detectIntent(request, params)
?.takeIf { it.intentDetectionConfidence > 0 } ?: return emptyList()

val intent = when {
qr.intent.displayName.isNotEmpty() -> qr.intent.displayName
Expand Down

0 comments on commit 8a61fc5

Please sign in to comment.