dialogflow-android-client icon indicating copy to clipboard operation
dialogflow-android-client copied to clipboard

Last results sent to partialResultsListener do not match resolvedQuery

Open PLNech opened this issue 7 years ago • 1 comments

If I store the results sent to my partialResultsListener, they do not match what was sent to API.AI and is returned in resolvedQuery:

Sample code

aiButton.setPartialResultsListener { partialResults ->
    if (!TextUtils.isEmpty(result)) {
        lastPartialResults = partialResults[0]
    }
}
aiButton.setResultsListener(object : AIButton.AIButtonListener {
    override fun onResult(response: AIResponse) {
        runOnUiThread {
            Log.d("VoiceActivity", "lastPartialResults: " + lastPartialResults)
            Log.e("VoiceActivity", "Results.query: " + response.result.resolvedQuery)
        }
   }
}

Logs

08-28 14:08:37.178 12491-12491/com.app.example D/PLN: lastPartialResults: Tina music from Eminem 08-28 14:08:37.178 12491-12491/com.app.example E/PLN: Results.query: Sienna music from Eminem 08-28 14:08:54.206 12491-12491/com.app.example D/PLN: lastPartialResults: any music by The Doors 08-28 14:08:54.207 12491-12491/com.app.example E/PLN: Results.query: funny music by The Doors

  • Why is there a difference between the results sent to the listener and the one sent to the server?
  • Can we get the final input before it's sent to the API?

PLNech avatar Aug 28 '17 12:08 PLNech

"Can we get the final input before it's sent to the API?", same question here... in my case, I want to show text spoken by the user, but "onPartialResults" is executing after "onListeningFinished" ends... So, to clarify, my question is: Is there a way to access send text before send it to Dialogflow??

CabuxaMapache avatar Apr 18 '18 07:04 CabuxaMapache