From 636d24c214477e17a91f23659d6cca4001bfe8a8 Mon Sep 17 00:00:00 2001 From: Dan Martins Date: Tue, 28 Oct 2025 23:35:29 -0400 Subject: [PATCH] update Realtime API example for GA version --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9311b477a3..21f79312a1 100644 --- a/README.md +++ b/README.md @@ -244,7 +244,9 @@ async def main(): client = AsyncOpenAI() async with client.realtime.connect(model="gpt-realtime") as connection: - await connection.session.update(session={'modalities': ['text']}) + await connection.session.update( + session={"type": "realtime", "output_modalities": ["text"]} + ) await connection.conversation.item.create( item={ @@ -256,10 +258,10 @@ async def main(): await connection.response.create() async for event in connection: - if event.type == 'response.text.delta': + if event.type == "response.output_text.delta": print(event.delta, flush=True, end="") - elif event.type == 'response.text.done': + elif event.type == "response.output_text.done": print() elif event.type == "response.done":