https://retellai.com/?utm_source=discord&utm_medium=seo logo
I'm having a problem with AI speak first
# ❓・ai-evy-support
r
@AI Evy I'm having a problem with AI speak first. My first prompt is for it to call a tool, then if the tool is successful i instructure it to speak. From the logs, the tool call is successful, but it doesn't speak.
a
Thanks for tagging me @realee_23147. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there are a few key considerations for handling tool calls when the agent speaks first: When using the LLM WebSocket interface, you need to send a response event that serves as the begin message for the agent to speak [(1) ]() . If you want the agent to wait for user input first, you should set the content to an empty string . For agents that speak first, you can configure a
begin_message_delay_ms
parameter to delay the first message by a specified amount of milliseconds, giving more time to prepare for the call [(2) ]() [(3) ]() . The valid range is [0, 5000] milliseconds . The issue you're experiencing might be related to the timing of when tool calls are executed versus when the agent attempts to speak. According to a Discord discussion, there can be timing issues where tool calls are executed before the agent finishes speaking, potentially causing interruptions [(4) ]() . To troubleshoot your specific issue: 1. Ensure your response event in the WebSocket has proper
content
when you want the agent to speak after a successful tool call [(1) ]() 2. Check that your
content_complete
field is set to true when you've finished streaming the response 3. Consider using the
begin_message_delay_ms
setting if timing is critical [(2) ]() [(3) ]() If you're still experiencing issues where successful tool calls don't trigger agent speech, you may need to review your WebSocket response event structure and ensure you're properly sending res
r
ok
a
ponse events after tool call completion.
​ To learn more, see the sources I considered: [[1] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] Create Agent](https://docs.retellai.com/api-references/create-agent) [[4] Tool Call does not wait for agent to finish speaking](https://discord.com/channels/1186424376300679209/1394595562833318008) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
r
@AI Evy There is asetting where the AI should start speaking on its own after silence. Is this only before a tool call?
a
Thanks for the follow-up, @realee_23147. I'll get back to you soon.
### Answer Based on the available sources, there are several settings that control when the AI agent speaks after silence, and they are not limited to only before tool calls. The main setting you're referring to is
reminder_trigger_ms
[(1) ]() [(2) ]() . If set (in milliseconds) , this will trigger a reminder to the agent to speak if the user has been silent for the specified duration after some agent speech . This must be a positive number, and if unset, the default value of 10000 ms (10 seconds) will apply . You can also control how many times the agent will remind the user with
reminder_max_count
. This controls how many times the agent would remind the user when the user is unresponsive . It must be a non-negative integer, and if unset, the default value of 1 will apply (remind once) . Set to 0 to disable agent from reminding . Additionally, there's an
end_call_after_silence_ms
setting . If users stay silent for a period after agent speech, this will end the call . The minimum value allowed is 10,000 ms (10 seconds) , and by default, this is set to 600000 (10 minutes) . These settings work throughout the conversation flow, not just before tool calls. The agent will use these silence detection and reminder mechanisms during any part of the conversation when it's waiting for user input. If you're using the LLM WebSocket interface, you can also dynamically update these settings during a call using the Update Agent Event [(3) ]() . You can send an agent update event at any time during the call to modify agent configurations, including
reminder_trigger_ms
and
reminder_max_count
.
​ To learn more, see the sources I considered: [[1] Update Agent](https://docs.retellai.com/api-references/update-agent) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) [[3] LLM WebSocket](https://docs.retellai.com/api-references/llm-websocket) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.