File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,9 @@ async def main():
244244 client = AsyncOpenAI()
245245
246246 async with client.realtime.connect(model = " gpt-realtime" ) as connection:
247- await connection.session.update(session = {' modalities' : [' text' ]})
247+ await connection.session.update(
248+ session = {" type" : " realtime" , " output_modalities" : [" text" ]}
249+ )
248250
249251 await connection.conversation.item.create(
250252 item = {
@@ -256,10 +258,10 @@ async def main():
256258 await connection.response.create()
257259
258260 async for event in connection:
259- if event.type == ' response.text .delta' :
261+ if event.type == " response.output_text .delta" :
260262 print (event.delta, flush = True , end = " " )
261263
262- elif event.type == ' response.text .done' :
264+ elif event.type == " response.output_text .done" :
263265 print ()
264266
265267 elif event.type == " response.done" :
You can’t perform that action at this time.
0 commit comments