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.
Adding text chat to a Realtime app - OpenAI API Tutorial
From the course: OpenAI API: Building Front-End Voice Apps with the Realtime API and WebRTC
Adding text chat to a Realtime app
- [Instructor] The main feature of the Realtime API is voice and audio. But the API can also receive text inputs and produce text outputs. This can be used in several ways. You can use it to introduce our text chat in your interface. You can also use it to pass in information from, say, function calling. And you can use it to add additional context to the conversation. This process is described in the Realtime models capabilities page, under Text inputs and outputs. And what you see here is, you start out by creating a conversation item, where you pass in the text message, and then you fire off response.create, asking for only text in response. This will give you a pure text-to-text chat with the Realtime API. To see how this works, you can go to the Voice and Text example. Here we have everything from the previous examples, plus a new chat interface at the bottom. So I'll create a connection. - [AI] Hey there, how can I help you today? - [Instructor] Can you write a haiku about a…
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)
-