Intercepting Player-to-Character Messages

Hello, I have a bit of a borderline use case. I’m trying to intercept the player-to-character messages (sent via voice/chat ui) to pre-process them before they get sent to the convAI API.

Is there any easy way to add this functionality without either editing or rewriting the core Unity plugin classes?

Hello @massimo.zancanaro,

Welcome to the Convai Developer Forum!

Could you please share a bit more detail about your use case?

Hi, thanks for the quick reply.

I’m trying to intercept the player-to-character messages to perform a set of language processing tasks on their content (sentiment analysis, to give an example), update a set of game state variables, and only then pass the player message to the convAI API.

I know this may add significant latency, but I need a more flexible solution than the one provided by the NarrativeDesign module.

Thanks for the detailed explanation.

For this level of customization, you can indeed record the audio yourself, perform your desired language processing tasks, and then send the audio to Convai manually once it’s ready.

While we don’t provide direct support for these kinds of custom workflows, we encourage you to explore the existing integration as a reference. Specifically, you may want to review the logic in:

Assets/Convai/Scripts/Runtime/Core/ConvaiGRPCAPI.cs

This will give you a better understanding of the current communication flow with the Convai API and help you adapt it to your needs.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.