Supporting a double response for function callbacks #1104
Replies: 4 comments 1 reply
-
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.
-
Thanks for sharing. Have you tried using https://developers.deepgram.com/docs/voice-agent-inject-agent-message|InjectAgentMessage to help facilitate the behavior you are describing?
|
Beta Was this translation helpful? Give feedback.
-
Consider the following conversation in real life:
User: "Record my weight of 80 kilos."
Agent: "Sure. Just give me a moment"
(short pause)
Agent: "Okay, your weight of 80 kilos has been recorded."
This type of conversation does not appear to be possible using Deepgram's voice agent. As soon as the user says "Record my weight of 80 kilos.", this triggers a function callback where the weight gets stored. Only after the weight has been stored, can the agent respond back with something like "Your weight of 80 kilos has been stored."
This would be acceptable if the speed of storing the value was fast and the agent could reply quickly. In reality, there is usually a short pause but just long enough that the user may question whether the agent even heard them.
A better solution would be if the agent could first respond with a response like "Sure, just give me a moment", and then proceed to execute the function callback. Then after the callback completes, the agent can then respond a second time by saying "Your weight of 80 kilos has been recorded". By supporting this double response, you tend to mimick human conversation more naturally. Please consider adding this double response when handling function callbacks.
Beta Was this translation helpful? Give feedback.
All reactions