I use SendTextDataAsync() quite a lot, I’m finding that when doing something like
convaiNPC.SendTextDataAsync("<speak> You and the player have just finished doing 3 minutes of exercises, express that you feel better after doing them and congratulate the player for finishing them. <speak>");
to make the character communicate something to the player has the unintended side effect of triggering an Action of the character if the phrase within speak contains words that if spoken by the player would trigger an existing Action. So in that phrase above it will set off the character to exercise again even though this shouldn’t happen. So basically what I’m wondering is can things within speak tags not be evaluated as a possible Action? I’m getting around this at the moment so no biggie if not possible.
This issue will only occur when using Llama or Mistral models. For all other models, any content wrapped in <speak> tags is not evaluated for triggering actions.
As a workaround, you can either:
Switch to a different supported model or
On the client side, disable or skip action evaluation when you’re using <speak> in your SendTextDataAsync() calls.
Ok K3 thank you for the explanation, I use Llama. I am getting around it for now by setting a bool called cancelAction to true to indicate a speak is about to be executed, then in the convai action handler script, in the methods for each action, there’s a check in each action for this bool and if it’s true the method returns early and sets the bool to false.
I also set a co-routine to run when the speak is executed to that sets the bool to false after 8 seconds, just in case the speak doesn’t invoke an action, so the bool is not stuck on true and therefore stopping an action. It’s a bit messy but it works.
By the way I’ve noticed how the character reply latency is usually lower recently than it was a few months ago, nice work!