From the course: OpenAI API: Building Front-End Voice Apps with the Realtime API and WebRTC

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Function calling with the Realtime API

Function calling with the Realtime API

- [Instructor] I think function calling is one of the most powerful features of any AI model, and the realtime API has function calling both for voice and for text. It's documented under the realtime model capabilities page and function calling, and it works the same as regular function calling with one significant difference. It's working inside the web RTC environment. So to detect function calling, you have to intercept text responses and then see whether or not they are function calls, and then fire off the function calls. For this example, I'm making a call to Open Meteo to get the weather data, and I actually have two functions. I have one that looks for weather in some specified location, and one that looks for weather in whatever location the computer you are currently using is by hooking into the geolocation feature in the browser. So let's look what happens when I create a connection. - [AI] Hello, how can I assist you today? - [Instructor] What's the weather like in Oslo…

Contents