Error: "Text message received from client did not match any of the formats we expect." #1090
Replies: 5 comments
-
Thanks for asking your question. Please be sure to reply with as much detail as possible so the community can assist you efficiently. |
Beta Was this translation helpful? Give feedback.
-
Hey there! It looks like you haven't connected your GitHub account to your Deepgram account. You can do this at https://community.deepgram.com - being verified through this process will allow our team to help you in a much more streamlined fashion. |
Beta Was this translation helpful? Give feedback.
-
It looks like we're missing some important information to help debug your issue. Would you mind providing us with the following details in a reply?
|
Beta Was this translation helpful? Give feedback.
-
The problem is that the config uses "SampleRate". It should be "sample_rate". I took this sample code from your own docs: https://developers.deepgram.com/docs/voice-agent The sample code shows "SampleRate". Please fix your documentation and try testing your code next time before documenting it. It took hours to find this bug. |
Beta Was this translation helpful? Give feedback.
-
I received this same error when configuring the 'context' in the settings config with these settings context: {
messages: [
{
type: "assistant",
content:
"Hello! How can I assist you today?",
},
],
replay: true,
},
When I changed it to this it fixed the problem context: {
messages: [
{
//@ts-ignore
role: "assistant", // changed to 'role' instead of 'type'
content:
"Hello! How can I assist you today?",
},
],
replay: true,
}, The incorrect type is in their official SDK as well This from the 3.11.1 version of the Deepgram JS SDK context?: {
/**
* LLM message history (e.g. to restore existing conversation if websocket disconnects)
*/
messages: { type: "user" | "assistant"; content: string }[];
/**
* Whether to replay the last message, if it is an assistant message.
*/
replay: boolean;
}; |
Beta Was this translation helpful? Give feedback.
-
Below is a test script to simply connect to the voice agent. The page includes a button that when clicked will initiate a connection to the voice agent API. When this script is run, the first message that is received is the "Welcome" message. I then start the interval timer with the KeepAlive command. But even before the timer starts, another message is returned in the "message" event listener and it indicates the following error:
What I don't understand is where the backend is getting another command from the client. There are no other commands sent to the backend other than the KeepAlive and even that doesn't even have a chance to trigger before this error message is returned.
Beta Was this translation helpful? Give feedback.
All reactions