Realtime API Function Calling

  1. My prompt requires the Realtime API to call “irrelevant question” tool when a user asks an irrelevant question. We count the number of times a user has asked such questions and warn them the first two times. The third time they get kicked out. Warning for the first 2 times is verbatim the same and we cant change that.
    Realtime API calls the tool correctly the first two times. But the third time it does not call the tool. I am assuming that it just uses the past two times history to respond. There is a no way for me to take out the messages from the first two times because it’s Voice to Voice. How do I make it call the tool 3rd time?
    2. When transferring a call, we ask the prompt to first say “Let me transfer you to someone who can help” and then call a transfer function. It follows that 9 out of 10 Times. but missed that once. Any thoughts how to fix this?

Upon further investigation I found another problem. When I call book_appt tool, it takes 5-6 seconds for the API from 3rd party yo book. The next step in the process if to check if the booking was successful. As it takes 5-6 seconds, Realtime API calls the tool again. I have tried to instruct to not call again but it did not work. Any ideas on how to make Realtime API wait for response?