Skip to content

Commit

Permalink
fix state selection for child nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Denire committed Sep 10, 2020
1 parent 0de3128 commit 9de6866
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ class CailaIntentActivator(
}
// Sort all predicted intents by context relevance
.sortedByDescending {
StatePath.parse(botContext.dialogContext.currentState)
.stepUp().toString()
.commonPrefixWith(it.first)
var currentState = botContext.dialogContext.currentState
if (currentState == it.first) {
currentState = StatePath.parse(currentState).stepUp().toString()
}
currentState.commonPrefixWith(it.first)
}
.groupBy { it.first }

Expand Down

0 comments on commit 9de6866

Please sign in to comment.