Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd515133

Browse files
authored
docs: Update document pages for v0.5.0 release (#2019)
1 parent69c3357 commitd515133

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

‎docs/realtime/guide.md‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,35 @@ Send audio to the session using [`session.send_audio(audio_bytes)`][agents.realt
156156

157157
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.
158158

159+
##SIP integration
160+
161+
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.
162+
163+
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.
164+
165+
```python
166+
from agents.realtimeimport RealtimeAgent, RealtimeRunner
167+
from agents.realtime.openai_realtimeimport OpenAIRealtimeSIPModel
168+
169+
runner= RealtimeRunner(
170+
starting_agent=agent,
171+
model=OpenAIRealtimeSIPModel(),
172+
)
173+
174+
asyncwithawait runner.run(
175+
model_config={
176+
"call_id": call_id_from_webhook,
177+
"initial_model_settings": {
178+
"turn_detection": {"type":"semantic_vad","interrupt_response":True},
179+
},
180+
},
181+
)as session:
182+
asyncfor eventin session:
183+
...
184+
```
185+
186+
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).
187+
159188
##Direct model access
160189

161190
You can access the underlying model to add custom listeners or perform advanced operations:

‎docs/release.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ We will increment `Z` for non-breaking changes:
1919

2020
##Breaking change changelog
2121

22+
###0.5.0
23+
24+
This version doesn’t introduce any visible breaking changes, but it includes new features and a few significant updates under the hood:
25+
26+
- Added support for`RealtimeRunner` to handle[SIP protocol connections](https://platform.openai.com/docs/guides/realtime-sip)
27+
- Significantly revised the internal logic of`Runner#run_sync` for Python 3.14 compatibility
28+
2229
###0.4.0
2330

2431
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.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp