uezo / ChatdollKit

ChatdollKit enables you to make your 3D model into a chatbot
Apache License 2.0
714 stars 75 forks source link

Cancel word not working on Demo #284

Closed brunoatvenosa closed 8 months ago

brunoatvenosa commented 8 months ago

Hi!

I follow the instructions for running the Demo and it works great! Thanks to uezo e all contributors!

I am having a minor issue with the cancel word where the prompt will keep [Listening...] event after the Cancel Word is identified The goodbye response comes duplicated and then a hello response triggers [Listening...] I don't know how to debug this to give adicional information, any help is appreciated.

Thank you guys!

uezo commented 8 months ago

Hi @brunoatvenosa ,

I reproduced the situation where the cancel word doesn't work👍 The found that the recognized text ends with "\n".

I will fix this issue in next update by replacing trailing \n and trimming before evaluate cancel words.

If you want a quick fix, change the code as following:

https://github.com/uezo/ChatdollKit/blob/master/Scripts/Dialog/RequestProvider/VoiceRequestProviderBase.cs#L166

to

var text = request.Text.Replace("\n", "").Trim();