https://retellai.com/?utm_source=discord&utm_medium=seo logo
Voice agent call end and function calling issues
# ❓・bug-report
k
I've had this issue where my voice agents don't end the call when it's supposed to end. using single prompt agents, specified clear instructions on last message to be given, after which call should be ended by agent. There's another issue - we're doing MCP calls to a third party server using custom functions (that calls a mcp proxy, which does some helpful business logic on top of the query). The use cases and schema of these custom function (http calls) are well defined, sometimes the agent understands which call is to be done, announces it's gonna do it, then comes to a halt. Note - the mcp calls are blazing fast so that's not the issue here, also, the actual http calls haven't been initiated yet. How can these be fixed?
c
which model are you using? also if you could show me the strict prompt you’re using to call the end_call function
k
gpt 4o mini as llm, temp 0.0 single prompt agent examples of prompt to end the call (defined in an expected conversation flow section) Step C: Final Closing - Confirm the action and thank them. Then, state that you are ending the call. This is the final utterance. End the call after saying this. - Example: "Perfect. I'm sending that link to your email now. Thank you for shopping with us. Goodbye." (end the call right after saying this) This instruction to end call after final closing is done is repeated in other places like: - End the call after the final closing steps are done. This is extremely important, refer to conversation flow closing steps.
c
you need to have the “end_call” function and tell the ai to call that function
k
Sure, I'll check out how to create that end call fn How about the other issue, where the agent says it's going to call a function, but then doesn't do that until it's interrupted Example - search custom function (http req) call User says something that will trigger the call Agent: sure, let me search for (query) - stops here, doesn't execute the tool. If the user says something to interrupt the function is called correctly. The function calls have a really low latency so this shouldn't be happening (agent says nothing or executes nothing until it's interrupted - even after minutes)
c
it’s better to make it not say anything when calling tools, and either use the speak after execution or confirm and then call it