carlo_98907
09/29/2025, 11:29 PMAI Evy
09/29/2025, 11:29 PMAI Evy
09/29/2025, 11:29 PMend_call field to true to actually end the call after the content is spoken :
json
{
"response_type": "response",
"content": "Have a great rest of your day",
"end_call": true
}
Prompt Structure Best Practices:
Structure your prompt with numbered steps, as this tends to improve LLM compliance [(3) ]() . For example:
"When the conversation comes to an end or the user says 'bye':
1. Say 'have a great rest of your day'.
2. Use 'end_call' tool to end the call"
Additional Safeguards:
Consider setting up max call duration and max silence duration in your agent settings as backup measures to prevent overcharging if the end_call function fails .
For Conversation Flow:
If using conversation flow, you can attach the end_call tool to specific nodes or set it as a global node . Make sure your instructions are clear about when to use it .
Testing:
Always test using simulation and verify via logs afterward to ensure the function is being called correctly [(4) ]() .
The key is ensuring both the prompt instruction and the technical implementation (setting end_call: true in the response) work together properly.AI Evy
09/29/2025, 11:29 PMAI Evy
09/29/2025, 11:29 PMcarlo_98907
09/30/2025, 12:05 AMAI Evy
09/30/2025, 12:05 AMAI Evy
09/30/2025, 12:05 AMend_call: true flag is sent, Retell might discard that flag and allow the conversation to continue [(2) ]() . This appears to be a race condition that can affect call termination consistency .
Workaround Suggestions:
One potential solution mentioned is to disconnect the LLM websocket whenever you want to end the call, though this might not be ideal . Another approach is implementing a timer mechanism to timeout and close the socket .
Prompt Structure:
Structure your instructions clearly with numbered steps, as this tends to improve compliance [(3) ]() :
"When the conversation comes to an end or the user says 'bye':
1. Say 'have a great rest of your day'.
2. Use 'end_call' tool to end the call"
The inconsistent behavior you're experiencing with ChatGPT appears to be a known issue that can occur due to timing and race conditions in the system [(2) ]() .AI Evy
09/30/2025, 12:05 AMAI Evy
09/30/2025, 12:05 AMjson
{
"function": "end_call",
"description": "End the call",
"parameters": {
"message": {
"type": "string",
"description": "The message you will say before ending the call with the customer"
}
}
}AI Evy
09/30/2025, 12:05 AM