Hi, I am experimenting with realtime API and function calling. I have one specific function call that places an order and may take a long time (ex: 30 seconds) to complete. In my client code I am ensuring that when a call is in progress, the order is not placed twice (i.e. there cannot be 2 running “place_order” calls in progress). Still, realtime API behaves inconsistently when asking about the state of the request in progress.
- Sometimes, it says that the order is completed, when it is still in progress.
- Sometimes, it says that the order is completed, but if asked to check again it says that it is not
- When placing another order, I suspect that when I as about the status of the request, it refers to the previous one.
I’m not sure how to handle this, aside from totally blocking the audio until the request is complete.
I’ve tried:
- When a function call is in progress, returning something like: { “status”: “in progress” }
- Specifying the requirement in the prompt in various ways:
- Never start a new request until the previous one is complete
- When asked about the state of the request, check if the function call is still in progress
etc.
Has anyone tried to address this? Any suggestions? Thanks