dialogflow-android-client
dialogflow-android-client copied to clipboard
Last results sent to partialResultsListener do not match resolvedQuery
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?
"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??