K3
September 26, 2024, 7:48pm
1
Original Discord Post by coltonix. | 2024-09-26 19:48:46
Hi Convai, hopefully you could help me with this!
How can I extract the chat btwn the player and Convai NPC (A) during runtime, particularly the user’s voice input in text form?
Additionally, how do I send the entirety of the user’s input all at once to another Convai NPC (B) , so it can analyze the user’s responses?
Appreciate it!
Answer Update:
Discord
Discord
K3
September 26, 2024, 8:07pm
2
Reply by coltonix. | 2024-09-26 20:07:04
I found these two guys but not sure how they can help
Images:
K3
September 26, 2024, 8:15pm
3
Reply by k3kalinix | 2024-09-26 20:15:21
Hello <@367438775263035402>
K3
September 26, 2024, 8:15pm
4
Reply by coltonix. | 2024-09-26 20:15:44
Hi K3! So nice to see you again!
K3
September 26, 2024, 8:21pm
5
Reply by k3kalinix | 2024-09-26 20:21:39
You can use the SendPlayerText and SendCharacterText methods in ConvaiChatUIHandler.cs
Images:
K3
September 26, 2024, 8:24pm
6
Reply by k3kalinix | 2024-09-26 20:24:51
So you can get Chat Messages from this text parameter.
K3
September 26, 2024, 8:32pm
7
Reply by coltonix. | 2024-09-26 20:32:56
Thank you! But I’d like to send all the player’s messages to another Convai character, how should I do it?
K3
September 26, 2024, 8:33pm
8
Reply by k3kalinix | 2024-09-26 20:33:27
Images:
K3
September 26, 2024, 8:33pm
9
Reply by k3kalinix | 2024-09-26 20:33:36
There are two ways.
K3
September 26, 2024, 8:34pm
10
Reply by k3kalinix | 2024-09-26 20:34:18
Just you have to call SendTextDataAsync
K3
September 26, 2024, 8:43pm
11
Reply by coltonix. | 2024-09-26 20:43:41
Where are these two functions? I checked ConvaiNPCManager.cs but couldn’t find .SendTextDataAsync()
K3
September 26, 2024, 8:44pm
12
Reply by k3kalinix | 2024-09-26 20:44:04
Please check ConvaiNPC.cs
K3
September 26, 2024, 8:45pm
13
Reply by coltonix. | 2024-09-26 20:45:24
That’s nice! What format will the sent data be in? How should I receive them?
K3
September 26, 2024, 8:50pm
14
Reply by k3kalinix | 2024-09-26 20:50:11
string
K3
September 26, 2024, 8:50pm
15
Replying to k3kalinix’s Message
Reply by k3kalinix | 2024-09-26 20:21:39
You can use the SendPlayerText and SendCharacterText methods in ConvaiChatUIHandler.cs
Reply by k3kalinix | 2024-09-26 20:50:23
you can use this text parameter
K3
September 26, 2024, 8:59pm
16
Reply by coltonix. | 2024-09-26 20:59:51
Forgive me I am still trying to understand how exactly to utilize the function.
So to extract the all the messages that the player sent to NPC_A, do I just have to call NPC_A.SendTextDataAsync() at the end of the conversation? How do I get the string text data in a json file (if this is necessary)? Because I don’t understand where the messages are sent to when NPC_A.SendTextDataAsync() is called. I just want to keep those messages, so that it can become the input for NPC_B
K3
September 26, 2024, 9:02pm
17
Reply by k3kalinix | 2024-09-26 21:02:03
Ok, I suggest you do some research on the internet for this.
You can get text messages from ConvaiChatUIHandler.cs (SendPlayerText or SendCharacterText methods)
You can do whatever you want with this text parameter. It’s up to you.
K3
September 26, 2024, 9:02pm
18
Reply by k3kalinix | 2024-09-26 21:02:43
You don’t need to convert to JSON.
K3
September 26, 2024, 9:03pm
19
Reply by k3kalinix | 2024-09-26 21:03:39
When you get this text message,
just you need to call NPC_B.TextSendDataAsync(text)
K3
September 26, 2024, 9:23pm
20
Reply by coltonix. | 2024-09-26 21:23:44
Got it! Let me try it and come back to you later