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 - OpenAI API Tutorial
From the course: OpenAI API: Building Front-End Voice Apps with the Realtime API and WebRTC
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
-
-
-
-
(Locked)
Hands on with five JavaScript AI voice apps1m 39s
-
(Locked)
OpenAI authentication with ephemeral tokens4m 34s
-
(Locked)
Understanding the WebRTC flow3m 6s
-
(Locked)
A bare-bones JavaScript Realtime API implementation6m 29s
-
(Locked)
Configuring assistant messages and settings3m 21s
-
(Locked)
Adding visualizations with the Web Audio API2m 35s
-
(Locked)
Adding text chat to a Realtime app3m
-
(Locked)
Adding text transcripts for accessibility3m 8s
-
(Locked)
Function calling with the Realtime API4m 1s
-
(Locked)
-