From fb026158cd2d387e0c9e72de0f95395e6cf8f0e4 Mon Sep 17 00:00:00 2001 From: Kazuhiro Sera Date: Fri, 31 Oct 2025 14:44:02 +0900 Subject: [PATCH] docs: Update document pages for v0.5.0 release --- docs/realtime/guide.md | 29 +++++++++++++++++++++++++++++ docs/release.md | 7 +++++++ 2 files changed, 36 insertions(+) diff --git a/docs/realtime/guide.md b/docs/realtime/guide.md index 3e36a6b1f..1bdc059fa 100644 --- a/docs/realtime/guide.md +++ b/docs/realtime/guide.md @@ -156,6 +156,35 @@ Send audio to the session using [`session.send_audio(audio_bytes)`][agents.realt For audio output, listen for `audio` events and play the audio data through your preferred audio library. Make sure to listen for `audio_interrupted` events to stop playback immediately and clear any queued audio when the user interrupts the agent. +## SIP integration + +You can attach realtime agents to phone calls that arrive via the [Realtime Calls API](https://platform.openai.com/docs/guides/realtime-sip). The SDK provides [`OpenAIRealtimeSIPModel`][agents.realtime.openai_realtime.OpenAIRealtimeSIPModel], which reuses the same agent flow while negotiating media over SIP. + +To use it, pass the model instance to the runner and supply the SIP `call_id` when starting the session. The call ID is delivered by the webhook that signals an incoming call. + +```python +from agents.realtime import RealtimeAgent, RealtimeRunner +from agents.realtime.openai_realtime import OpenAIRealtimeSIPModel + +runner = RealtimeRunner( + starting_agent=agent, + model=OpenAIRealtimeSIPModel(), +) + +async with await runner.run( + model_config={ + "call_id": call_id_from_webhook, + "initial_model_settings": { + "turn_detection": {"type": "semantic_vad", "interrupt_response": True}, + }, + }, +) as session: + async for event in session: + ... +``` + +When the caller hangs up, the SIP session ends and the realtime connection closes automatically. For a complete telephony example, see [`examples/realtime/twilio_sip`](https://github.com/openai/openai-agents-python/tree/main/examples/realtime/twilio_sip). + ## Direct model access You can access the underlying model to add custom listeners or perform advanced operations: diff --git a/docs/release.md b/docs/release.md index f0509b298..95a4f67a4 100644 --- a/docs/release.md +++ b/docs/release.md @@ -19,6 +19,13 @@ We will increment `Z` for non-breaking changes: ## Breaking change changelog +### 0.5.0 + +This version doesn’t introduce any visible breaking changes, but it includes new features and a few significant updates under the hood: + +- Added support for `RealtimeRunner` to handle [SIP protocol connections](https://platform.openai.com/docs/guides/realtime-sip) +- Significantly revised the internal logic of `Runner#run_sync` for Python 3.14 compatibility + ### 0.4.0 In this version, [openai](https://pypi.org/project/openai/) package v1.x versions are no longer supported. Please use openai v2.x along with this SDK.